
(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 9.2e-222)
(/ (* t_m (sqrt x)) l_m)
(if (<= t_m 6e-177)
(*
(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 (* x (sqrt 2.0)))))
(* t_m (sqrt 2.0)))))
(if (<= t_m 1.05e+73)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ x 1.0) (+ x -1.0)))
(* 2.0 (/ (pow l_m 2.0) x))))))
(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 <= 9.2e-222) {
tmp = (t_m * sqrt(x)) / l_m;
} else if (t_m <= 6e-177) {
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 * (x * sqrt(2.0))))) + (t_m * sqrt(2.0))));
} else if (t_m <= 1.05e+73) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((x + 1.0) / (x + -1.0))), (2.0 * (pow(l_m, 2.0) / x)))));
} 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.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 9.2e-222) tmp = Float64(Float64(t_m * sqrt(x)) / l_m); elseif (t_m <= 6e-177) 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(x * sqrt(2.0))))) + Float64(t_m * sqrt(2.0))))); elseif (t_m <= 1.05e+73) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(x + 1.0) / Float64(x + -1.0))), Float64(2.0 * Float64((l_m ^ 2.0) / x)))))); else tmp = sqrt(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_] := N[(t$95$s * If[LessEqual[t$95$m, 9.2e-222], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$m, 6e-177], 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[(x * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+73], 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[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 9.2 \cdot 10^{-222}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{l\_m}\\
\mathbf{elif}\;t\_m \leq 6 \cdot 10^{-177}:\\
\;\;\;\;\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(x \cdot \sqrt{2}\right)} + t\_m \cdot \sqrt{2}}\\
\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+73}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{x + 1}{x + -1}, 2 \cdot \frac{{l\_m}^{2}}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < 9.2000000000000005e-222Initial program 32.8%
Simplified32.8%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
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 inf 14.9%
*-commutative14.9%
associate-/l*14.9%
*-commutative14.9%
Simplified14.9%
sqrt-unprod15.0%
metadata-eval15.0%
metadata-eval15.0%
div-inv15.1%
add-exp-log8.6%
Applied egg-rr8.6%
rem-exp-log15.1%
associate-*r/16.9%
Applied egg-rr16.9%
if 9.2000000000000005e-222 < t < 6.00000000000000015e-177Initial program 3.1%
Simplified3.1%
Taylor expanded in l around 0 3.1%
fma-define3.1%
+-commutative3.1%
associate-*r/3.1%
sub-neg3.1%
metadata-eval3.1%
+-commutative3.1%
associate--l+3.1%
sub-neg3.1%
metadata-eval3.1%
+-commutative3.1%
sub-neg3.1%
metadata-eval3.1%
+-commutative3.1%
Simplified3.1%
Taylor expanded in x around inf 99.5%
if 6.00000000000000015e-177 < t < 1.0500000000000001e73Initial program 52.8%
Simplified52.7%
Taylor expanded in l around 0 64.6%
fma-define64.6%
+-commutative64.6%
associate-*r/74.9%
sub-neg74.9%
metadata-eval74.9%
+-commutative74.9%
associate--l+78.4%
sub-neg78.4%
metadata-eval78.4%
+-commutative78.4%
sub-neg78.4%
metadata-eval78.4%
+-commutative78.4%
Simplified78.4%
Taylor expanded in x around inf 82.2%
if 1.0500000000000001e73 < t Initial program 26.0%
Simplified26.0%
Taylor expanded in l around 0 96.4%
associate-*l*96.4%
+-commutative96.4%
sub-neg96.4%
metadata-eval96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in t around 0 96.7%
Final simplification49.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 5.5e-227)
(/ (* t_m (sqrt x)) l_m)
(if (<= t_m 2.75e-180)
1.0
(if (<= t_m 5e+72)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ x 1.0) (+ x -1.0)))
(* 2.0 (/ (pow l_m 2.0) x))))))
(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 <= 5.5e-227) {
tmp = (t_m * sqrt(x)) / l_m;
} else if (t_m <= 2.75e-180) {
tmp = 1.0;
} else if (t_m <= 5e+72) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((x + 1.0) / (x + -1.0))), (2.0 * (pow(l_m, 2.0) / x)))));
} 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.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 5.5e-227) tmp = Float64(Float64(t_m * sqrt(x)) / l_m); elseif (t_m <= 2.75e-180) tmp = 1.0; elseif (t_m <= 5e+72) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(x + 1.0) / Float64(x + -1.0))), Float64(2.0 * Float64((l_m ^ 2.0) / x)))))); else tmp = sqrt(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_] := N[(t$95$s * If[LessEqual[t$95$m, 5.5e-227], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$m, 2.75e-180], 1.0, If[LessEqual[t$95$m, 5e+72], 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[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 5.5 \cdot 10^{-227}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{l\_m}\\
\mathbf{elif}\;t\_m \leq 2.75 \cdot 10^{-180}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_m \leq 5 \cdot 10^{+72}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{x + 1}{x + -1}, 2 \cdot \frac{{l\_m}^{2}}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < 5.5e-227Initial program 32.8%
Simplified32.8%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
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 inf 14.9%
*-commutative14.9%
associate-/l*14.9%
*-commutative14.9%
Simplified14.9%
sqrt-unprod15.0%
metadata-eval15.0%
metadata-eval15.0%
div-inv15.1%
add-exp-log8.6%
Applied egg-rr8.6%
rem-exp-log15.1%
associate-*r/16.9%
Applied egg-rr16.9%
if 5.5e-227 < t < 2.75000000000000006e-180Initial program 3.1%
Simplified3.1%
Taylor expanded in l around 0 100.0%
associate-*l*100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if 2.75000000000000006e-180 < t < 4.99999999999999992e72Initial program 51.9%
Simplified51.9%
Taylor expanded in l around 0 63.5%
fma-define63.5%
+-commutative63.5%
associate-*r/73.6%
sub-neg73.6%
metadata-eval73.6%
+-commutative73.6%
associate--l+77.1%
sub-neg77.1%
metadata-eval77.1%
+-commutative77.1%
sub-neg77.1%
metadata-eval77.1%
+-commutative77.1%
Simplified77.1%
Taylor expanded in x around inf 80.8%
if 4.99999999999999992e72 < t Initial program 26.0%
Simplified26.0%
Taylor expanded in l around 0 96.4%
associate-*l*96.4%
+-commutative96.4%
sub-neg96.4%
metadata-eval96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in t around 0 96.7%
Final simplification49.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 3.2e-221)
(/ (* t_m (sqrt x)) l_m)
(if (<= t_m 4.2e-183)
1.0
(if (<= t_m 3.5e-159)
(* (sqrt 2.0) (/ (* t_m (sqrt (fma x 0.5 -0.5))) 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 <= 3.2e-221) {
tmp = (t_m * sqrt(x)) / l_m;
} else if (t_m <= 4.2e-183) {
tmp = 1.0;
} else if (t_m <= 3.5e-159) {
tmp = sqrt(2.0) * ((t_m * sqrt(fma(x, 0.5, -0.5))) / 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.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 3.2e-221) tmp = Float64(Float64(t_m * sqrt(x)) / l_m); elseif (t_m <= 4.2e-183) tmp = 1.0; elseif (t_m <= 3.5e-159) tmp = Float64(sqrt(2.0) * Float64(Float64(t_m * sqrt(fma(x, 0.5, -0.5))) / l_m)); else tmp = sqrt(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_] := N[(t$95$s * If[LessEqual[t$95$m, 3.2e-221], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$m, 4.2e-183], 1.0, If[LessEqual[t$95$m, 3.5e-159], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(t$95$m * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 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 3.2 \cdot 10^{-221}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{l\_m}\\
\mathbf{elif}\;t\_m \leq 4.2 \cdot 10^{-183}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_m \leq 3.5 \cdot 10^{-159}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{l\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < 3.20000000000000015e-221Initial program 32.8%
Simplified32.8%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
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 inf 14.9%
*-commutative14.9%
associate-/l*14.9%
*-commutative14.9%
Simplified14.9%
sqrt-unprod15.0%
metadata-eval15.0%
metadata-eval15.0%
div-inv15.1%
add-exp-log8.6%
Applied egg-rr8.6%
rem-exp-log15.1%
associate-*r/16.9%
Applied egg-rr16.9%
if 3.20000000000000015e-221 < t < 4.2000000000000004e-183Initial program 3.1%
Simplified3.1%
Taylor expanded in l around 0 100.0%
associate-*l*100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if 4.2000000000000004e-183 < t < 3.50000000000000002e-159Initial program 2.8%
Simplified2.8%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
associate--l+10.3%
sub-neg10.3%
metadata-eval10.3%
+-commutative10.3%
sub-neg10.3%
metadata-eval10.3%
+-commutative10.3%
Simplified10.3%
Taylor expanded in x around 0 50.0%
associate-*r/49.2%
*-commutative49.2%
fma-neg49.2%
metadata-eval49.2%
Applied egg-rr49.2%
if 3.50000000000000002e-159 < t Initial program 39.6%
Simplified39.6%
Taylor expanded in l around 0 85.6%
associate-*l*85.6%
+-commutative85.6%
sub-neg85.6%
metadata-eval85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in t around 0 85.9%
Final simplification48.0%
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 x)) l_m)))
(*
t_s
(if (<= t_m 2.8e-221)
t_2
(if (<= t_m 3.2e-182)
1.0
(if (<= t_m 5e-161) t_2 (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 t_2 = (t_m * sqrt(x)) / l_m;
double tmp;
if (t_m <= 2.8e-221) {
tmp = t_2;
} else if (t_m <= 3.2e-182) {
tmp = 1.0;
} else if (t_m <= 5e-161) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_2 = (t_m * sqrt(x)) / l_m
if (t_m <= 2.8d-221) then
tmp = t_2
else if (t_m <= 3.2d-182) then
tmp = 1.0d0
else if (t_m <= 5d-161) then
tmp = t_2
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 t_2 = (t_m * Math.sqrt(x)) / l_m;
double tmp;
if (t_m <= 2.8e-221) {
tmp = t_2;
} else if (t_m <= 3.2e-182) {
tmp = 1.0;
} else if (t_m <= 5e-161) {
tmp = t_2;
} 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): t_2 = (t_m * math.sqrt(x)) / l_m tmp = 0 if t_m <= 2.8e-221: tmp = t_2 elif t_m <= 3.2e-182: tmp = 1.0 elif t_m <= 5e-161: tmp = t_2 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) t_2 = Float64(Float64(t_m * sqrt(x)) / l_m) tmp = 0.0 if (t_m <= 2.8e-221) tmp = t_2; elseif (t_m <= 3.2e-182) tmp = 1.0; elseif (t_m <= 5e-161) tmp = t_2; 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) t_2 = (t_m * sqrt(x)) / l_m; tmp = 0.0; if (t_m <= 2.8e-221) tmp = t_2; elseif (t_m <= 3.2e-182) tmp = 1.0; elseif (t_m <= 5e-161) tmp = t_2; 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_] := Block[{t$95$2 = N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2.8e-221], t$95$2, If[LessEqual[t$95$m, 3.2e-182], 1.0, If[LessEqual[t$95$m, 5e-161], t$95$2, 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)
\\
\begin{array}{l}
t_2 := \frac{t\_m \cdot \sqrt{x}}{l\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.8 \cdot 10^{-221}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_m \leq 3.2 \cdot 10^{-182}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_m \leq 5 \cdot 10^{-161}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 2.80000000000000019e-221 or 3.20000000000000002e-182 < t < 4.9999999999999999e-161Initial program 32.4%
Simplified32.4%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
associate--l+9.2%
sub-neg9.2%
metadata-eval9.2%
+-commutative9.2%
sub-neg9.2%
metadata-eval9.2%
+-commutative9.2%
Simplified9.2%
Taylor expanded in x around inf 15.4%
*-commutative15.4%
associate-/l*15.4%
*-commutative15.4%
Simplified15.4%
sqrt-unprod15.5%
metadata-eval15.5%
metadata-eval15.5%
div-inv15.5%
add-exp-log9.1%
Applied egg-rr9.1%
rem-exp-log15.5%
associate-*r/17.4%
Applied egg-rr17.4%
if 2.80000000000000019e-221 < t < 3.20000000000000002e-182Initial program 3.1%
Simplified3.1%
Taylor expanded in l around 0 100.0%
associate-*l*100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if 4.9999999999999999e-161 < t Initial program 39.6%
Simplified39.6%
Taylor expanded in l around 0 85.6%
associate-*l*85.6%
+-commutative85.6%
sub-neg85.6%
metadata-eval85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in t around 0 85.9%
Final simplification48.0%
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 x)) l_m)))
(*
t_s
(if (<= t_m 2.5e-225)
t_2
(if (<= t_m 1.8e-182)
1.0
(if (<= t_m 1.26e-160) t_2 (+ 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 t_2 = (t_m * sqrt(x)) / l_m;
double tmp;
if (t_m <= 2.5e-225) {
tmp = t_2;
} else if (t_m <= 1.8e-182) {
tmp = 1.0;
} else if (t_m <= 1.26e-160) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_2 = (t_m * sqrt(x)) / l_m
if (t_m <= 2.5d-225) then
tmp = t_2
else if (t_m <= 1.8d-182) then
tmp = 1.0d0
else if (t_m <= 1.26d-160) then
tmp = t_2
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 t_2 = (t_m * Math.sqrt(x)) / l_m;
double tmp;
if (t_m <= 2.5e-225) {
tmp = t_2;
} else if (t_m <= 1.8e-182) {
tmp = 1.0;
} else if (t_m <= 1.26e-160) {
tmp = t_2;
} 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): t_2 = (t_m * math.sqrt(x)) / l_m tmp = 0 if t_m <= 2.5e-225: tmp = t_2 elif t_m <= 1.8e-182: tmp = 1.0 elif t_m <= 1.26e-160: tmp = t_2 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) t_2 = Float64(Float64(t_m * sqrt(x)) / l_m) tmp = 0.0 if (t_m <= 2.5e-225) tmp = t_2; elseif (t_m <= 1.8e-182) tmp = 1.0; elseif (t_m <= 1.26e-160) tmp = t_2; 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) t_2 = (t_m * sqrt(x)) / l_m; tmp = 0.0; if (t_m <= 2.5e-225) tmp = t_2; elseif (t_m <= 1.8e-182) tmp = 1.0; elseif (t_m <= 1.26e-160) tmp = t_2; 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_] := Block[{t$95$2 = N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2.5e-225], t$95$2, If[LessEqual[t$95$m, 1.8e-182], 1.0, If[LessEqual[t$95$m, 1.26e-160], t$95$2, 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)
\\
\begin{array}{l}
t_2 := \frac{t\_m \cdot \sqrt{x}}{l\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.5 \cdot 10^{-225}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_m \leq 1.8 \cdot 10^{-182}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_m \leq 1.26 \cdot 10^{-160}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1 + \frac{0.5}{x}}{x}\\
\end{array}
\end{array}
\end{array}
if t < 2.5e-225 or 1.79999999999999988e-182 < t < 1.26e-160Initial program 32.4%
Simplified32.4%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
associate--l+9.2%
sub-neg9.2%
metadata-eval9.2%
+-commutative9.2%
sub-neg9.2%
metadata-eval9.2%
+-commutative9.2%
Simplified9.2%
Taylor expanded in x around inf 15.4%
*-commutative15.4%
associate-/l*15.4%
*-commutative15.4%
Simplified15.4%
sqrt-unprod15.5%
metadata-eval15.5%
metadata-eval15.5%
div-inv15.5%
add-exp-log9.1%
Applied egg-rr9.1%
rem-exp-log15.5%
associate-*r/17.4%
Applied egg-rr17.4%
if 2.5e-225 < t < 1.79999999999999988e-182Initial program 3.1%
Simplified3.1%
Taylor expanded in l around 0 100.0%
associate-*l*100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if 1.26e-160 < t Initial program 39.6%
Simplified39.6%
Taylor expanded in l around 0 85.6%
associate-*l*85.6%
+-commutative85.6%
sub-neg85.6%
metadata-eval85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
unsub-neg0.0%
Simplified85.9%
Taylor expanded in x around inf 85.9%
associate-*r/85.9%
metadata-eval85.9%
Simplified85.9%
Final simplification48.0%
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.7e-232)
(* (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 <= 1.7e-232) {
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 <= 1.7d-232) 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 <= 1.7e-232) {
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 <= 1.7e-232: 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 <= 1.7e-232) 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 <= 1.7e-232) 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, 1.7e-232], 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 1.7 \cdot 10^{-232}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t\_m}{l\_m}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1 + \frac{0.5}{x}}{x}\\
\end{array}
\end{array}
if t < 1.7000000000000001e-232Initial program 32.8%
Simplified32.8%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
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 inf 14.9%
*-commutative14.9%
associate-/l*14.9%
*-commutative14.9%
Simplified14.9%
pow114.9%
*-commutative14.9%
sqrt-unprod15.0%
metadata-eval15.0%
metadata-eval15.0%
div-inv15.1%
Applied egg-rr15.1%
unpow115.1%
*-commutative15.1%
Simplified15.1%
if 1.7000000000000001e-232 < t Initial program 38.4%
Simplified38.3%
Taylor expanded in l around 0 85.3%
associate-*l*85.3%
+-commutative85.3%
sub-neg85.3%
metadata-eval85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
unsub-neg0.0%
Simplified85.6%
Taylor expanded in x around inf 85.6%
associate-*r/85.6%
metadata-eval85.6%
Simplified85.6%
Final simplification47.0%
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.3%
Simplified35.3%
Taylor expanded in l around 0 40.9%
associate-*l*40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
unsub-neg0.0%
Simplified41.0%
Taylor expanded in x around inf 41.0%
associate-*r/41.0%
metadata-eval41.0%
Simplified41.0%
Final simplification41.0%
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.3%
Simplified35.3%
Taylor expanded in l around 0 40.9%
associate-*l*40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in x around inf 41.0%
Final simplification41.0%
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.3%
Simplified35.3%
Taylor expanded in l around 0 40.9%
associate-*l*40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in x around inf 40.6%
herbie shell --seed 2024087
(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)))))