
(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 10 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 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= (* l_m l_m) 5e+274)
(+ 1.0 (+ (/ 0.5 (pow x 2.0)) (- (/ -1.0 x) (/ 0.5 (pow x 3.0)))))
(* t_m (* (/ (sqrt 2.0) l_m) (sqrt (fma x 0.5 -0.5)))))))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 * l_m) <= 5e+274) {
tmp = 1.0 + ((0.5 / pow(x, 2.0)) + ((-1.0 / x) - (0.5 / pow(x, 3.0))));
} else {
tmp = t_m * ((sqrt(2.0) / l_m) * sqrt(fma(x, 0.5, -0.5)));
}
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 (Float64(l_m * l_m) <= 5e+274) tmp = Float64(1.0 + Float64(Float64(0.5 / (x ^ 2.0)) + Float64(Float64(-1.0 / x) - Float64(0.5 / (x ^ 3.0))))); else tmp = Float64(t_m * Float64(Float64(sqrt(2.0) / l_m) * sqrt(fma(x, 0.5, -0.5)))); 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[N[(l$95$m * l$95$m), $MachinePrecision], 5e+274], N[(1.0 + N[(N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$m * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[N[(x * 0.5 + -0.5), $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)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+274}:\\
\;\;\;\;1 + \left(\frac{0.5}{{x}^{2}} + \left(\frac{-1}{x} - \frac{0.5}{{x}^{3}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_m \cdot \left(\frac{\sqrt{2}}{l\_m} \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 4.9999999999999998e274Initial program 43.8%
Simplified43.7%
Taylor expanded in l around 0 45.6%
+-commutative45.6%
sub-neg45.6%
metadata-eval45.6%
+-commutative45.6%
Simplified45.6%
Taylor expanded in x around inf 45.7%
associate--l+45.7%
associate-*r/45.7%
metadata-eval45.7%
+-commutative45.7%
associate-*r/45.7%
metadata-eval45.7%
Simplified45.7%
if 4.9999999999999998e274 < (*.f64 l l) Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+29.1%
sub-neg29.1%
metadata-eval29.1%
+-commutative29.1%
sub-neg29.1%
metadata-eval29.1%
+-commutative29.1%
Simplified29.1%
Taylor expanded in x around 0 37.9%
Taylor expanded in t around 0 37.9%
associate-/l*37.9%
*-commutative37.9%
fma-neg37.9%
metadata-eval37.9%
associate-*l*40.7%
Simplified40.7%
Final simplification44.4%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= (* l_m l_m) 5e+274)
(+ 1.0 (+ (/ 0.5 (pow x 2.0)) (- (/ -1.0 x) (/ 0.5 (pow x 3.0)))))
(/ (* t_m (sqrt 2.0)) (* l_m (sqrt (+ (/ 1.0 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 ((l_m * l_m) <= 5e+274) {
tmp = 1.0 + ((0.5 / pow(x, 2.0)) + ((-1.0 / x) - (0.5 / pow(x, 3.0))));
} else {
tmp = (t_m * sqrt(2.0)) / (l_m * sqrt(((1.0 / 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 ((l_m * l_m) <= 5d+274) then
tmp = 1.0d0 + ((0.5d0 / (x ** 2.0d0)) + (((-1.0d0) / x) - (0.5d0 / (x ** 3.0d0))))
else
tmp = (t_m * sqrt(2.0d0)) / (l_m * sqrt(((1.0d0 / 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 ((l_m * l_m) <= 5e+274) {
tmp = 1.0 + ((0.5 / Math.pow(x, 2.0)) + ((-1.0 / x) - (0.5 / Math.pow(x, 3.0))));
} else {
tmp = (t_m * Math.sqrt(2.0)) / (l_m * Math.sqrt(((1.0 / 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 (l_m * l_m) <= 5e+274: tmp = 1.0 + ((0.5 / math.pow(x, 2.0)) + ((-1.0 / x) - (0.5 / math.pow(x, 3.0)))) else: tmp = (t_m * math.sqrt(2.0)) / (l_m * math.sqrt(((1.0 / 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 (Float64(l_m * l_m) <= 5e+274) tmp = Float64(1.0 + Float64(Float64(0.5 / (x ^ 2.0)) + Float64(Float64(-1.0 / x) - Float64(0.5 / (x ^ 3.0))))); else tmp = Float64(Float64(t_m * sqrt(2.0)) / Float64(l_m * sqrt(Float64(Float64(1.0 / x) + Float64(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 ((l_m * l_m) <= 5e+274) tmp = 1.0 + ((0.5 / (x ^ 2.0)) + ((-1.0 / x) - (0.5 / (x ^ 3.0)))); else tmp = (t_m * sqrt(2.0)) / (l_m * sqrt(((1.0 / 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[N[(l$95$m * l$95$m), $MachinePrecision], 5e+274], N[(1.0 + N[(N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l$95$m * N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / 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)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+274}:\\
\;\;\;\;1 + \left(\frac{0.5}{{x}^{2}} + \left(\frac{-1}{x} - \frac{0.5}{{x}^{3}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{2}}{l\_m \cdot \sqrt{\frac{1}{x} + \frac{1}{x + -1}}}\\
\end{array}
\end{array}
if (*.f64 l l) < 4.9999999999999998e274Initial program 43.8%
Simplified43.7%
Taylor expanded in l around 0 45.6%
+-commutative45.6%
sub-neg45.6%
metadata-eval45.6%
+-commutative45.6%
Simplified45.6%
Taylor expanded in x around inf 45.7%
associate--l+45.7%
associate-*r/45.7%
metadata-eval45.7%
+-commutative45.7%
associate-*r/45.7%
metadata-eval45.7%
Simplified45.7%
if 4.9999999999999998e274 < (*.f64 l l) Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 4.9%
associate--l+29.4%
sub-neg29.4%
metadata-eval29.4%
+-commutative29.4%
sub-neg29.4%
metadata-eval29.4%
+-commutative29.4%
Simplified29.4%
associate-*r/29.4%
+-commutative29.4%
sub-neg29.4%
+-commutative29.4%
metadata-eval29.4%
Applied egg-rr29.4%
Taylor expanded in x around inf 40.7%
Final simplification44.5%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 2.6e+138)
(/ 1.0 (sqrt (/ (+ 1.0 x) (+ x -1.0))))
(* (sqrt 2.0) (/ t_m (* l_m (sqrt (+ (/ 1.0 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 (l_m <= 2.6e+138) {
tmp = 1.0 / sqrt(((1.0 + x) / (x + -1.0)));
} else {
tmp = sqrt(2.0) * (t_m / (l_m * sqrt(((1.0 / 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 (l_m <= 2.6d+138) then
tmp = 1.0d0 / sqrt(((1.0d0 + x) / (x + (-1.0d0))))
else
tmp = sqrt(2.0d0) * (t_m / (l_m * sqrt(((1.0d0 / 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 (l_m <= 2.6e+138) {
tmp = 1.0 / Math.sqrt(((1.0 + x) / (x + -1.0)));
} else {
tmp = Math.sqrt(2.0) * (t_m / (l_m * Math.sqrt(((1.0 / 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 l_m <= 2.6e+138: tmp = 1.0 / math.sqrt(((1.0 + x) / (x + -1.0))) else: tmp = math.sqrt(2.0) * (t_m / (l_m * math.sqrt(((1.0 / 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 (l_m <= 2.6e+138) tmp = Float64(1.0 / sqrt(Float64(Float64(1.0 + x) / Float64(x + -1.0)))); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l_m * sqrt(Float64(Float64(1.0 / x) + Float64(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 (l_m <= 2.6e+138) tmp = 1.0 / sqrt(((1.0 + x) / (x + -1.0))); else tmp = sqrt(2.0) * (t_m / (l_m * sqrt(((1.0 / 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[l$95$m, 2.6e+138], N[(1.0 / N[Sqrt[N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l$95$m * N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $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)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 2.6 \cdot 10^{+138}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{1 + x}{x + -1}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{l\_m \cdot \sqrt{\frac{1}{x} + \frac{1}{x + -1}}}\\
\end{array}
\end{array}
if l < 2.6000000000000001e138Initial program 36.9%
Simplified36.9%
Taylor expanded in l around 0 41.1%
+-commutative41.1%
sub-neg41.1%
metadata-eval41.1%
+-commutative41.1%
Simplified41.1%
expm1-log1p-u38.3%
add-cube-cbrt38.1%
pow338.0%
expm1-log1p-u40.3%
*-commutative40.3%
Applied egg-rr40.3%
associate-*r/40.3%
rem-cube-cbrt41.1%
+-commutative41.1%
Applied egg-rr41.1%
associate-/r*41.1%
*-inverses41.1%
Simplified41.1%
if 2.6000000000000001e138 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.8%
associate--l+37.7%
sub-neg37.7%
metadata-eval37.7%
+-commutative37.7%
sub-neg37.7%
metadata-eval37.7%
+-commutative37.7%
Simplified37.7%
Taylor expanded in x around inf 64.1%
Final simplification43.6%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 1.4e+138)
(+ 1.0 (+ (/ 0.5 (pow x 2.0)) (- (/ -1.0 x) (/ 0.5 (pow x 3.0)))))
(* (sqrt 2.0) (/ t_m (* l_m (sqrt (+ (/ 1.0 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 (l_m <= 1.4e+138) {
tmp = 1.0 + ((0.5 / pow(x, 2.0)) + ((-1.0 / x) - (0.5 / pow(x, 3.0))));
} else {
tmp = sqrt(2.0) * (t_m / (l_m * sqrt(((1.0 / 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 (l_m <= 1.4d+138) then
tmp = 1.0d0 + ((0.5d0 / (x ** 2.0d0)) + (((-1.0d0) / x) - (0.5d0 / (x ** 3.0d0))))
else
tmp = sqrt(2.0d0) * (t_m / (l_m * sqrt(((1.0d0 / 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 (l_m <= 1.4e+138) {
tmp = 1.0 + ((0.5 / Math.pow(x, 2.0)) + ((-1.0 / x) - (0.5 / Math.pow(x, 3.0))));
} else {
tmp = Math.sqrt(2.0) * (t_m / (l_m * Math.sqrt(((1.0 / 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 l_m <= 1.4e+138: tmp = 1.0 + ((0.5 / math.pow(x, 2.0)) + ((-1.0 / x) - (0.5 / math.pow(x, 3.0)))) else: tmp = math.sqrt(2.0) * (t_m / (l_m * math.sqrt(((1.0 / 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 (l_m <= 1.4e+138) tmp = Float64(1.0 + Float64(Float64(0.5 / (x ^ 2.0)) + Float64(Float64(-1.0 / x) - Float64(0.5 / (x ^ 3.0))))); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l_m * sqrt(Float64(Float64(1.0 / x) + Float64(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 (l_m <= 1.4e+138) tmp = 1.0 + ((0.5 / (x ^ 2.0)) + ((-1.0 / x) - (0.5 / (x ^ 3.0)))); else tmp = sqrt(2.0) * (t_m / (l_m * sqrt(((1.0 / 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[l$95$m, 1.4e+138], N[(1.0 + N[(N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l$95$m * N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $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)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.4 \cdot 10^{+138}:\\
\;\;\;\;1 + \left(\frac{0.5}{{x}^{2}} + \left(\frac{-1}{x} - \frac{0.5}{{x}^{3}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{l\_m \cdot \sqrt{\frac{1}{x} + \frac{1}{x + -1}}}\\
\end{array}
\end{array}
if l < 1.4e138Initial program 36.9%
Simplified36.9%
Taylor expanded in l around 0 41.1%
+-commutative41.1%
sub-neg41.1%
metadata-eval41.1%
+-commutative41.1%
Simplified41.1%
Taylor expanded in x around inf 41.1%
associate--l+41.1%
associate-*r/41.1%
metadata-eval41.1%
+-commutative41.1%
associate-*r/41.1%
metadata-eval41.1%
Simplified41.1%
if 1.4e138 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.8%
associate--l+37.7%
sub-neg37.7%
metadata-eval37.7%
+-commutative37.7%
sub-neg37.7%
metadata-eval37.7%
+-commutative37.7%
Simplified37.7%
Taylor expanded in x around inf 64.1%
Final simplification43.6%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 9.5e+181)
(/ 1.0 (sqrt (/ (+ 1.0 x) (+ x -1.0))))
(* (sqrt 2.0) (* (/ t_m l_m) (sqrt (* 0.5 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 (l_m <= 9.5e+181) {
tmp = 1.0 / sqrt(((1.0 + x) / (x + -1.0)));
} else {
tmp = sqrt(2.0) * ((t_m / l_m) * sqrt((0.5 * 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 (l_m <= 9.5d+181) then
tmp = 1.0d0 / sqrt(((1.0d0 + x) / (x + (-1.0d0))))
else
tmp = sqrt(2.0d0) * ((t_m / l_m) * sqrt((0.5d0 * 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 (l_m <= 9.5e+181) {
tmp = 1.0 / Math.sqrt(((1.0 + x) / (x + -1.0)));
} else {
tmp = Math.sqrt(2.0) * ((t_m / l_m) * Math.sqrt((0.5 * 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 l_m <= 9.5e+181: tmp = 1.0 / math.sqrt(((1.0 + x) / (x + -1.0))) else: tmp = math.sqrt(2.0) * ((t_m / l_m) * math.sqrt((0.5 * 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 (l_m <= 9.5e+181) tmp = Float64(1.0 / sqrt(Float64(Float64(1.0 + x) / Float64(x + -1.0)))); else tmp = Float64(sqrt(2.0) * Float64(Float64(t_m / l_m) * sqrt(Float64(0.5 * 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 (l_m <= 9.5e+181) tmp = 1.0 / sqrt(((1.0 + x) / (x + -1.0))); else tmp = sqrt(2.0) * ((t_m / l_m) * sqrt((0.5 * 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[l$95$m, 9.5e+181], N[(1.0 / N[Sqrt[N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[Sqrt[N[(0.5 * x), $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)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 9.5 \cdot 10^{+181}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{1 + x}{x + -1}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(\frac{t\_m}{l\_m} \cdot \sqrt{0.5 \cdot x}\right)\\
\end{array}
\end{array}
if l < 9.50000000000000032e181Initial program 36.5%
Simplified36.4%
Taylor expanded in l around 0 41.4%
+-commutative41.4%
sub-neg41.4%
metadata-eval41.4%
+-commutative41.4%
Simplified41.4%
expm1-log1p-u38.6%
add-cube-cbrt38.4%
pow338.3%
expm1-log1p-u40.6%
*-commutative40.6%
Applied egg-rr40.6%
associate-*r/40.6%
rem-cube-cbrt41.5%
+-commutative41.5%
Applied egg-rr41.5%
associate-/r*41.5%
*-inverses41.5%
Simplified41.5%
if 9.50000000000000032e181 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 10.1%
*-commutative10.1%
associate--l+40.8%
sub-neg40.8%
metadata-eval40.8%
+-commutative40.8%
sub-neg40.8%
metadata-eval40.8%
+-commutative40.8%
Simplified40.8%
Taylor expanded in x around inf 63.8%
*-commutative63.8%
Simplified63.8%
Final simplification43.6%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 1.45e+183)
(/ 1.0 (sqrt (/ (+ 1.0 x) (+ x -1.0))))
(* (/ t_m l_m) (sqrt (* 2.0 (fma x 0.5 -0.5)))))))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 <= 1.45e+183) {
tmp = 1.0 / sqrt(((1.0 + x) / (x + -1.0)));
} else {
tmp = (t_m / l_m) * sqrt((2.0 * fma(x, 0.5, -0.5)));
}
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 <= 1.45e+183) tmp = Float64(1.0 / sqrt(Float64(Float64(1.0 + x) / Float64(x + -1.0)))); else tmp = Float64(Float64(t_m / l_m) * sqrt(Float64(2.0 * fma(x, 0.5, -0.5)))); 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, 1.45e+183], N[(1.0 / N[Sqrt[N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(x * 0.5 + -0.5), $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)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.45 \cdot 10^{+183}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{1 + x}{x + -1}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_m}{l\_m} \cdot \sqrt{2 \cdot \mathsf{fma}\left(x, 0.5, -0.5\right)}\\
\end{array}
\end{array}
if l < 1.45e183Initial program 36.5%
Simplified36.4%
Taylor expanded in l around 0 41.4%
+-commutative41.4%
sub-neg41.4%
metadata-eval41.4%
+-commutative41.4%
Simplified41.4%
expm1-log1p-u38.6%
add-cube-cbrt38.4%
pow338.3%
expm1-log1p-u40.6%
*-commutative40.6%
Applied egg-rr40.6%
associate-*r/40.6%
rem-cube-cbrt41.5%
+-commutative41.5%
Applied egg-rr41.5%
associate-/r*41.5%
*-inverses41.5%
Simplified41.5%
if 1.45e183 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 10.1%
*-commutative10.1%
associate--l+40.8%
sub-neg40.8%
metadata-eval40.8%
+-commutative40.8%
sub-neg40.8%
metadata-eval40.8%
+-commutative40.8%
Simplified40.8%
Taylor expanded in x around 0 63.8%
pow163.8%
associate-*r*63.8%
sqrt-unprod63.9%
*-commutative63.9%
fma-neg63.9%
metadata-eval63.9%
Applied egg-rr63.9%
unpow163.9%
*-commutative63.9%
Simplified63.9%
Final simplification43.6%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 1 t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (pow (/ (+ 1.0 x) (+ x -1.0)) -0.5)))
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 * pow(((1.0 + x) / (x + -1.0)), -0.5);
}
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 + x) / (x + (-1.0d0))) ** (-0.5d0))
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.pow(((1.0 + x) / (x + -1.0)), -0.5);
}
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.pow(((1.0 + x) / (x + -1.0)), -0.5)
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(Float64(1.0 + x) / Float64(x + -1.0)) ^ -0.5)) 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 + x) / (x + -1.0)) ^ -0.5); 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[Power[N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision], -0.5], $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(\frac{1 + x}{x + -1}\right)}^{-0.5}
\end{array}
Initial program 33.0%
Simplified33.0%
Taylor expanded in l around 0 38.9%
+-commutative38.9%
sub-neg38.9%
metadata-eval38.9%
+-commutative38.9%
Simplified38.9%
expm1-log1p-u36.2%
add-cube-cbrt36.0%
pow336.0%
expm1-log1p-u38.2%
*-commutative38.2%
Applied egg-rr38.2%
associate-*r/38.2%
rem-cube-cbrt39.0%
+-commutative39.0%
Applied egg-rr39.0%
associate-/r*39.0%
*-inverses39.0%
Simplified39.0%
*-un-lft-identity39.0%
pow1/239.0%
pow-flip39.0%
+-commutative39.0%
metadata-eval39.0%
Applied egg-rr39.0%
*-lft-identity39.0%
+-commutative39.0%
+-commutative39.0%
Simplified39.0%
Final simplification39.0%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 1 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 33.0%
Simplified33.0%
Taylor expanded in l around 0 38.9%
+-commutative38.9%
sub-neg38.9%
metadata-eval38.9%
+-commutative38.9%
Simplified38.9%
Taylor expanded in t around 0 39.0%
Final simplification39.0%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 1 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 33.0%
Simplified33.0%
Taylor expanded in l around 0 38.9%
+-commutative38.9%
sub-neg38.9%
metadata-eval38.9%
+-commutative38.9%
Simplified38.9%
Taylor expanded in x around inf 38.9%
Final simplification38.9%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 1 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 33.0%
Simplified33.0%
Taylor expanded in l around 0 38.9%
+-commutative38.9%
sub-neg38.9%
metadata-eval38.9%
+-commutative38.9%
Simplified38.9%
Taylor expanded in x around inf 38.7%
Final simplification38.7%
herbie shell --seed 2024050
(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)))))