
(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
(*
t_s
(if (<= t_m 1.2e-256)
(* (sqrt 2.0) (/ t_m (* (* (sqrt 2.0) l_m) (sqrt (/ 1.0 x)))))
(if (<= t_m 7e-153)
(*
(sqrt 2.0)
(/
t_m
(+
(*
0.5
(/
(+ (* 2.0 (+ (pow t_m 2.0) (pow t_m 2.0))) (* 2.0 (pow l_m 2.0)))
(* t_m (* (sqrt 2.0) x))))
(* t_m (sqrt 2.0)))))
(if (<= t_m 7.8e+41)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)))
(* (pow l_m 2.0) (/ 2.0 x))))))
(sqrt (/ (+ x -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) {
double tmp;
if (t_m <= 1.2e-256) {
tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * sqrt((1.0 / x))));
} else if (t_m <= 7e-153) {
tmp = sqrt(2.0) * (t_m / ((0.5 * (((2.0 * (pow(t_m, 2.0) + pow(t_m, 2.0))) + (2.0 * pow(l_m, 2.0))) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
} else if (t_m <= 7.8e+41) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0))), (pow(l_m, 2.0) * (2.0 / x)))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + 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 <= 1.2e-256) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(sqrt(2.0) * l_m) * sqrt(Float64(1.0 / x))))); elseif (t_m <= 7e-153) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(0.5 * Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) + (t_m ^ 2.0))) + Float64(2.0 * (l_m ^ 2.0))) / Float64(t_m * Float64(sqrt(2.0) * x)))) + Float64(t_m * sqrt(2.0))))); elseif (t_m <= 7.8e+41) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0))), Float64((l_m ^ 2.0) * Float64(2.0 / x)))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); 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[t$95$m, 1.2e-256], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7e-153], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(0.5 * N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7.8e+41], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $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.2 \cdot 10^{-256}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\left(\sqrt{2} \cdot l\_m\right) \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t\_m \leq 7 \cdot 10^{-153}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{0.5 \cdot \frac{2 \cdot \left({t\_m}^{2} + {t\_m}^{2}\right) + 2 \cdot {l\_m}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)} + t\_m \cdot \sqrt{2}}\\
\mathbf{elif}\;t\_m \leq 7.8 \cdot 10^{+41}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{1 + x}{x + -1}, {l\_m}^{2} \cdot \frac{2}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 1.2e-256Initial program 28.0%
Simplified28.0%
Taylor expanded in l around inf 3.0%
associate--l+9.3%
sub-neg9.3%
metadata-eval9.3%
+-commutative9.3%
sub-neg9.3%
metadata-eval9.3%
+-commutative9.3%
Simplified9.3%
Taylor expanded in x around inf 15.3%
if 1.2e-256 < t < 6.99999999999999961e-153Initial program 10.7%
Simplified10.7%
Taylor expanded in l around 0 10.7%
fma-define10.7%
sub-neg10.7%
metadata-eval10.7%
associate-/l*10.7%
+-commutative10.7%
+-commutative10.7%
associate--l+23.4%
sub-neg23.4%
metadata-eval23.4%
+-commutative23.4%
sub-neg23.4%
metadata-eval23.4%
+-commutative23.4%
Simplified23.4%
Taylor expanded in x around inf 63.6%
if 6.99999999999999961e-153 < t < 7.7999999999999994e41Initial program 40.1%
Simplified40.1%
Taylor expanded in l around 0 54.4%
fma-define54.4%
sub-neg54.4%
metadata-eval54.4%
associate-/l*57.3%
+-commutative57.3%
+-commutative57.3%
associate--l+61.3%
sub-neg61.3%
metadata-eval61.3%
+-commutative61.3%
sub-neg61.3%
metadata-eval61.3%
+-commutative61.3%
Simplified61.3%
Taylor expanded in x around inf 76.7%
if 7.7999999999999994e41 < t Initial program 24.0%
Simplified23.8%
Taylor expanded in t around inf 90.7%
Taylor expanded in t around 0 91.0%
Final simplification45.6%
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 (* t_m (sqrt 2.0))))
(*
t_s
(if (<= t_m 1.55e-255)
(* (sqrt 2.0) (/ t_m (* (* (sqrt 2.0) l_m) (sqrt (/ 1.0 x)))))
(if (<= t_m 7e-153)
(/
t_2
(+
t_2
(*
-0.5
(/
(- (* (pow t_m 2.0) -2.0) (pow l_m 2.0))
(* t_m (* (sqrt 2.0) x))))))
(if (<= t_m 1.3e+42)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)))
(* (pow l_m 2.0) (/ 2.0 x))))))
(sqrt (/ (+ x -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) {
double t_2 = t_m * sqrt(2.0);
double tmp;
if (t_m <= 1.55e-255) {
tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * sqrt((1.0 / x))));
} else if (t_m <= 7e-153) {
tmp = t_2 / (t_2 + (-0.5 * (((pow(t_m, 2.0) * -2.0) - pow(l_m, 2.0)) / (t_m * (sqrt(2.0) * x)))));
} else if (t_m <= 1.3e+42) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0))), (pow(l_m, 2.0) * (2.0 / x)))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + 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) t_2 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (t_m <= 1.55e-255) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(sqrt(2.0) * l_m) * sqrt(Float64(1.0 / x))))); elseif (t_m <= 7e-153) tmp = Float64(t_2 / Float64(t_2 + Float64(-0.5 * Float64(Float64(Float64((t_m ^ 2.0) * -2.0) - (l_m ^ 2.0)) / Float64(t_m * Float64(sqrt(2.0) * x)))))); elseif (t_m <= 1.3e+42) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0))), Float64((l_m ^ 2.0) * Float64(2.0 / x)))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); 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[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.55e-255], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7e-153], N[(t$95$2 / N[(t$95$2 + N[(-0.5 * N[(N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] * -2.0), $MachinePrecision] - N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.3e+42], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $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 := t\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.55 \cdot 10^{-255}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\left(\sqrt{2} \cdot l\_m\right) \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t\_m \leq 7 \cdot 10^{-153}:\\
\;\;\;\;\frac{t\_2}{t\_2 + -0.5 \cdot \frac{{t\_m}^{2} \cdot -2 - {l\_m}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}}\\
\mathbf{elif}\;t\_m \leq 1.3 \cdot 10^{+42}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{1 + x}{x + -1}, {l\_m}^{2} \cdot \frac{2}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
\end{array}
if t < 1.54999999999999999e-255Initial program 28.0%
Simplified28.0%
Taylor expanded in l around inf 3.0%
associate--l+9.3%
sub-neg9.3%
metadata-eval9.3%
+-commutative9.3%
sub-neg9.3%
metadata-eval9.3%
+-commutative9.3%
Simplified9.3%
Taylor expanded in x around inf 15.3%
if 1.54999999999999999e-255 < t < 6.99999999999999961e-153Initial program 10.7%
Taylor expanded in x around inf 10.7%
Taylor expanded in x around -inf 62.4%
if 6.99999999999999961e-153 < t < 1.29999999999999995e42Initial program 40.1%
Simplified40.1%
Taylor expanded in l around 0 54.4%
fma-define54.4%
sub-neg54.4%
metadata-eval54.4%
associate-/l*57.3%
+-commutative57.3%
+-commutative57.3%
associate--l+61.3%
sub-neg61.3%
metadata-eval61.3%
+-commutative61.3%
sub-neg61.3%
metadata-eval61.3%
+-commutative61.3%
Simplified61.3%
Taylor expanded in x around inf 76.7%
if 1.29999999999999995e42 < t Initial program 24.0%
Simplified23.8%
Taylor expanded in t around inf 90.7%
Taylor expanded in t around 0 91.0%
Final simplification45.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 (<= t_m 3.5e-249)
(* (sqrt 2.0) (/ t_m (* (* (sqrt 2.0) l_m) (sqrt (/ 1.0 x)))))
(if (<= t_m 8e-159)
(+ 1.0 (/ -1.0 x))
(if (<= t_m 6.2e+41)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)))
(* (pow l_m 2.0) (/ 2.0 x))))))
(sqrt (/ (+ x -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) {
double tmp;
if (t_m <= 3.5e-249) {
tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * sqrt((1.0 / x))));
} else if (t_m <= 8e-159) {
tmp = 1.0 + (-1.0 / x);
} else if (t_m <= 6.2e+41) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0))), (pow(l_m, 2.0) * (2.0 / x)))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + 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 <= 3.5e-249) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(sqrt(2.0) * l_m) * sqrt(Float64(1.0 / x))))); elseif (t_m <= 8e-159) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t_m <= 6.2e+41) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0))), Float64((l_m ^ 2.0) * Float64(2.0 / x)))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); 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[t$95$m, 3.5e-249], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 8e-159], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 6.2e+41], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $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 3.5 \cdot 10^{-249}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\left(\sqrt{2} \cdot l\_m\right) \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t\_m \leq 8 \cdot 10^{-159}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t\_m \leq 6.2 \cdot 10^{+41}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{1 + x}{x + -1}, {l\_m}^{2} \cdot \frac{2}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 3.50000000000000013e-249Initial program 27.6%
Simplified27.6%
Taylor expanded in l around inf 3.0%
associate--l+9.8%
sub-neg9.8%
metadata-eval9.8%
+-commutative9.8%
sub-neg9.8%
metadata-eval9.8%
+-commutative9.8%
Simplified9.8%
Taylor expanded in x around inf 15.8%
if 3.50000000000000013e-249 < t < 7.99999999999999991e-159Initial program 2.6%
Simplified3.1%
Taylor expanded in t around inf 53.6%
Taylor expanded in x around inf 53.7%
if 7.99999999999999991e-159 < t < 6.2e41Initial program 41.1%
Simplified41.1%
Taylor expanded in l around 0 53.9%
fma-define53.9%
sub-neg53.9%
metadata-eval53.9%
associate-/l*56.4%
+-commutative56.4%
+-commutative56.4%
associate--l+60.4%
sub-neg60.4%
metadata-eval60.4%
+-commutative60.4%
sub-neg60.4%
metadata-eval60.4%
+-commutative60.4%
Simplified60.4%
Taylor expanded in x around inf 74.1%
if 6.2e41 < t Initial program 24.0%
Simplified23.8%
Taylor expanded in t around inf 90.7%
Taylor expanded in t around 0 91.0%
Final simplification44.6%
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.35e-249)
(* (sqrt 2.0) (/ t_m (* (* (sqrt 2.0) l_m) (sqrt (/ 1.0 x)))))
(sqrt (/ (+ x -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) {
double tmp;
if (t_m <= 1.35e-249) {
tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * sqrt((1.0 / x))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + 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 <= 1.35d-249) then
tmp = sqrt(2.0d0) * (t_m / ((sqrt(2.0d0) * l_m) * sqrt((1.0d0 / x))))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + 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 <= 1.35e-249) {
tmp = Math.sqrt(2.0) * (t_m / ((Math.sqrt(2.0) * l_m) * Math.sqrt((1.0 / x))));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + 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 <= 1.35e-249: tmp = math.sqrt(2.0) * (t_m / ((math.sqrt(2.0) * l_m) * math.sqrt((1.0 / x)))) else: tmp = math.sqrt(((x + -1.0) / (1.0 + 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 <= 1.35e-249) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(sqrt(2.0) * l_m) * sqrt(Float64(1.0 / x))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + 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 <= 1.35e-249) tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * sqrt((1.0 / x)))); else tmp = sqrt(((x + -1.0) / (1.0 + 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, 1.35e-249], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $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.35 \cdot 10^{-249}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\left(\sqrt{2} \cdot l\_m\right) \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 1.35e-249Initial program 27.6%
Simplified27.6%
Taylor expanded in l around inf 3.0%
associate--l+9.8%
sub-neg9.8%
metadata-eval9.8%
+-commutative9.8%
sub-neg9.8%
metadata-eval9.8%
+-commutative9.8%
Simplified9.8%
Taylor expanded in x around inf 15.8%
if 1.35e-249 < t Initial program 26.4%
Simplified21.3%
Taylor expanded in t around inf 74.7%
Taylor expanded in t around 0 74.9%
Final simplification42.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 2.8e-249)
(* (sqrt 2.0) (* t_m (/ (sqrt (* x 0.5)) l_m)))
(sqrt (/ (+ x -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) {
double tmp;
if (t_m <= 2.8e-249) {
tmp = sqrt(2.0) * (t_m * (sqrt((x * 0.5)) / l_m));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + 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 <= 2.8d-249) then
tmp = sqrt(2.0d0) * (t_m * (sqrt((x * 0.5d0)) / l_m))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + 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 <= 2.8e-249) {
tmp = Math.sqrt(2.0) * (t_m * (Math.sqrt((x * 0.5)) / l_m));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + 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 <= 2.8e-249: tmp = math.sqrt(2.0) * (t_m * (math.sqrt((x * 0.5)) / l_m)) else: tmp = math.sqrt(((x + -1.0) / (1.0 + 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 <= 2.8e-249) tmp = Float64(sqrt(2.0) * Float64(t_m * Float64(sqrt(Float64(x * 0.5)) / l_m))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + 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 <= 2.8e-249) tmp = sqrt(2.0) * (t_m * (sqrt((x * 0.5)) / l_m)); else tmp = sqrt(((x + -1.0) / (1.0 + 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, 2.8e-249], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m * N[(N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $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 2.8 \cdot 10^{-249}:\\
\;\;\;\;\sqrt{2} \cdot \left(t\_m \cdot \frac{\sqrt{x \cdot 0.5}}{l\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 2.7999999999999999e-249Initial program 27.6%
Simplified27.6%
Taylor expanded in l around inf 3.0%
associate--l+9.8%
sub-neg9.8%
metadata-eval9.8%
+-commutative9.8%
sub-neg9.8%
metadata-eval9.8%
+-commutative9.8%
Simplified9.8%
Taylor expanded in x around inf 15.1%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
associate-*l/0.0%
distribute-neg-frac20.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt15.7%
neg-mul-115.7%
associate-*l*15.7%
*-commutative15.7%
associate-/l*15.1%
distribute-rgt-neg-out15.1%
distribute-neg-frac15.1%
distribute-frac-neg215.1%
associate-*r/15.1%
Simplified15.7%
pow115.7%
associate-*l/15.8%
sqrt-unprod15.8%
Applied egg-rr15.8%
unpow115.8%
*-commutative15.8%
Simplified15.8%
if 2.7999999999999999e-249 < t Initial program 26.4%
Simplified21.3%
Taylor expanded in t around inf 74.7%
Taylor expanded in t around 0 74.9%
Final simplification42.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.06e-250)
(* t_m (* (sqrt 2.0) (/ (sqrt (* x 0.5)) l_m)))
(sqrt (/ (+ x -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) {
double tmp;
if (t_m <= 1.06e-250) {
tmp = t_m * (sqrt(2.0) * (sqrt((x * 0.5)) / l_m));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + 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 <= 1.06d-250) then
tmp = t_m * (sqrt(2.0d0) * (sqrt((x * 0.5d0)) / l_m))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + 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 <= 1.06e-250) {
tmp = t_m * (Math.sqrt(2.0) * (Math.sqrt((x * 0.5)) / l_m));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + 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 <= 1.06e-250: tmp = t_m * (math.sqrt(2.0) * (math.sqrt((x * 0.5)) / l_m)) else: tmp = math.sqrt(((x + -1.0) / (1.0 + 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 <= 1.06e-250) tmp = Float64(t_m * Float64(sqrt(2.0) * Float64(sqrt(Float64(x * 0.5)) / l_m))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + 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 <= 1.06e-250) tmp = t_m * (sqrt(2.0) * (sqrt((x * 0.5)) / l_m)); else tmp = sqrt(((x + -1.0) / (1.0 + 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, 1.06e-250], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $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.06 \cdot 10^{-250}:\\
\;\;\;\;t\_m \cdot \left(\sqrt{2} \cdot \frac{\sqrt{x \cdot 0.5}}{l\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 1.05999999999999993e-250Initial program 27.6%
Simplified27.6%
Taylor expanded in l around inf 3.0%
associate--l+9.8%
sub-neg9.8%
metadata-eval9.8%
+-commutative9.8%
sub-neg9.8%
metadata-eval9.8%
+-commutative9.8%
Simplified9.8%
Taylor expanded in x around inf 15.1%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
associate-*l/0.0%
distribute-neg-frac20.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt15.7%
neg-mul-115.7%
associate-*l*15.7%
*-commutative15.7%
associate-/l*15.1%
distribute-rgt-neg-out15.1%
distribute-neg-frac15.1%
distribute-frac-neg215.1%
associate-*r/15.1%
Simplified15.7%
pow115.7%
associate-*l/15.8%
sqrt-unprod15.8%
Applied egg-rr15.8%
unpow115.8%
*-commutative15.8%
associate-*l*15.8%
*-commutative15.8%
Simplified15.8%
if 1.05999999999999993e-250 < t Initial program 26.4%
Simplified21.3%
Taylor expanded in t around inf 74.7%
Taylor expanded in t around 0 74.9%
Final simplification42.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 (sqrt (/ (+ x -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 * sqrt(((x + -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 * sqrt(((x + (-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 * Math.sqrt(((x + -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 * math.sqrt(((x + -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 * sqrt(Float64(Float64(x + -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 * sqrt(((x + -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[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $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 \sqrt{\frac{x + -1}{1 + x}}
\end{array}
Initial program 27.1%
Simplified23.1%
Taylor expanded in t around inf 36.5%
Taylor expanded in t around 0 36.6%
Final simplification36.6%
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 27.1%
Simplified23.1%
Taylor expanded in t around inf 36.5%
Taylor expanded in x around inf 36.3%
Final simplification36.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 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 27.1%
Simplified23.1%
Taylor expanded in t around inf 36.5%
Taylor expanded in x around inf 36.3%
herbie shell --seed 2024155
(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)))))