Can this clamp function (designed for calculators without ABS) be optimized?Confused Range of a FunctionFinding simplest function to distinguish 2 setsOptimize multi-step calculation into one step?Find the range of the function $y = sqrtx^2 + 1− x$?Calculating y = sec(x) functions given points?Can anyone tell me what is the plot for max(abs(x),abs(y),abs(z))=1function with a given average value, how to create?Curve with value $0$ at $x=0$, max value $1$ at $x=1$, then decay approximating $frac1x$?What is the maximum value of this nested radical?Finding maxima of a function $f(x) = sqrtx - 2x^2$ without calculus
How to generate binary array whose elements with values 1 are randomly drawn
Do I need to be arrogant to get ahead?
Do I need to consider instance restrictions when showing a language is in P?
Asserting that Atheism and Theism are both faith based positions
What does "mu" mean as an interjection?
What favor did Moody owe Dumbledore?
PTIJ What is the inyan of the Konami code in Uncle Moishy's song?
Using Past-Perfect interchangeably with the Past Continuous
Bash - pair each line of file
I seem to dance, I am not a dancer. Who am I?
Relation between independence and correlation of uniform random variables
Do US professors/group leaders only get a salary, but no group budget?
What (if any) is the reason to buy in small local stores?
What can I do if I am asked to learn different programming languages very frequently?
Turning a hard to access nut?
Recruiter wants very extensive technical details about all of my previous work
Wrapping homogeneous Python objects
What should I install to correct "ld: cannot find -lgbm and -linput" so that I can compile a Rust program?
Could Sinn Fein swing any Brexit vote in Parliament?
If "dar" means "to give", what does "daros" mean?
Light propagating through a sound wave
Do native speakers use "ultima" and "proxima" frequently in spoken English?
Is it possible to stack the damage done by the Absorb Elements spell?
Is there a hypothetical scenario that would make Earth uninhabitable for humans, but not for (the majority of) other animals?
Can this clamp function (designed for calculators without ABS) be optimized?
Confused Range of a FunctionFinding simplest function to distinguish 2 setsOptimize multi-step calculation into one step?Find the range of the function $y = sqrtx^2 + 1− x$?Calculating y = sec(x) functions given points?Can anyone tell me what is the plot for max(abs(x),abs(y),abs(z))=1function with a given average value, how to create?Curve with value $0$ at $x=0$, max value $1$ at $x=1$, then decay approximating $frac1x$?What is the maximum value of this nested radical?Finding maxima of a function $f(x) = sqrtx - 2x^2$ without calculus
$begingroup$
I realized one day that I could evaluate whether a value is negative or not with one simple function:
$$fracxsqrtx^2$$
This would return $-1$ if $x$ is negative, and $1$ is $x$ is positive. I then used it to "re-straighten" functions that were reflected off of the $x$-axis, for example
$$y=|x|*fracxsqrtx^2$$
I refined these techniques until I came up with a function that removes values from a function that are under a supplied value $c$.
$$y=left(vcenterfrac1left(vcenterfracx-csqrt(x-c)^2right)+1right)(2f(x))$$
This function is quite messy though, and I was hoping there may be a better way. If this is the best way, I would be pretty happy that I nailed this on the first try! I know that this community likes to pick apart inefficiencies in equations, so please do tell if there is a better way! Here is a desmos demonstration...
functions graphing-functions
$endgroup$
add a comment |
$begingroup$
I realized one day that I could evaluate whether a value is negative or not with one simple function:
$$fracxsqrtx^2$$
This would return $-1$ if $x$ is negative, and $1$ is $x$ is positive. I then used it to "re-straighten" functions that were reflected off of the $x$-axis, for example
$$y=|x|*fracxsqrtx^2$$
I refined these techniques until I came up with a function that removes values from a function that are under a supplied value $c$.
$$y=left(vcenterfrac1left(vcenterfracx-csqrt(x-c)^2right)+1right)(2f(x))$$
This function is quite messy though, and I was hoping there may be a better way. If this is the best way, I would be pretty happy that I nailed this on the first try! I know that this community likes to pick apart inefficiencies in equations, so please do tell if there is a better way! Here is a desmos demonstration...
functions graphing-functions
$endgroup$
$begingroup$
Since $|x|=sqrtx^2$ then that is how one would have to calculate $|x|$ on calculators with a square root function but without an absolute value function.
$endgroup$
– John Wayland Bales
Jan 14 at 21:32
add a comment |
$begingroup$
I realized one day that I could evaluate whether a value is negative or not with one simple function:
$$fracxsqrtx^2$$
This would return $-1$ if $x$ is negative, and $1$ is $x$ is positive. I then used it to "re-straighten" functions that were reflected off of the $x$-axis, for example
$$y=|x|*fracxsqrtx^2$$
I refined these techniques until I came up with a function that removes values from a function that are under a supplied value $c$.
$$y=left(vcenterfrac1left(vcenterfracx-csqrt(x-c)^2right)+1right)(2f(x))$$
This function is quite messy though, and I was hoping there may be a better way. If this is the best way, I would be pretty happy that I nailed this on the first try! I know that this community likes to pick apart inefficiencies in equations, so please do tell if there is a better way! Here is a desmos demonstration...
functions graphing-functions
$endgroup$
I realized one day that I could evaluate whether a value is negative or not with one simple function:
$$fracxsqrtx^2$$
This would return $-1$ if $x$ is negative, and $1$ is $x$ is positive. I then used it to "re-straighten" functions that were reflected off of the $x$-axis, for example
$$y=|x|*fracxsqrtx^2$$
I refined these techniques until I came up with a function that removes values from a function that are under a supplied value $c$.
$$y=left(vcenterfrac1left(vcenterfracx-csqrt(x-c)^2right)+1right)(2f(x))$$
This function is quite messy though, and I was hoping there may be a better way. If this is the best way, I would be pretty happy that I nailed this on the first try! I know that this community likes to pick apart inefficiencies in equations, so please do tell if there is a better way! Here is a desmos demonstration...
functions graphing-functions
functions graphing-functions
edited Feb 21 at 4:36
Robert Howard
2,2192935
2,2192935
asked Jan 14 at 16:36
Wasabi ThumbsWasabi Thumbs
133
133
$begingroup$
Since $|x|=sqrtx^2$ then that is how one would have to calculate $|x|$ on calculators with a square root function but without an absolute value function.
$endgroup$
– John Wayland Bales
Jan 14 at 21:32
add a comment |
$begingroup$
Since $|x|=sqrtx^2$ then that is how one would have to calculate $|x|$ on calculators with a square root function but without an absolute value function.
$endgroup$
– John Wayland Bales
Jan 14 at 21:32
$begingroup$
Since $|x|=sqrtx^2$ then that is how one would have to calculate $|x|$ on calculators with a square root function but without an absolute value function.
$endgroup$
– John Wayland Bales
Jan 14 at 21:32
$begingroup$
Since $|x|=sqrtx^2$ then that is how one would have to calculate $|x|$ on calculators with a square root function but without an absolute value function.
$endgroup$
– John Wayland Bales
Jan 14 at 21:32
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
That's not that messy of a function! I've seen this done with absolute values before, but never with just square roots; that's a creative yet simple way to do it. As far as I can tell, there's no way you could reduce that final function any further and still have it do what you want it to.
Edit:
There is.
Let's specifically define the clamping function to be the function by which you multiply $f(x)$ to restrict its domain, and let's give it the name $delta(x)$. Therefore, your clamping function was $$delta_1(x)=vcenterfrac2left(vcenterfracx-csqrt(x-c)^2right)+1$$ After a bit of playing around, I stumbled upon a more concise one: $$delta_2(x)=vcenterfracx-cbig(sqrtx-cbig)^2$$
Notice that $delta_2(x)$ is very similar to the key component of $delta_1(x)$, except for one important difference: the square now comes outside the square root. Why does that matter?
Let's say that we have some function $f(x)$, and we don't want to include any values less than $x=c$ in the graph of $f(x)$. In order to do that, we're going to have to make the function undefined at every value of $x$ where $x<c$, and as far as I can tell, your question is essentially what the most concise way to do that is, while leaving the rest of $f(x)$ untouched.
In general, there are two ways to make a function undefined: division by $0$ and taking the square root of a negative number. We're going to want to use the latter method here, because that works for a range of values (the thing you take the square root of can be anything less than $0$), whereas the first method relies on the argument being exactly $0$, and we have infinitely many values of $x$ for which we want this function to be undefined.
We now know that we want to use the square root of a negative number to make our function undefined whenever $x<c$. Rearranging that inequality yields $x-c<0$, and lo and behold, we have a negative quantity of which we can take the square root. So we know we need a $sqrtx-c$ in our clamping function. We also know that we need $delta(x)$ either to equal $1$ or be undefined. If we were to square $x-c$ inside the square root, the quantity inside the square root would always be positive, no matter what $x$ and $c$ are. The solution, therefore, is to put the square outside of the square root. That way, whenever $x-c<0$, $delta(x)$ is undefined, and whenever $x-c>0$, we can divide $x-c$ by the square of its square root to have $delta(x)=1$. Here's a Desmos graph that shows $delta_2(x)$ at work (though with a slightly different name, because Desmos only likes certain Greek letters, and $delta$ is not one of them): https://www.desmos.com/calculator/fswzdkjq6s
Note 1:
The clamping function I described essentially splits $f(x)$ into a real part and an imaginary part, and then keeps only the real part. If we wanted to keep all the values where $x<c$, we would have to keep the imaginary part and discard the real part. To do that, we can just switch the order of $x$ and $c$, which is analogous to multiplying the top and bottom of $delta(x)$ by $i^2$.
Note 2:
I was intrigued by the conversion of the absolute value function to a function of squares and square roots, so I decided to include something extra in that Desmos link: a generalization of clamping, if you will, that I refer to there as "splicing." It allows you to remove a specific portion of the graph of $f(x)$, and you can adjust both the size of the gap and the $x$-value around which the gap is centered.
Note 3:
Performing the trick of multiplying the top and bottom of a function by $i^2$ works with the splicing function as well; in that case, switching the order of $lvert x-brvert$ and $a$ returns only the part of the function which you had previously "spliced" out.
$endgroup$
1
$begingroup$
Woah, thanks for the super concise response! My calculator has been frustratingly without an absolute value function, meaning this became my go-to. I have a high incentive to make it less of a chore, but couldn't really find a way. Thanks for getting around!
$endgroup$
– Wasabi Thumbs
Feb 24 at 6:13
$begingroup$
You're certainly welcome; I'm glad I could help!
$endgroup$
– Robert Howard
Feb 24 at 17:32
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3073419%2fcan-this-clamp-function-designed-for-calculators-without-abs-be-optimized%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
That's not that messy of a function! I've seen this done with absolute values before, but never with just square roots; that's a creative yet simple way to do it. As far as I can tell, there's no way you could reduce that final function any further and still have it do what you want it to.
Edit:
There is.
Let's specifically define the clamping function to be the function by which you multiply $f(x)$ to restrict its domain, and let's give it the name $delta(x)$. Therefore, your clamping function was $$delta_1(x)=vcenterfrac2left(vcenterfracx-csqrt(x-c)^2right)+1$$ After a bit of playing around, I stumbled upon a more concise one: $$delta_2(x)=vcenterfracx-cbig(sqrtx-cbig)^2$$
Notice that $delta_2(x)$ is very similar to the key component of $delta_1(x)$, except for one important difference: the square now comes outside the square root. Why does that matter?
Let's say that we have some function $f(x)$, and we don't want to include any values less than $x=c$ in the graph of $f(x)$. In order to do that, we're going to have to make the function undefined at every value of $x$ where $x<c$, and as far as I can tell, your question is essentially what the most concise way to do that is, while leaving the rest of $f(x)$ untouched.
In general, there are two ways to make a function undefined: division by $0$ and taking the square root of a negative number. We're going to want to use the latter method here, because that works for a range of values (the thing you take the square root of can be anything less than $0$), whereas the first method relies on the argument being exactly $0$, and we have infinitely many values of $x$ for which we want this function to be undefined.
We now know that we want to use the square root of a negative number to make our function undefined whenever $x<c$. Rearranging that inequality yields $x-c<0$, and lo and behold, we have a negative quantity of which we can take the square root. So we know we need a $sqrtx-c$ in our clamping function. We also know that we need $delta(x)$ either to equal $1$ or be undefined. If we were to square $x-c$ inside the square root, the quantity inside the square root would always be positive, no matter what $x$ and $c$ are. The solution, therefore, is to put the square outside of the square root. That way, whenever $x-c<0$, $delta(x)$ is undefined, and whenever $x-c>0$, we can divide $x-c$ by the square of its square root to have $delta(x)=1$. Here's a Desmos graph that shows $delta_2(x)$ at work (though with a slightly different name, because Desmos only likes certain Greek letters, and $delta$ is not one of them): https://www.desmos.com/calculator/fswzdkjq6s
Note 1:
The clamping function I described essentially splits $f(x)$ into a real part and an imaginary part, and then keeps only the real part. If we wanted to keep all the values where $x<c$, we would have to keep the imaginary part and discard the real part. To do that, we can just switch the order of $x$ and $c$, which is analogous to multiplying the top and bottom of $delta(x)$ by $i^2$.
Note 2:
I was intrigued by the conversion of the absolute value function to a function of squares and square roots, so I decided to include something extra in that Desmos link: a generalization of clamping, if you will, that I refer to there as "splicing." It allows you to remove a specific portion of the graph of $f(x)$, and you can adjust both the size of the gap and the $x$-value around which the gap is centered.
Note 3:
Performing the trick of multiplying the top and bottom of a function by $i^2$ works with the splicing function as well; in that case, switching the order of $lvert x-brvert$ and $a$ returns only the part of the function which you had previously "spliced" out.
$endgroup$
1
$begingroup$
Woah, thanks for the super concise response! My calculator has been frustratingly without an absolute value function, meaning this became my go-to. I have a high incentive to make it less of a chore, but couldn't really find a way. Thanks for getting around!
$endgroup$
– Wasabi Thumbs
Feb 24 at 6:13
$begingroup$
You're certainly welcome; I'm glad I could help!
$endgroup$
– Robert Howard
Feb 24 at 17:32
add a comment |
$begingroup$
That's not that messy of a function! I've seen this done with absolute values before, but never with just square roots; that's a creative yet simple way to do it. As far as I can tell, there's no way you could reduce that final function any further and still have it do what you want it to.
Edit:
There is.
Let's specifically define the clamping function to be the function by which you multiply $f(x)$ to restrict its domain, and let's give it the name $delta(x)$. Therefore, your clamping function was $$delta_1(x)=vcenterfrac2left(vcenterfracx-csqrt(x-c)^2right)+1$$ After a bit of playing around, I stumbled upon a more concise one: $$delta_2(x)=vcenterfracx-cbig(sqrtx-cbig)^2$$
Notice that $delta_2(x)$ is very similar to the key component of $delta_1(x)$, except for one important difference: the square now comes outside the square root. Why does that matter?
Let's say that we have some function $f(x)$, and we don't want to include any values less than $x=c$ in the graph of $f(x)$. In order to do that, we're going to have to make the function undefined at every value of $x$ where $x<c$, and as far as I can tell, your question is essentially what the most concise way to do that is, while leaving the rest of $f(x)$ untouched.
In general, there are two ways to make a function undefined: division by $0$ and taking the square root of a negative number. We're going to want to use the latter method here, because that works for a range of values (the thing you take the square root of can be anything less than $0$), whereas the first method relies on the argument being exactly $0$, and we have infinitely many values of $x$ for which we want this function to be undefined.
We now know that we want to use the square root of a negative number to make our function undefined whenever $x<c$. Rearranging that inequality yields $x-c<0$, and lo and behold, we have a negative quantity of which we can take the square root. So we know we need a $sqrtx-c$ in our clamping function. We also know that we need $delta(x)$ either to equal $1$ or be undefined. If we were to square $x-c$ inside the square root, the quantity inside the square root would always be positive, no matter what $x$ and $c$ are. The solution, therefore, is to put the square outside of the square root. That way, whenever $x-c<0$, $delta(x)$ is undefined, and whenever $x-c>0$, we can divide $x-c$ by the square of its square root to have $delta(x)=1$. Here's a Desmos graph that shows $delta_2(x)$ at work (though with a slightly different name, because Desmos only likes certain Greek letters, and $delta$ is not one of them): https://www.desmos.com/calculator/fswzdkjq6s
Note 1:
The clamping function I described essentially splits $f(x)$ into a real part and an imaginary part, and then keeps only the real part. If we wanted to keep all the values where $x<c$, we would have to keep the imaginary part and discard the real part. To do that, we can just switch the order of $x$ and $c$, which is analogous to multiplying the top and bottom of $delta(x)$ by $i^2$.
Note 2:
I was intrigued by the conversion of the absolute value function to a function of squares and square roots, so I decided to include something extra in that Desmos link: a generalization of clamping, if you will, that I refer to there as "splicing." It allows you to remove a specific portion of the graph of $f(x)$, and you can adjust both the size of the gap and the $x$-value around which the gap is centered.
Note 3:
Performing the trick of multiplying the top and bottom of a function by $i^2$ works with the splicing function as well; in that case, switching the order of $lvert x-brvert$ and $a$ returns only the part of the function which you had previously "spliced" out.
$endgroup$
1
$begingroup$
Woah, thanks for the super concise response! My calculator has been frustratingly without an absolute value function, meaning this became my go-to. I have a high incentive to make it less of a chore, but couldn't really find a way. Thanks for getting around!
$endgroup$
– Wasabi Thumbs
Feb 24 at 6:13
$begingroup$
You're certainly welcome; I'm glad I could help!
$endgroup$
– Robert Howard
Feb 24 at 17:32
add a comment |
$begingroup$
That's not that messy of a function! I've seen this done with absolute values before, but never with just square roots; that's a creative yet simple way to do it. As far as I can tell, there's no way you could reduce that final function any further and still have it do what you want it to.
Edit:
There is.
Let's specifically define the clamping function to be the function by which you multiply $f(x)$ to restrict its domain, and let's give it the name $delta(x)$. Therefore, your clamping function was $$delta_1(x)=vcenterfrac2left(vcenterfracx-csqrt(x-c)^2right)+1$$ After a bit of playing around, I stumbled upon a more concise one: $$delta_2(x)=vcenterfracx-cbig(sqrtx-cbig)^2$$
Notice that $delta_2(x)$ is very similar to the key component of $delta_1(x)$, except for one important difference: the square now comes outside the square root. Why does that matter?
Let's say that we have some function $f(x)$, and we don't want to include any values less than $x=c$ in the graph of $f(x)$. In order to do that, we're going to have to make the function undefined at every value of $x$ where $x<c$, and as far as I can tell, your question is essentially what the most concise way to do that is, while leaving the rest of $f(x)$ untouched.
In general, there are two ways to make a function undefined: division by $0$ and taking the square root of a negative number. We're going to want to use the latter method here, because that works for a range of values (the thing you take the square root of can be anything less than $0$), whereas the first method relies on the argument being exactly $0$, and we have infinitely many values of $x$ for which we want this function to be undefined.
We now know that we want to use the square root of a negative number to make our function undefined whenever $x<c$. Rearranging that inequality yields $x-c<0$, and lo and behold, we have a negative quantity of which we can take the square root. So we know we need a $sqrtx-c$ in our clamping function. We also know that we need $delta(x)$ either to equal $1$ or be undefined. If we were to square $x-c$ inside the square root, the quantity inside the square root would always be positive, no matter what $x$ and $c$ are. The solution, therefore, is to put the square outside of the square root. That way, whenever $x-c<0$, $delta(x)$ is undefined, and whenever $x-c>0$, we can divide $x-c$ by the square of its square root to have $delta(x)=1$. Here's a Desmos graph that shows $delta_2(x)$ at work (though with a slightly different name, because Desmos only likes certain Greek letters, and $delta$ is not one of them): https://www.desmos.com/calculator/fswzdkjq6s
Note 1:
The clamping function I described essentially splits $f(x)$ into a real part and an imaginary part, and then keeps only the real part. If we wanted to keep all the values where $x<c$, we would have to keep the imaginary part and discard the real part. To do that, we can just switch the order of $x$ and $c$, which is analogous to multiplying the top and bottom of $delta(x)$ by $i^2$.
Note 2:
I was intrigued by the conversion of the absolute value function to a function of squares and square roots, so I decided to include something extra in that Desmos link: a generalization of clamping, if you will, that I refer to there as "splicing." It allows you to remove a specific portion of the graph of $f(x)$, and you can adjust both the size of the gap and the $x$-value around which the gap is centered.
Note 3:
Performing the trick of multiplying the top and bottom of a function by $i^2$ works with the splicing function as well; in that case, switching the order of $lvert x-brvert$ and $a$ returns only the part of the function which you had previously "spliced" out.
$endgroup$
That's not that messy of a function! I've seen this done with absolute values before, but never with just square roots; that's a creative yet simple way to do it. As far as I can tell, there's no way you could reduce that final function any further and still have it do what you want it to.
Edit:
There is.
Let's specifically define the clamping function to be the function by which you multiply $f(x)$ to restrict its domain, and let's give it the name $delta(x)$. Therefore, your clamping function was $$delta_1(x)=vcenterfrac2left(vcenterfracx-csqrt(x-c)^2right)+1$$ After a bit of playing around, I stumbled upon a more concise one: $$delta_2(x)=vcenterfracx-cbig(sqrtx-cbig)^2$$
Notice that $delta_2(x)$ is very similar to the key component of $delta_1(x)$, except for one important difference: the square now comes outside the square root. Why does that matter?
Let's say that we have some function $f(x)$, and we don't want to include any values less than $x=c$ in the graph of $f(x)$. In order to do that, we're going to have to make the function undefined at every value of $x$ where $x<c$, and as far as I can tell, your question is essentially what the most concise way to do that is, while leaving the rest of $f(x)$ untouched.
In general, there are two ways to make a function undefined: division by $0$ and taking the square root of a negative number. We're going to want to use the latter method here, because that works for a range of values (the thing you take the square root of can be anything less than $0$), whereas the first method relies on the argument being exactly $0$, and we have infinitely many values of $x$ for which we want this function to be undefined.
We now know that we want to use the square root of a negative number to make our function undefined whenever $x<c$. Rearranging that inequality yields $x-c<0$, and lo and behold, we have a negative quantity of which we can take the square root. So we know we need a $sqrtx-c$ in our clamping function. We also know that we need $delta(x)$ either to equal $1$ or be undefined. If we were to square $x-c$ inside the square root, the quantity inside the square root would always be positive, no matter what $x$ and $c$ are. The solution, therefore, is to put the square outside of the square root. That way, whenever $x-c<0$, $delta(x)$ is undefined, and whenever $x-c>0$, we can divide $x-c$ by the square of its square root to have $delta(x)=1$. Here's a Desmos graph that shows $delta_2(x)$ at work (though with a slightly different name, because Desmos only likes certain Greek letters, and $delta$ is not one of them): https://www.desmos.com/calculator/fswzdkjq6s
Note 1:
The clamping function I described essentially splits $f(x)$ into a real part and an imaginary part, and then keeps only the real part. If we wanted to keep all the values where $x<c$, we would have to keep the imaginary part and discard the real part. To do that, we can just switch the order of $x$ and $c$, which is analogous to multiplying the top and bottom of $delta(x)$ by $i^2$.
Note 2:
I was intrigued by the conversion of the absolute value function to a function of squares and square roots, so I decided to include something extra in that Desmos link: a generalization of clamping, if you will, that I refer to there as "splicing." It allows you to remove a specific portion of the graph of $f(x)$, and you can adjust both the size of the gap and the $x$-value around which the gap is centered.
Note 3:
Performing the trick of multiplying the top and bottom of a function by $i^2$ works with the splicing function as well; in that case, switching the order of $lvert x-brvert$ and $a$ returns only the part of the function which you had previously "spliced" out.
edited Mar 12 at 19:52
answered Feb 21 at 5:18
Robert HowardRobert Howard
2,2192935
2,2192935
1
$begingroup$
Woah, thanks for the super concise response! My calculator has been frustratingly without an absolute value function, meaning this became my go-to. I have a high incentive to make it less of a chore, but couldn't really find a way. Thanks for getting around!
$endgroup$
– Wasabi Thumbs
Feb 24 at 6:13
$begingroup$
You're certainly welcome; I'm glad I could help!
$endgroup$
– Robert Howard
Feb 24 at 17:32
add a comment |
1
$begingroup$
Woah, thanks for the super concise response! My calculator has been frustratingly without an absolute value function, meaning this became my go-to. I have a high incentive to make it less of a chore, but couldn't really find a way. Thanks for getting around!
$endgroup$
– Wasabi Thumbs
Feb 24 at 6:13
$begingroup$
You're certainly welcome; I'm glad I could help!
$endgroup$
– Robert Howard
Feb 24 at 17:32
1
1
$begingroup$
Woah, thanks for the super concise response! My calculator has been frustratingly without an absolute value function, meaning this became my go-to. I have a high incentive to make it less of a chore, but couldn't really find a way. Thanks for getting around!
$endgroup$
– Wasabi Thumbs
Feb 24 at 6:13
$begingroup$
Woah, thanks for the super concise response! My calculator has been frustratingly without an absolute value function, meaning this became my go-to. I have a high incentive to make it less of a chore, but couldn't really find a way. Thanks for getting around!
$endgroup$
– Wasabi Thumbs
Feb 24 at 6:13
$begingroup$
You're certainly welcome; I'm glad I could help!
$endgroup$
– Robert Howard
Feb 24 at 17:32
$begingroup$
You're certainly welcome; I'm glad I could help!
$endgroup$
– Robert Howard
Feb 24 at 17:32
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3073419%2fcan-this-clamp-function-designed-for-calculators-without-abs-be-optimized%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Since $|x|=sqrtx^2$ then that is how one would have to calculate $|x|$ on calculators with a square root function but without an absolute value function.
$endgroup$
– John Wayland Bales
Jan 14 at 21:32