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













1












$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...










share|cite|improve this question











$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















1












$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...










share|cite|improve this question











$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













1












1








1





$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...










share|cite|improve this question











$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






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








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
















  • $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










1 Answer
1






active

oldest

votes


















0












$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.






share|cite|improve this answer











$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










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
);



);













draft saved

draft discarded


















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









0












$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.






share|cite|improve this answer











$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















0












$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.






share|cite|improve this answer











$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













0












0








0





$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.






share|cite|improve this answer











$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.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








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












  • 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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How should I support this large drywall patch? Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How do I cover large gaps in drywall?How do I keep drywall around a patch from crumbling?Can I glue a second layer of drywall?How to patch long strip on drywall?Large drywall patch: how to avoid bulging seams?Drywall Mesh Patch vs. Bulge? To remove or not to remove?How to fix this drywall job?Prep drywall before backsplashWhat's the best way to fix this horrible drywall patch job?Drywall patching using 3M Patch Plus Primer

random experiment with two different functions on unit interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Random variable and probability space notionsRandom Walk with EdgesFinding functions where the increase over a random interval is Poisson distributedNumber of days until dayCan an observed event in fact be of zero probability?Unit random processmodels of coins and uniform distributionHow to get the number of successes given $n$ trials , probability $P$ and a random variable $X$Absorbing Markov chain in a computer. Is “almost every” turned into always convergence in computer executions?Stopped random walk is not uniformly integrable

Lowndes Grove History Architecture References Navigation menu32°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661132°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661178002500"National Register Information System"Historic houses of South Carolina"Lowndes Grove""+32° 48' 6.00", −79° 57' 58.00""Lowndes Grove, Charleston County (260 St. Margaret St., Charleston)""Lowndes Grove"The Charleston ExpositionIt Happened in South Carolina"Lowndes Grove (House), Saint Margaret Street & Sixth Avenue, Charleston, Charleston County, SC(Photographs)"Plantations of the Carolina Low Countrye