
(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}
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (* 2.0 (pow l 2.0))))
(*
t_s
(if (<= t_m 5.8e-218)
(*
(sqrt 2.0)
(/
t_m
(+
(*
0.5
(/
(+ (* 2.0 (+ (pow t_m 2.0) (pow t_m 2.0))) t_2)
(* t_m (* (sqrt 2.0) x))))
(* t_m (sqrt 2.0)))))
(if (<= t_m 5.6e-10)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma 2.0 (/ (pow t_m 2.0) (/ (+ -1.0 x) (+ x 1.0))) (/ t_2 x)))))
(pow (/ (+ x 1.0) (+ -1.0 x)) -0.5))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = 2.0 * pow(l, 2.0);
double tmp;
if (t_m <= 5.8e-218) {
tmp = sqrt(2.0) * (t_m / ((0.5 * (((2.0 * (pow(t_m, 2.0) + pow(t_m, 2.0))) + t_2) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
} else if (t_m <= 5.6e-10) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) / ((-1.0 + x) / (x + 1.0))), (t_2 / x))));
} else {
tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
}
return t_s * tmp;
}
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64(2.0 * (l ^ 2.0)) tmp = 0.0 if (t_m <= 5.8e-218) 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))) + t_2) / Float64(t_m * Float64(sqrt(2.0) * x)))) + Float64(t_m * sqrt(2.0))))); elseif (t_m <= 5.6e-10) 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(t_2 / x))))); else tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5; end return Float64(t_s * tmp) end
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_, t$95$m_] := Block[{t$95$2 = N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 5.8e-218], 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] + t$95$2), $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, 5.6e-10], 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[(t$95$2 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := 2 \cdot {\ell}^{2}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 5.8 \cdot 10^{-218}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{0.5 \cdot \frac{2 \cdot \left({t_m}^{2} + {t_m}^{2}\right) + t_2}{t_m \cdot \left(\sqrt{2} \cdot x\right)} + t_m \cdot \sqrt{2}}\\
\mathbf{elif}\;t_m \leq 5.6 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{\frac{-1 + x}{x + 1}}, \frac{t_2}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if t < 5.8000000000000004e-218Initial program 32.7%
Simplified32.6%
Taylor expanded in l around 0 28.2%
fma-def28.2%
associate-/l*40.7%
+-commutative40.7%
sub-neg40.7%
metadata-eval40.7%
+-commutative40.7%
associate--l+51.3%
sub-neg51.3%
metadata-eval51.3%
+-commutative51.3%
sub-neg51.3%
metadata-eval51.3%
+-commutative51.3%
Simplified51.3%
Taylor expanded in x around inf 14.1%
if 5.8000000000000004e-218 < t < 5.60000000000000031e-10Initial program 35.7%
Simplified35.5%
Taylor expanded in l around 0 47.6%
fma-def47.6%
associate-/l*47.6%
+-commutative47.6%
sub-neg47.6%
metadata-eval47.6%
+-commutative47.6%
associate--l+60.3%
sub-neg60.3%
metadata-eval60.3%
+-commutative60.3%
sub-neg60.3%
metadata-eval60.3%
+-commutative60.3%
Simplified60.3%
Taylor expanded in x around inf 85.0%
associate-*r/85.0%
Simplified85.0%
if 5.60000000000000031e-10 < t Initial program 41.8%
Simplified41.8%
Taylor expanded in l around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
*-un-lft-identity98.9%
times-frac98.9%
+-commutative98.9%
Applied egg-rr98.9%
associate-*r/98.9%
lft-mult-inverse98.9%
+-commutative98.9%
Simplified98.9%
expm1-log1p-u98.9%
expm1-udef98.9%
inv-pow98.9%
sqrt-pow298.9%
+-commutative98.9%
+-commutative98.9%
metadata-eval98.9%
Applied egg-rr98.9%
expm1-def98.9%
expm1-log1p98.9%
+-commutative98.9%
+-commutative98.9%
Simplified98.9%
Final simplification53.4%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (* t_m (sqrt 2.0))) (t_3 (/ (+ x 1.0) (+ -1.0 x))))
(*
t_s
(if (<= (* l l) 2e+148)
(pow t_3 -0.5)
(if (<= (* l l) 5e+307)
(* (sqrt 2.0) (/ t_m (sqrt (/ (* 2.0 (pow l 2.0)) x))))
(/ t_2 (hypot (* (hypot l t_2) (sqrt t_3)) l)))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = t_m * sqrt(2.0);
double t_3 = (x + 1.0) / (-1.0 + x);
double tmp;
if ((l * l) <= 2e+148) {
tmp = pow(t_3, -0.5);
} else if ((l * l) <= 5e+307) {
tmp = sqrt(2.0) * (t_m / sqrt(((2.0 * pow(l, 2.0)) / x)));
} else {
tmp = t_2 / hypot((hypot(l, t_2) * sqrt(t_3)), l);
}
return t_s * tmp;
}
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double t_2 = t_m * Math.sqrt(2.0);
double t_3 = (x + 1.0) / (-1.0 + x);
double tmp;
if ((l * l) <= 2e+148) {
tmp = Math.pow(t_3, -0.5);
} else if ((l * l) <= 5e+307) {
tmp = Math.sqrt(2.0) * (t_m / Math.sqrt(((2.0 * Math.pow(l, 2.0)) / x)));
} else {
tmp = t_2 / Math.hypot((Math.hypot(l, t_2) * Math.sqrt(t_3)), l);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): t_2 = t_m * math.sqrt(2.0) t_3 = (x + 1.0) / (-1.0 + x) tmp = 0 if (l * l) <= 2e+148: tmp = math.pow(t_3, -0.5) elif (l * l) <= 5e+307: tmp = math.sqrt(2.0) * (t_m / math.sqrt(((2.0 * math.pow(l, 2.0)) / x))) else: tmp = t_2 / math.hypot((math.hypot(l, t_2) * math.sqrt(t_3)), l) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64(t_m * sqrt(2.0)) t_3 = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) tmp = 0.0 if (Float64(l * l) <= 2e+148) tmp = t_3 ^ -0.5; elseif (Float64(l * l) <= 5e+307) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(Float64(2.0 * (l ^ 2.0)) / x)))); else tmp = Float64(t_2 / hypot(Float64(hypot(l, t_2) * sqrt(t_3)), l)); end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) t_2 = t_m * sqrt(2.0); t_3 = (x + 1.0) / (-1.0 + x); tmp = 0.0; if ((l * l) <= 2e+148) tmp = t_3 ^ -0.5; elseif ((l * l) <= 5e+307) tmp = sqrt(2.0) * (t_m / sqrt(((2.0 * (l ^ 2.0)) / x))); else tmp = t_2 / hypot((hypot(l, t_2) * sqrt(t_3)), l); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e+148], N[Power[t$95$3, -0.5], $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 5e+307], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := t_m \cdot \sqrt{2}\\
t_3 := \frac{x + 1}{-1 + x}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+148}:\\
\;\;\;\;{t_3}^{-0.5}\\
\mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\frac{2 \cdot {\ell}^{2}}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_2}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot \sqrt{t_3}, \ell\right)}\\
\end{array}
\end{array}
\end{array}
if (*.f64 l l) < 2.0000000000000001e148Initial program 49.9%
Simplified49.9%
Taylor expanded in l around 0 49.6%
+-commutative49.6%
sub-neg49.6%
metadata-eval49.6%
+-commutative49.6%
Simplified49.6%
*-un-lft-identity49.6%
times-frac49.6%
+-commutative49.6%
Applied egg-rr49.6%
associate-*r/49.6%
lft-mult-inverse49.6%
+-commutative49.6%
Simplified49.6%
expm1-log1p-u49.6%
expm1-udef49.6%
inv-pow49.6%
sqrt-pow249.6%
+-commutative49.6%
+-commutative49.6%
metadata-eval49.6%
Applied egg-rr49.6%
expm1-def49.6%
expm1-log1p49.6%
+-commutative49.6%
+-commutative49.6%
Simplified49.6%
if 2.0000000000000001e148 < (*.f64 l l) < 5e307Initial program 12.9%
Simplified12.8%
Taylor expanded in l around inf 2.6%
associate--l+16.1%
sub-neg16.1%
metadata-eval16.1%
+-commutative16.1%
sub-neg16.1%
metadata-eval16.1%
+-commutative16.1%
Simplified16.1%
Taylor expanded in x around inf 61.2%
associate-*r/85.5%
Simplified61.2%
if 5e307 < (*.f64 l l) Initial program 0.0%
Simplified0.0%
Applied egg-rr61.5%
Final simplification53.2%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= t_m 6.5e-10)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(/ (pow t_m 2.0) (/ (+ -1.0 x) (+ x 1.0)))
(/ (* 2.0 (pow l 2.0)) x)))))
(pow (/ (+ x 1.0) (+ -1.0 x)) -0.5))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (t_m <= 6.5e-10) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) / ((-1.0 + x) / (x + 1.0))), ((2.0 * pow(l, 2.0)) / x))));
} else {
tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
}
return t_s * tmp;
}
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (t_m <= 6.5e-10) 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(Float64(2.0 * (l ^ 2.0)) / x))))); else tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5; end return Float64(t_s * tmp) end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 6.5e-10], 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[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 6.5 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{\frac{-1 + x}{x + 1}}, \frac{2 \cdot {\ell}^{2}}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\
\end{array}
\end{array}
if t < 6.5000000000000003e-10Initial program 33.5%
Simplified33.4%
Taylor expanded in l around 0 33.2%
fma-def33.2%
associate-/l*42.5%
+-commutative42.5%
sub-neg42.5%
metadata-eval42.5%
+-commutative42.5%
associate--l+53.6%
sub-neg53.6%
metadata-eval53.6%
+-commutative53.6%
sub-neg53.6%
metadata-eval53.6%
+-commutative53.6%
Simplified53.6%
Taylor expanded in x around inf 66.5%
associate-*r/66.5%
Simplified66.5%
if 6.5000000000000003e-10 < t Initial program 41.8%
Simplified41.8%
Taylor expanded in l around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
*-un-lft-identity98.9%
times-frac98.9%
+-commutative98.9%
Applied egg-rr98.9%
associate-*r/98.9%
lft-mult-inverse98.9%
+-commutative98.9%
Simplified98.9%
expm1-log1p-u98.9%
expm1-udef98.9%
inv-pow98.9%
sqrt-pow298.9%
+-commutative98.9%
+-commutative98.9%
metadata-eval98.9%
Applied egg-rr98.9%
expm1-def98.9%
expm1-log1p98.9%
+-commutative98.9%
+-commutative98.9%
Simplified98.9%
Final simplification76.8%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= t_m 2.3e-156)
(* (sqrt 2.0) (/ t_m (sqrt (/ (* 2.0 (pow l 2.0)) x))))
(pow (/ (+ x 1.0) (+ -1.0 x)) -0.5))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (t_m <= 2.3e-156) {
tmp = sqrt(2.0) * (t_m / sqrt(((2.0 * pow(l, 2.0)) / x)));
} else {
tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 2.3d-156) then
tmp = sqrt(2.0d0) * (t_m / sqrt(((2.0d0 * (l ** 2.0d0)) / x)))
else
tmp = ((x + 1.0d0) / ((-1.0d0) + x)) ** (-0.5d0)
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (t_m <= 2.3e-156) {
tmp = Math.sqrt(2.0) * (t_m / Math.sqrt(((2.0 * Math.pow(l, 2.0)) / x)));
} else {
tmp = Math.pow(((x + 1.0) / (-1.0 + x)), -0.5);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if t_m <= 2.3e-156: tmp = math.sqrt(2.0) * (t_m / math.sqrt(((2.0 * math.pow(l, 2.0)) / x))) else: tmp = math.pow(((x + 1.0) / (-1.0 + x)), -0.5) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (t_m <= 2.3e-156) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(Float64(2.0 * (l ^ 2.0)) / x)))); else tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5; end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (t_m <= 2.3e-156) tmp = sqrt(2.0) * (t_m / sqrt(((2.0 * (l ^ 2.0)) / x))); else tmp = ((x + 1.0) / (-1.0 + x)) ^ -0.5; end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.3e-156], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
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.3 \cdot 10^{-156}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\frac{2 \cdot {\ell}^{2}}{x}}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\
\end{array}
\end{array}
if t < 2.3e-156Initial program 30.5%
Simplified30.5%
Taylor expanded in l around inf 2.3%
associate--l+12.9%
sub-neg12.9%
metadata-eval12.9%
+-commutative12.9%
sub-neg12.9%
metadata-eval12.9%
+-commutative12.9%
Simplified12.9%
Taylor expanded in x around inf 23.6%
associate-*r/60.2%
Simplified23.6%
if 2.3e-156 < t Initial program 42.8%
Simplified42.8%
Taylor expanded in l around 0 85.6%
+-commutative85.6%
sub-neg85.6%
metadata-eval85.6%
+-commutative85.6%
Simplified85.6%
*-un-lft-identity85.6%
times-frac85.7%
+-commutative85.7%
Applied egg-rr85.7%
associate-*r/85.7%
lft-mult-inverse85.7%
+-commutative85.7%
Simplified85.7%
expm1-log1p-u85.7%
expm1-udef85.7%
inv-pow85.7%
sqrt-pow285.7%
+-commutative85.7%
+-commutative85.7%
metadata-eval85.7%
Applied egg-rr85.7%
expm1-def85.7%
expm1-log1p85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Final simplification51.7%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= l 5.8e+77)
(pow (/ (+ x 1.0) (+ -1.0 x)) -0.5)
(if (or (<= l 2.6e+99) (not (<= l 2.1e+231)))
(/ (sqrt 2.0) (* (/ l t_m) (sqrt (/ 2.0 x))))
(sqrt (/ (+ -1.0 x) (+ x 1.0)))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 5.8e+77) {
tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
} else if ((l <= 2.6e+99) || !(l <= 2.1e+231)) {
tmp = sqrt(2.0) / ((l / t_m) * sqrt((2.0 / x)));
} else {
tmp = sqrt(((-1.0 + x) / (x + 1.0)));
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (l <= 5.8d+77) then
tmp = ((x + 1.0d0) / ((-1.0d0) + x)) ** (-0.5d0)
else if ((l <= 2.6d+99) .or. (.not. (l <= 2.1d+231))) then
tmp = sqrt(2.0d0) / ((l / t_m) * sqrt((2.0d0 / x)))
else
tmp = sqrt((((-1.0d0) + x) / (x + 1.0d0)))
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 5.8e+77) {
tmp = Math.pow(((x + 1.0) / (-1.0 + x)), -0.5);
} else if ((l <= 2.6e+99) || !(l <= 2.1e+231)) {
tmp = Math.sqrt(2.0) / ((l / t_m) * Math.sqrt((2.0 / x)));
} else {
tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if l <= 5.8e+77: tmp = math.pow(((x + 1.0) / (-1.0 + x)), -0.5) elif (l <= 2.6e+99) or not (l <= 2.1e+231): tmp = math.sqrt(2.0) / ((l / t_m) * math.sqrt((2.0 / x))) else: tmp = math.sqrt(((-1.0 + x) / (x + 1.0))) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (l <= 5.8e+77) tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5; elseif ((l <= 2.6e+99) || !(l <= 2.1e+231)) tmp = Float64(sqrt(2.0) / Float64(Float64(l / t_m) * sqrt(Float64(2.0 / x)))); else tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))); end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (l <= 5.8e+77) tmp = ((x + 1.0) / (-1.0 + x)) ^ -0.5; elseif ((l <= 2.6e+99) || ~((l <= 2.1e+231))) tmp = sqrt(2.0) / ((l / t_m) * sqrt((2.0 / x))); else tmp = sqrt(((-1.0 + x) / (x + 1.0))); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[l, 5.8e+77], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision], If[Or[LessEqual[l, 2.6e+99], N[Not[LessEqual[l, 2.1e+231]], $MachinePrecision]], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(l / t$95$m), $MachinePrecision] * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 5.8 \cdot 10^{+77}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+99} \lor \neg \left(\ell \leq 2.1 \cdot 10^{+231}\right):\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\ell}{t_m} \cdot \sqrt{\frac{2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\
\end{array}
\end{array}
if l < 5.8000000000000003e77Initial program 43.7%
Simplified43.7%
Taylor expanded in l around 0 47.6%
+-commutative47.6%
sub-neg47.6%
metadata-eval47.6%
+-commutative47.6%
Simplified47.6%
*-un-lft-identity47.6%
times-frac47.6%
+-commutative47.6%
Applied egg-rr47.6%
associate-*r/47.6%
lft-mult-inverse47.6%
+-commutative47.6%
Simplified47.6%
expm1-log1p-u47.6%
expm1-udef47.6%
inv-pow47.6%
sqrt-pow247.6%
+-commutative47.6%
+-commutative47.6%
metadata-eval47.6%
Applied egg-rr47.6%
expm1-def47.6%
expm1-log1p47.6%
+-commutative47.6%
+-commutative47.6%
Simplified47.6%
if 5.8000000000000003e77 < l < 2.6e99 or 2.09999999999999984e231 < l Initial program 5.4%
Simplified5.4%
Taylor expanded in l around inf 1.5%
*-commutative1.5%
associate--l+31.7%
sub-neg31.7%
metadata-eval31.7%
+-commutative31.7%
sub-neg31.7%
metadata-eval31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in l around 0 1.5%
associate--l+31.7%
sub-neg31.7%
metadata-eval31.7%
sub-neg31.7%
metadata-eval31.7%
sub-neg31.7%
metadata-eval31.7%
+-commutative31.7%
associate-+l+1.5%
+-commutative1.5%
+-commutative1.5%
Simplified1.5%
Taylor expanded in x around inf 69.4%
if 2.6e99 < l < 2.09999999999999984e231Initial program 1.1%
Simplified1.1%
Taylor expanded in l around 0 27.8%
+-commutative27.8%
sub-neg27.8%
metadata-eval27.8%
+-commutative27.8%
Simplified27.8%
associate-/r*27.8%
sqrt-undiv27.8%
metadata-eval27.8%
metadata-eval27.8%
metadata-eval27.8%
sqrt-div27.8%
clear-num27.8%
+-commutative27.8%
Applied egg-rr27.8%
Final simplification47.3%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= l 1.66e+233)
(pow (/ (+ x 1.0) (+ -1.0 x)) -0.5)
(/
(sqrt (/ 2.0 (+ (/ 1.0 (+ -1.0 x)) (+ -1.0 (/ x (+ -1.0 x))))))
(/ l t_m)))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 1.66e+233) {
tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
} else {
tmp = sqrt((2.0 / ((1.0 / (-1.0 + x)) + (-1.0 + (x / (-1.0 + x)))))) / (l / t_m);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (l <= 1.66d+233) then
tmp = ((x + 1.0d0) / ((-1.0d0) + x)) ** (-0.5d0)
else
tmp = sqrt((2.0d0 / ((1.0d0 / ((-1.0d0) + x)) + ((-1.0d0) + (x / ((-1.0d0) + x)))))) / (l / t_m)
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 1.66e+233) {
tmp = Math.pow(((x + 1.0) / (-1.0 + x)), -0.5);
} else {
tmp = Math.sqrt((2.0 / ((1.0 / (-1.0 + x)) + (-1.0 + (x / (-1.0 + x)))))) / (l / t_m);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if l <= 1.66e+233: tmp = math.pow(((x + 1.0) / (-1.0 + x)), -0.5) else: tmp = math.sqrt((2.0 / ((1.0 / (-1.0 + x)) + (-1.0 + (x / (-1.0 + x)))))) / (l / t_m) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (l <= 1.66e+233) tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5; else tmp = Float64(sqrt(Float64(2.0 / Float64(Float64(1.0 / Float64(-1.0 + x)) + Float64(-1.0 + Float64(x / Float64(-1.0 + x)))))) / Float64(l / t_m)); end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (l <= 1.66e+233) tmp = ((x + 1.0) / (-1.0 + x)) ^ -0.5; else tmp = sqrt((2.0 / ((1.0 / (-1.0 + x)) + (-1.0 + (x / (-1.0 + x)))))) / (l / t_m); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[l, 1.66e+233], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision], N[(N[Sqrt[N[(2.0 / N[(N[(1.0 / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 + N[(x / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 1.66 \cdot 10^{+233}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{2}{\frac{1}{-1 + x} + \left(-1 + \frac{x}{-1 + x}\right)}}}{\frac{\ell}{t_m}}\\
\end{array}
\end{array}
if l < 1.66e233Initial program 38.2%
Simplified38.2%
Taylor expanded in l around 0 44.5%
+-commutative44.5%
sub-neg44.5%
metadata-eval44.5%
+-commutative44.5%
Simplified44.5%
*-un-lft-identity44.5%
times-frac44.5%
+-commutative44.5%
Applied egg-rr44.5%
associate-*r/44.5%
lft-mult-inverse44.5%
+-commutative44.5%
Simplified44.5%
expm1-log1p-u44.5%
expm1-udef44.5%
inv-pow44.5%
sqrt-pow244.5%
+-commutative44.5%
+-commutative44.5%
metadata-eval44.5%
Applied egg-rr44.5%
expm1-def44.5%
expm1-log1p44.5%
+-commutative44.5%
+-commutative44.5%
Simplified44.5%
if 1.66e233 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 1.1%
*-commutative1.1%
associate--l+38.9%
sub-neg38.9%
metadata-eval38.9%
+-commutative38.9%
sub-neg38.9%
metadata-eval38.9%
+-commutative38.9%
Simplified38.9%
Taylor expanded in l around 0 1.1%
associate--l+38.9%
sub-neg38.9%
metadata-eval38.9%
sub-neg38.9%
metadata-eval38.9%
sub-neg38.9%
metadata-eval38.9%
+-commutative38.9%
associate-+l+1.1%
+-commutative1.1%
+-commutative1.1%
Simplified1.1%
Applied egg-rr34.5%
expm1-def38.9%
expm1-log1p38.9%
+-commutative38.9%
+-commutative38.9%
Simplified38.9%
Final simplification44.2%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l t_m) :precision binary64 (* t_s (pow (/ (+ x 1.0) (+ -1.0 x)) -0.5)))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
return t_s * pow(((x + 1.0) / (-1.0 + x)), -0.5);
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
code = t_s * (((x + 1.0d0) / ((-1.0d0) + x)) ** (-0.5d0))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
return t_s * Math.pow(((x + 1.0) / (-1.0 + x)), -0.5);
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): return t_s * math.pow(((x + 1.0) / (-1.0 + x)), -0.5)
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) return Float64(t_s * (Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5)) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l, t_m) tmp = t_s * (((x + 1.0) / (-1.0 + x)) ^ -0.5); end
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_, t$95$m_] := N[(t$95$s * N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot {\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}
\end{array}
Initial program 36.1%
Simplified36.1%
Taylor expanded in l around 0 43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
*-un-lft-identity43.0%
times-frac43.0%
+-commutative43.0%
Applied egg-rr43.0%
associate-*r/43.0%
lft-mult-inverse43.0%
+-commutative43.0%
Simplified43.0%
expm1-log1p-u43.0%
expm1-udef43.0%
inv-pow43.0%
sqrt-pow243.0%
+-commutative43.0%
+-commutative43.0%
metadata-eval43.0%
Applied egg-rr43.0%
expm1-def43.0%
expm1-log1p43.0%
+-commutative43.0%
+-commutative43.0%
Simplified43.0%
Final simplification43.0%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l t_m) :precision binary64 (* t_s (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
return t_s * sqrt(((-1.0 + x) / (x + 1.0)));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
code = t_s * sqrt((((-1.0d0) + x) / (x + 1.0d0)))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
return t_s * Math.sqrt(((-1.0 + x) / (x + 1.0)));
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): return t_s * math.sqrt(((-1.0 + x) / (x + 1.0)))
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) return Float64(t_s * sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l, t_m) tmp = t_s * sqrt(((-1.0 + x) / (x + 1.0))); end
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_, t$95$m_] := N[(t$95$s * N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \sqrt{\frac{-1 + x}{x + 1}}
\end{array}
Initial program 36.1%
Simplified36.1%
Taylor expanded in l around 0 43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
associate-/r*43.0%
sqrt-undiv43.0%
metadata-eval43.0%
metadata-eval43.0%
metadata-eval43.0%
sqrt-div43.0%
clear-num43.0%
+-commutative43.0%
Applied egg-rr43.0%
Final simplification43.0%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l t_m) :precision binary64 (* t_s (+ 1.0 (/ -1.0 x))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
code = t_s * (1.0d0 + ((-1.0d0) / x))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): return t_s * (1.0 + (-1.0 / x))
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) return Float64(t_s * Float64(1.0 + Float64(-1.0 / x))) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l, t_m) tmp = t_s * (1.0 + (-1.0 / x)); end
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_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
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 36.1%
Simplified36.1%
Taylor expanded in l around 0 43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around inf 43.0%
Final simplification43.0%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l t_m) :precision binary64 (* t_s 1.0))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
return t_s * 1.0;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
code = t_s * 1.0d0
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
return t_s * 1.0;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): return t_s * 1.0
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) return Float64(t_s * 1.0) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l, t_m) tmp = t_s * 1.0; end
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_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot 1
\end{array}
Initial program 36.1%
Simplified36.1%
Taylor expanded in l around 0 43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around inf 42.9%
Final simplification42.9%
herbie shell --seed 2023321
(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)))))