
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* 2.0 (pow t_m 2.0))))
(*
t_s
(if (<= t_m 2e-234)
(* (* t_m (sqrt (* 2.0 (fma x 0.5 -0.5)))) (/ 1.0 l_m))
(if (<= t_m 1e-203)
(*
(sqrt 2.0)
(/
t_m
(fma
0.5
(/
(* 2.0 (fma 2.0 (pow t_m 2.0) (pow l_m 2.0)))
(* t_m (* x (sqrt 2.0))))
(* t_m (sqrt 2.0)))))
(if (<= t_m 4.1e-154)
(* t_m (/ (sqrt (* 2.0 (fma 0.5 x -0.5))) l_m))
(if (<= t_m 0.0205)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(+
(+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 (/ (pow l_m 2.0) x)))
(/ (+ (pow l_m 2.0) t_2) x)))))
(log
(pow
(exp (sqrt 2.0))
(sqrt (* 0.5 (/ (+ x -1.0) (+ x 1.0)))))))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = 2.0 * pow(t_m, 2.0);
double tmp;
if (t_m <= 2e-234) {
tmp = (t_m * sqrt((2.0 * fma(x, 0.5, -0.5)))) * (1.0 / l_m);
} else if (t_m <= 1e-203) {
tmp = sqrt(2.0) * (t_m / fma(0.5, ((2.0 * fma(2.0, pow(t_m, 2.0), pow(l_m, 2.0))) / (t_m * (x * sqrt(2.0)))), (t_m * sqrt(2.0))));
} else if (t_m <= 4.1e-154) {
tmp = t_m * (sqrt((2.0 * fma(0.5, x, -0.5))) / l_m);
} else if (t_m <= 0.0205) {
tmp = sqrt(2.0) * (t_m / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + (pow(l_m, 2.0) / x))) + ((pow(l_m, 2.0) + t_2) / x))));
} else {
tmp = log(pow(exp(sqrt(2.0)), sqrt((0.5 * ((x + -1.0) / (x + 1.0))))));
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(2.0 * (t_m ^ 2.0)) tmp = 0.0 if (t_m <= 2e-234) tmp = Float64(Float64(t_m * sqrt(Float64(2.0 * fma(x, 0.5, -0.5)))) * Float64(1.0 / l_m)); elseif (t_m <= 1e-203) tmp = Float64(sqrt(2.0) * Float64(t_m / fma(0.5, Float64(Float64(2.0 * fma(2.0, (t_m ^ 2.0), (l_m ^ 2.0))) / Float64(t_m * Float64(x * sqrt(2.0)))), Float64(t_m * sqrt(2.0))))); elseif (t_m <= 4.1e-154) tmp = Float64(t_m * Float64(sqrt(Float64(2.0 * fma(0.5, x, -0.5))) / l_m)); elseif (t_m <= 0.0205) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + Float64((l_m ^ 2.0) / x))) + Float64(Float64((l_m ^ 2.0) + t_2) / x))))); else tmp = log((exp(sqrt(2.0)) ^ sqrt(Float64(0.5 * Float64(Float64(x + -1.0) / Float64(x + 1.0)))))); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2e-234], N[(N[(t$95$m * N[Sqrt[N[(2.0 * N[(x * 0.5 + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / l$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1e-203], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(0.5 * N[(N[(2.0 * N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(x * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 4.1e-154], N[(t$95$m * N[(N[Sqrt[N[(2.0 * N[(0.5 * x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 0.0205], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] + t$95$2), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[N[Power[N[Exp[N[Sqrt[2.0], $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(0.5 * N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := 2 \cdot {t\_m}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2 \cdot 10^{-234}:\\
\;\;\;\;\left(t\_m \cdot \sqrt{2 \cdot \mathsf{fma}\left(x, 0.5, -0.5\right)}\right) \cdot \frac{1}{l\_m}\\
\mathbf{elif}\;t\_m \leq 10^{-203}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\mathsf{fma}\left(0.5, \frac{2 \cdot \mathsf{fma}\left(2, {t\_m}^{2}, {l\_m}^{2}\right)}{t\_m \cdot \left(x \cdot \sqrt{2}\right)}, t\_m \cdot \sqrt{2}\right)}\\
\mathbf{elif}\;t\_m \leq 4.1 \cdot 10^{-154}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{l\_m}\\
\mathbf{elif}\;t\_m \leq 0.0205:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_2 + \frac{{l\_m}^{2}}{x}\right)\right) + \frac{{l\_m}^{2} + t\_2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\log \left({\left(e^{\sqrt{2}}\right)}^{\left(\sqrt{0.5 \cdot \frac{x + -1}{x + 1}}\right)}\right)\\
\end{array}
\end{array}
\end{array}
if t < 1.9999999999999999e-234Initial program 34.5%
Simplified34.4%
Taylor expanded in l around inf 2.8%
*-commutative2.8%
associate--l+9.1%
sub-neg9.1%
metadata-eval9.1%
+-commutative9.1%
sub-neg9.1%
metadata-eval9.1%
+-commutative9.1%
Simplified9.1%
Taylor expanded in x around 0 18.2%
add-cbrt-cube12.7%
pow312.7%
associate-*r*12.7%
sqrt-unprod12.7%
*-commutative12.7%
fma-neg12.7%
metadata-eval12.7%
Applied egg-rr12.7%
rem-cbrt-cube18.1%
associate-*r/19.8%
div-inv19.8%
*-commutative19.8%
Applied egg-rr19.8%
if 1.9999999999999999e-234 < t < 1e-203Initial program 2.6%
Simplified2.6%
Taylor expanded in x around inf 19.3%
Taylor expanded in x around inf 84.5%
fma-define84.5%
fma-define84.5%
fma-define84.5%
cancel-sign-sub-inv84.5%
metadata-eval84.5%
distribute-rgt1-in84.5%
metadata-eval84.5%
*-commutative84.5%
*-commutative84.5%
Simplified84.5%
if 1e-203 < t < 4.1e-154Initial program 1.7%
Simplified1.7%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
associate--l+14.9%
sub-neg14.9%
metadata-eval14.9%
+-commutative14.9%
sub-neg14.9%
metadata-eval14.9%
+-commutative14.9%
Simplified14.9%
Taylor expanded in x around 0 14.9%
associate-*r*14.9%
clear-num15.1%
un-div-inv15.1%
sqrt-unprod15.1%
*-commutative15.1%
fma-neg15.1%
metadata-eval15.1%
Applied egg-rr15.1%
associate-/r/32.7%
fma-undefine32.7%
*-commutative32.7%
fma-define32.7%
Simplified32.7%
if 4.1e-154 < t < 0.0205000000000000009Initial program 55.7%
Simplified55.5%
Taylor expanded in x around inf 88.8%
if 0.0205000000000000009 < t Initial program 37.2%
Simplified37.1%
Taylor expanded in t around inf 95.7%
*-commutative95.7%
sub-neg95.7%
metadata-eval95.7%
+-commutative95.7%
+-commutative95.7%
Simplified95.7%
add-log-exp95.7%
exp-prod97.1%
sqrt-unprod97.1%
Applied egg-rr97.1%
Final simplification53.8%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 2e+242)
(log (pow (exp (sqrt 2.0)) (sqrt (* 0.5 (/ (+ x -1.0) (+ x 1.0))))))
(* t_m (/ (sqrt (* 2.0 (fma 0.5 x -0.5))) l_m)))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 2e+242) {
tmp = log(pow(exp(sqrt(2.0)), sqrt((0.5 * ((x + -1.0) / (x + 1.0))))));
} else {
tmp = t_m * (sqrt((2.0 * fma(0.5, x, -0.5))) / l_m);
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 2e+242) tmp = log((exp(sqrt(2.0)) ^ sqrt(Float64(0.5 * Float64(Float64(x + -1.0) / Float64(x + 1.0)))))); else tmp = Float64(t_m * Float64(sqrt(Float64(2.0 * fma(0.5, x, -0.5))) / l_m)); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 2e+242], N[Log[N[Power[N[Exp[N[Sqrt[2.0], $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(0.5 * N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[Sqrt[N[(2.0 * N[(0.5 * x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 2 \cdot 10^{+242}:\\
\;\;\;\;\log \left({\left(e^{\sqrt{2}}\right)}^{\left(\sqrt{0.5 \cdot \frac{x + -1}{x + 1}}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{l\_m}\\
\end{array}
\end{array}
if l < 2.0000000000000001e242Initial program 37.3%
Simplified37.2%
Taylor expanded in t around inf 45.2%
*-commutative45.2%
sub-neg45.2%
metadata-eval45.2%
+-commutative45.2%
+-commutative45.2%
Simplified45.2%
add-log-exp45.2%
exp-prod45.8%
sqrt-unprod45.9%
Applied egg-rr45.9%
if 2.0000000000000001e242 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 1.3%
*-commutative1.3%
associate--l+42.3%
sub-neg42.3%
metadata-eval42.3%
+-commutative42.3%
sub-neg42.3%
metadata-eval42.3%
+-commutative42.3%
Simplified42.3%
Taylor expanded in x around 0 63.8%
associate-*r*63.7%
clear-num63.7%
un-div-inv63.8%
sqrt-unprod64.1%
*-commutative64.1%
fma-neg64.1%
metadata-eval64.1%
Applied egg-rr64.1%
associate-/r/83.0%
fma-undefine83.0%
*-commutative83.0%
fma-define83.0%
Simplified83.0%
Final simplification47.5%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 2.05e+242)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(* t_m (/ (sqrt (* 2.0 (fma 0.5 x -0.5))) l_m)))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 2.05e+242) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m * (sqrt((2.0 * fma(0.5, x, -0.5))) / l_m);
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 2.05e+242) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(t_m * Float64(sqrt(Float64(2.0 * fma(0.5, x, -0.5))) / l_m)); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 2.05e+242], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[Sqrt[N[(2.0 * N[(0.5 * x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 2.05 \cdot 10^{+242}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{l\_m}\\
\end{array}
\end{array}
if l < 2.0499999999999999e242Initial program 37.3%
Simplified37.2%
Taylor expanded in t around inf 45.2%
*-commutative45.2%
sub-neg45.2%
metadata-eval45.2%
+-commutative45.2%
+-commutative45.2%
Simplified45.2%
add-log-exp45.2%
exp-prod45.8%
sqrt-unprod45.9%
Applied egg-rr45.9%
*-un-lft-identity45.9%
log-prod45.9%
metadata-eval45.9%
pow-exp45.2%
add-log-exp45.2%
sqrt-unprod45.9%
Applied egg-rr45.9%
+-lft-identity45.9%
*-commutative45.9%
associate-*l*45.9%
metadata-eval45.9%
Simplified45.9%
*-un-lft-identity45.9%
sqrt-prod45.9%
metadata-eval45.9%
*-rgt-identity45.9%
Applied egg-rr45.9%
*-lft-identity45.9%
Simplified45.9%
if 2.0499999999999999e242 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 1.3%
*-commutative1.3%
associate--l+42.3%
sub-neg42.3%
metadata-eval42.3%
+-commutative42.3%
sub-neg42.3%
metadata-eval42.3%
+-commutative42.3%
Simplified42.3%
Taylor expanded in x around 0 63.8%
associate-*r*63.7%
clear-num63.7%
un-div-inv63.8%
sqrt-unprod64.1%
*-commutative64.1%
fma-neg64.1%
metadata-eval64.1%
Applied egg-rr64.1%
associate-/r/83.0%
fma-undefine83.0%
*-commutative83.0%
fma-define83.0%
Simplified83.0%
Final simplification47.5%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 5.6e+242)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(/ 1.0 (/ (/ l_m (sqrt x)) t_m)))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 5.6e+242) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = 1.0 / ((l_m / sqrt(x)) / t_m);
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (l_m <= 5.6d+242) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = 1.0d0 / ((l_m / sqrt(x)) / t_m)
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 5.6e+242) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = 1.0 / ((l_m / Math.sqrt(x)) / t_m);
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if l_m <= 5.6e+242: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = 1.0 / ((l_m / math.sqrt(x)) / t_m) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 5.6e+242) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(1.0 / Float64(Float64(l_m / sqrt(x)) / t_m)); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (l_m <= 5.6e+242) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = 1.0 / ((l_m / sqrt(x)) / t_m); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 5.6e+242], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[(N[(l$95$m / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 5.6 \cdot 10^{+242}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{l\_m}{\sqrt{x}}}{t\_m}}\\
\end{array}
\end{array}
if l < 5.6e242Initial program 37.3%
Simplified37.2%
Taylor expanded in t around inf 45.2%
*-commutative45.2%
sub-neg45.2%
metadata-eval45.2%
+-commutative45.2%
+-commutative45.2%
Simplified45.2%
add-log-exp45.2%
exp-prod45.8%
sqrt-unprod45.9%
Applied egg-rr45.9%
*-un-lft-identity45.9%
log-prod45.9%
metadata-eval45.9%
pow-exp45.2%
add-log-exp45.2%
sqrt-unprod45.9%
Applied egg-rr45.9%
+-lft-identity45.9%
*-commutative45.9%
associate-*l*45.9%
metadata-eval45.9%
Simplified45.9%
*-un-lft-identity45.9%
sqrt-prod45.9%
metadata-eval45.9%
*-rgt-identity45.9%
Applied egg-rr45.9%
*-lft-identity45.9%
Simplified45.9%
if 5.6e242 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in t around 0 0.0%
Taylor expanded in x around inf 37.0%
div-sub37.0%
associate-*r/37.0%
cancel-sign-sub-inv37.0%
metadata-eval37.0%
*-lft-identity37.0%
count-237.0%
Simplified37.0%
associate-*r/37.0%
clear-num37.0%
sqrt-prod37.0%
sqrt-div37.0%
sqrt-pow180.3%
metadata-eval80.3%
pow180.3%
Applied egg-rr80.3%
times-frac80.4%
*-inverses80.4%
Simplified80.4%
Final simplification47.3%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 1.1e-232)
(* (sqrt x) (/ t_m l_m))
(sqrt (/ (+ x -1.0) (+ x 1.0))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.1e-232) {
tmp = sqrt(x) * (t_m / l_m);
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 1.1d-232) then
tmp = sqrt(x) * (t_m / l_m)
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.1e-232) {
tmp = Math.sqrt(x) * (t_m / l_m);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 1.1e-232: tmp = math.sqrt(x) * (t_m / l_m) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 1.1e-232) tmp = Float64(sqrt(x) * Float64(t_m / l_m)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 1.1e-232) tmp = sqrt(x) * (t_m / l_m); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.1e-232], N[(N[Sqrt[x], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.1 \cdot 10^{-232}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t\_m}{l\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < 1.10000000000000001e-232Initial program 34.5%
Simplified30.0%
Taylor expanded in t around 0 3.8%
Taylor expanded in x around inf 17.6%
div-sub17.6%
associate-*r/17.6%
cancel-sign-sub-inv17.6%
metadata-eval17.6%
*-lft-identity17.6%
count-217.6%
Simplified17.6%
Taylor expanded in t around 0 17.6%
if 1.10000000000000001e-232 < t Initial program 37.0%
Simplified36.9%
Taylor expanded in t around inf 84.6%
*-commutative84.6%
sub-neg84.6%
metadata-eval84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
add-log-exp84.6%
exp-prod85.8%
sqrt-unprod85.9%
Applied egg-rr85.9%
*-un-lft-identity85.9%
log-prod85.9%
metadata-eval85.9%
pow-exp84.6%
add-log-exp84.6%
sqrt-unprod85.9%
Applied egg-rr85.9%
+-lft-identity85.9%
*-commutative85.9%
associate-*l*85.9%
metadata-eval85.9%
Simplified85.9%
*-un-lft-identity85.9%
sqrt-prod85.9%
metadata-eval85.9%
*-rgt-identity85.9%
Applied egg-rr85.9%
*-lft-identity85.9%
Simplified85.9%
Final simplification50.9%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 4.6e-231)
(* (sqrt x) (/ t_m l_m))
(+ 1.0 (/ (+ -1.0 (/ 0.5 x)) x)))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 4.6e-231) {
tmp = sqrt(x) * (t_m / l_m);
} else {
tmp = 1.0 + ((-1.0 + (0.5 / x)) / x);
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 4.6d-231) then
tmp = sqrt(x) * (t_m / l_m)
else
tmp = 1.0d0 + (((-1.0d0) + (0.5d0 / x)) / x)
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 4.6e-231) {
tmp = Math.sqrt(x) * (t_m / l_m);
} else {
tmp = 1.0 + ((-1.0 + (0.5 / x)) / x);
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 4.6e-231: tmp = math.sqrt(x) * (t_m / l_m) else: tmp = 1.0 + ((-1.0 + (0.5 / x)) / x) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 4.6e-231) tmp = Float64(sqrt(x) * Float64(t_m / l_m)); else tmp = Float64(1.0 + Float64(Float64(-1.0 + Float64(0.5 / x)) / x)); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 4.6e-231) tmp = sqrt(x) * (t_m / l_m); else tmp = 1.0 + ((-1.0 + (0.5 / x)) / x); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 4.6e-231], N[(N[Sqrt[x], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 + N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.6 \cdot 10^{-231}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t\_m}{l\_m}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1 + \frac{0.5}{x}}{x}\\
\end{array}
\end{array}
if t < 4.6e-231Initial program 34.5%
Simplified30.0%
Taylor expanded in t around 0 3.8%
Taylor expanded in x around inf 17.6%
div-sub17.6%
associate-*r/17.6%
cancel-sign-sub-inv17.6%
metadata-eval17.6%
*-lft-identity17.6%
count-217.6%
Simplified17.6%
Taylor expanded in t around 0 17.6%
if 4.6e-231 < t Initial program 37.0%
Simplified36.9%
Taylor expanded in t around inf 84.6%
*-commutative84.6%
sub-neg84.6%
metadata-eval84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
add-log-exp84.6%
exp-prod85.8%
sqrt-unprod85.9%
Applied egg-rr85.9%
*-un-lft-identity85.9%
log-prod85.9%
metadata-eval85.9%
pow-exp84.6%
add-log-exp84.6%
sqrt-unprod85.9%
Applied egg-rr85.9%
+-lft-identity85.9%
*-commutative85.9%
associate-*l*85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in x around inf 84.8%
associate--l+84.8%
unpow284.8%
metadata-eval84.8%
metadata-eval84.8%
metadata-eval84.8%
rem-square-sqrt0.0%
unpow20.0%
associate-/l/0.0%
associate-*r/0.0%
div-sub0.0%
Simplified84.8%
Final simplification50.4%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (+ 1.0 (/ (+ -1.0 (/ 0.5 x)) x))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + ((-1.0 + (0.5 / x)) / x));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * (1.0d0 + (((-1.0d0) + (0.5d0 / x)) / x))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + ((-1.0 + (0.5 / x)) / x));
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * (1.0 + ((-1.0 + (0.5 / x)) / x))
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * Float64(1.0 + Float64(Float64(-1.0 + Float64(0.5 / x)) / x))) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * (1.0 + ((-1.0 + (0.5 / x)) / x)); end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(N[(-1.0 + N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(1 + \frac{-1 + \frac{0.5}{x}}{x}\right)
\end{array}
Initial program 35.7%
Simplified35.6%
Taylor expanded in t around inf 43.7%
*-commutative43.7%
sub-neg43.7%
metadata-eval43.7%
+-commutative43.7%
+-commutative43.7%
Simplified43.7%
add-log-exp43.7%
exp-prod44.4%
sqrt-unprod44.4%
Applied egg-rr44.4%
*-un-lft-identity44.4%
log-prod44.4%
metadata-eval44.4%
pow-exp43.7%
add-log-exp43.8%
sqrt-unprod44.4%
Applied egg-rr44.4%
+-lft-identity44.4%
*-commutative44.4%
associate-*l*44.4%
metadata-eval44.4%
Simplified44.4%
Taylor expanded in x around inf 43.9%
associate--l+43.9%
unpow243.9%
metadata-eval43.9%
metadata-eval43.9%
metadata-eval43.9%
rem-square-sqrt0.0%
unpow20.0%
associate-/l/0.0%
associate-*r/0.0%
div-sub0.0%
Simplified43.9%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (+ 1.0 (/ -1.0 x))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * (1.0d0 + ((-1.0d0) / x))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * (1.0 + (-1.0 / x))
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * Float64(1.0 + Float64(-1.0 / x))) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * (1.0 + (-1.0 / x)); end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(1 + \frac{-1}{x}\right)
\end{array}
Initial program 35.7%
Simplified35.6%
Taylor expanded in t around inf 43.7%
*-commutative43.7%
sub-neg43.7%
metadata-eval43.7%
+-commutative43.7%
+-commutative43.7%
Simplified43.7%
add-log-exp43.7%
exp-prod44.4%
sqrt-unprod44.4%
Applied egg-rr44.4%
*-un-lft-identity44.4%
log-prod44.4%
metadata-eval44.4%
pow-exp43.7%
add-log-exp43.8%
sqrt-unprod44.4%
Applied egg-rr44.4%
+-lft-identity44.4%
*-commutative44.4%
associate-*l*44.4%
metadata-eval44.4%
Simplified44.4%
Taylor expanded in x around inf 43.8%
Final simplification43.8%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s 1.0))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * 1.0;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * 1.0d0
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * 1.0;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * 1.0
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * 1.0) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * 1.0; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot 1
\end{array}
Initial program 35.7%
Simplified35.6%
Taylor expanded in x around inf 51.0%
Taylor expanded in x around inf 43.4%
*-commutative43.4%
Simplified43.4%
Taylor expanded in t around 0 43.5%
herbie shell --seed 2024100
(FPCore (x l t)
:name "Toniolo and Linder, Equation (7)"
:precision binary64
(/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))