
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* 2.0 (pow t_m 2.0))) (t_3 (* t_m (sqrt 2.0))))
(*
t_s
(if (<= l_m 6.5e+101)
(sqrt (/ (+ -1.0 x) (+ x 1.0)))
(if (<= l_m 2.1e+140)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(+
(+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 (/ (pow l_m 2.0) x)))
(/ (+ t_2 (pow l_m 2.0)) x)))))
(if (<= l_m 2.8e+215)
(/
t_3
(hypot (* (hypot l_m t_3) (sqrt (/ (+ x 1.0) (+ -1.0 x)))) l_m))
(if (or (<= l_m 6.2e+230) (not (<= l_m 1.3e+251)))
(*
t_m
(*
(/ (sqrt 2.0) l_m)
(sqrt (/ 1.0 (- (/ 1.0 (+ -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 t_2 = 2.0 * pow(t_m, 2.0);
double t_3 = t_m * sqrt(2.0);
double tmp;
if (l_m <= 6.5e+101) {
tmp = sqrt(((-1.0 + x) / (x + 1.0)));
} else if (l_m <= 2.1e+140) {
tmp = sqrt(2.0) * (t_m / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + (pow(l_m, 2.0) / x))) + ((t_2 + pow(l_m, 2.0)) / x))));
} else if (l_m <= 2.8e+215) {
tmp = t_3 / hypot((hypot(l_m, t_3) * sqrt(((x + 1.0) / (-1.0 + x)))), l_m);
} else if ((l_m <= 6.2e+230) || !(l_m <= 1.3e+251)) {
tmp = t_m * ((sqrt(2.0) / l_m) * sqrt((1.0 / ((1.0 / (-1.0 + x)) - (-1.0 / x)))));
} else {
tmp = 1.0;
}
return t_s * tmp;
}
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 = 2.0 * Math.pow(t_m, 2.0);
double t_3 = t_m * Math.sqrt(2.0);
double tmp;
if (l_m <= 6.5e+101) {
tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
} else if (l_m <= 2.1e+140) {
tmp = Math.sqrt(2.0) * (t_m / Math.sqrt((((2.0 * (Math.pow(t_m, 2.0) / x)) + (t_2 + (Math.pow(l_m, 2.0) / x))) + ((t_2 + Math.pow(l_m, 2.0)) / x))));
} else if (l_m <= 2.8e+215) {
tmp = t_3 / Math.hypot((Math.hypot(l_m, t_3) * Math.sqrt(((x + 1.0) / (-1.0 + x)))), l_m);
} else if ((l_m <= 6.2e+230) || !(l_m <= 1.3e+251)) {
tmp = t_m * ((Math.sqrt(2.0) / l_m) * Math.sqrt((1.0 / ((1.0 / (-1.0 + x)) - (-1.0 / x)))));
} else {
tmp = 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 = 2.0 * math.pow(t_m, 2.0) t_3 = t_m * math.sqrt(2.0) tmp = 0 if l_m <= 6.5e+101: tmp = math.sqrt(((-1.0 + x) / (x + 1.0))) elif l_m <= 2.1e+140: tmp = math.sqrt(2.0) * (t_m / math.sqrt((((2.0 * (math.pow(t_m, 2.0) / x)) + (t_2 + (math.pow(l_m, 2.0) / x))) + ((t_2 + math.pow(l_m, 2.0)) / x)))) elif l_m <= 2.8e+215: tmp = t_3 / math.hypot((math.hypot(l_m, t_3) * math.sqrt(((x + 1.0) / (-1.0 + x)))), l_m) elif (l_m <= 6.2e+230) or not (l_m <= 1.3e+251): tmp = t_m * ((math.sqrt(2.0) / l_m) * math.sqrt((1.0 / ((1.0 / (-1.0 + x)) - (-1.0 / x))))) else: tmp = 1.0 return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(2.0 * (t_m ^ 2.0)) t_3 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (l_m <= 6.5e+101) tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))); elseif (l_m <= 2.1e+140) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + Float64((l_m ^ 2.0) / x))) + Float64(Float64(t_2 + (l_m ^ 2.0)) / x))))); elseif (l_m <= 2.8e+215) tmp = Float64(t_3 / hypot(Float64(hypot(l_m, t_3) * sqrt(Float64(Float64(x + 1.0) / Float64(-1.0 + x)))), l_m)); elseif ((l_m <= 6.2e+230) || !(l_m <= 1.3e+251)) tmp = Float64(t_m * Float64(Float64(sqrt(2.0) / l_m) * sqrt(Float64(1.0 / Float64(Float64(1.0 / Float64(-1.0 + x)) - Float64(-1.0 / x)))))); else tmp = 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 = 2.0 * (t_m ^ 2.0); t_3 = t_m * sqrt(2.0); tmp = 0.0; if (l_m <= 6.5e+101) tmp = sqrt(((-1.0 + x) / (x + 1.0))); elseif (l_m <= 2.1e+140) tmp = sqrt(2.0) * (t_m / sqrt((((2.0 * ((t_m ^ 2.0) / x)) + (t_2 + ((l_m ^ 2.0) / x))) + ((t_2 + (l_m ^ 2.0)) / x)))); elseif (l_m <= 2.8e+215) tmp = t_3 / hypot((hypot(l_m, t_3) * sqrt(((x + 1.0) / (-1.0 + x)))), l_m); elseif ((l_m <= 6.2e+230) || ~((l_m <= 1.3e+251))) tmp = t_m * ((sqrt(2.0) / l_m) * sqrt((1.0 / ((1.0 / (-1.0 + x)) - (-1.0 / x))))); else tmp = 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[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 6.5e+101], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 2.1e+140], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 2.8e+215], N[(t$95$3 / N[Sqrt[N[(N[Sqrt[l$95$m ^ 2 + t$95$3 ^ 2], $MachinePrecision] * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2 + l$95$m ^ 2], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l$95$m, 6.2e+230], N[Not[LessEqual[l$95$m, 1.3e+251]], $MachinePrecision]], N[(t$95$m * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(1.0 / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := 2 \cdot {t\_m}^{2}\\
t_3 := t\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 6.5 \cdot 10^{+101}:\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{elif}\;l\_m \leq 2.1 \cdot 10^{+140}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_2 + \frac{{l\_m}^{2}}{x}\right)\right) + \frac{t\_2 + {l\_m}^{2}}{x}}}\\
\mathbf{elif}\;l\_m \leq 2.8 \cdot 10^{+215}:\\
\;\;\;\;\frac{t\_3}{\mathsf{hypot}\left(\mathsf{hypot}\left(l\_m, t\_3\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}, l\_m\right)}\\
\mathbf{elif}\;l\_m \leq 6.2 \cdot 10^{+230} \lor \neg \left(l\_m \leq 1.3 \cdot 10^{+251}\right):\\
\;\;\;\;t\_m \cdot \left(\frac{\sqrt{2}}{l\_m} \cdot \sqrt{\frac{1}{\frac{1}{-1 + x} - \frac{-1}{x}}}\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
\end{array}
if l < 6.50000000000000016e101Initial program 35.0%
Simplified34.9%
Taylor expanded in l around 0 39.2%
associate-*l*39.2%
+-commutative39.2%
sub-neg39.2%
metadata-eval39.2%
+-commutative39.2%
Simplified39.2%
Taylor expanded in t around 0 39.3%
if 6.50000000000000016e101 < l < 2.1000000000000002e140Initial program 2.4%
Simplified2.4%
Taylor expanded in x around inf 85.1%
if 2.1000000000000002e140 < l < 2.8e215Initial program 0.7%
Simplified0.7%
Applied egg-rr80.1%
if 2.8e215 < l < 6.19999999999999963e230 or 1.3000000000000001e251 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.2%
*-commutative9.2%
associate--l+42.9%
sub-neg42.9%
metadata-eval42.9%
+-commutative42.9%
sub-neg42.9%
metadata-eval42.9%
+-commutative42.9%
associate-/l*42.9%
Simplified42.9%
Taylor expanded in x around inf 80.1%
Taylor expanded in t around 0 80.2%
associate-*r/80.1%
associate-*l*92.5%
sub-neg92.5%
metadata-eval92.5%
+-commutative92.5%
Simplified92.5%
if 6.19999999999999963e230 < l < 1.3000000000000001e251Initial program 0.0%
Simplified0.0%
Taylor expanded in l around 0 34.4%
associate-*l*34.4%
+-commutative34.4%
sub-neg34.4%
metadata-eval34.4%
+-commutative34.4%
Simplified34.4%
Taylor expanded in x around inf 34.4%
Final simplification45.4%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* 2.0 (pow t_m 2.0))) (t_3 (+ t_2 (pow l_m 2.0))))
(*
t_s
(if (<= t_m 2.1e-159)
(*
(sqrt 2.0)
(/
t_m
(+
(* 0.5 (/ (+ t_3 t_3) (* t_m (* (sqrt 2.0) x))))
(* t_m (sqrt 2.0)))))
(if (<= t_m 260000.0)
(/
(sqrt t_2)
(sqrt
(+
(+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 (/ (pow l_m 2.0) x)))
(/ t_3 x))))
(sqrt (/ (+ -1.0 x) (+ x 1.0))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = 2.0 * pow(t_m, 2.0);
double t_3 = t_2 + pow(l_m, 2.0);
double tmp;
if (t_m <= 2.1e-159) {
tmp = sqrt(2.0) * (t_m / ((0.5 * ((t_3 + t_3) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
} else if (t_m <= 260000.0) {
tmp = sqrt(t_2) / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + (pow(l_m, 2.0) / x))) + (t_3 / x)));
} else {
tmp = sqrt(((-1.0 + x) / (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) :: t_3
real(8) :: tmp
t_2 = 2.0d0 * (t_m ** 2.0d0)
t_3 = t_2 + (l_m ** 2.0d0)
if (t_m <= 2.1d-159) then
tmp = sqrt(2.0d0) * (t_m / ((0.5d0 * ((t_3 + t_3) / (t_m * (sqrt(2.0d0) * x)))) + (t_m * sqrt(2.0d0))))
else if (t_m <= 260000.0d0) then
tmp = sqrt(t_2) / sqrt((((2.0d0 * ((t_m ** 2.0d0) / x)) + (t_2 + ((l_m ** 2.0d0) / x))) + (t_3 / x)))
else
tmp = sqrt((((-1.0d0) + x) / (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 = 2.0 * Math.pow(t_m, 2.0);
double t_3 = t_2 + Math.pow(l_m, 2.0);
double tmp;
if (t_m <= 2.1e-159) {
tmp = Math.sqrt(2.0) * (t_m / ((0.5 * ((t_3 + t_3) / (t_m * (Math.sqrt(2.0) * x)))) + (t_m * Math.sqrt(2.0))));
} else if (t_m <= 260000.0) {
tmp = Math.sqrt(t_2) / Math.sqrt((((2.0 * (Math.pow(t_m, 2.0) / x)) + (t_2 + (Math.pow(l_m, 2.0) / x))) + (t_3 / x)));
} else {
tmp = Math.sqrt(((-1.0 + x) / (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 = 2.0 * math.pow(t_m, 2.0) t_3 = t_2 + math.pow(l_m, 2.0) tmp = 0 if t_m <= 2.1e-159: tmp = math.sqrt(2.0) * (t_m / ((0.5 * ((t_3 + t_3) / (t_m * (math.sqrt(2.0) * x)))) + (t_m * math.sqrt(2.0)))) elif t_m <= 260000.0: tmp = math.sqrt(t_2) / math.sqrt((((2.0 * (math.pow(t_m, 2.0) / x)) + (t_2 + (math.pow(l_m, 2.0) / x))) + (t_3 / x))) else: tmp = math.sqrt(((-1.0 + x) / (x + 1.0))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(2.0 * (t_m ^ 2.0)) t_3 = Float64(t_2 + (l_m ^ 2.0)) tmp = 0.0 if (t_m <= 2.1e-159) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(0.5 * Float64(Float64(t_3 + t_3) / Float64(t_m * Float64(sqrt(2.0) * x)))) + Float64(t_m * sqrt(2.0))))); elseif (t_m <= 260000.0) tmp = Float64(sqrt(t_2) / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + Float64((l_m ^ 2.0) / x))) + Float64(t_3 / x)))); else tmp = sqrt(Float64(Float64(-1.0 + x) / 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 = 2.0 * (t_m ^ 2.0); t_3 = t_2 + (l_m ^ 2.0); tmp = 0.0; if (t_m <= 2.1e-159) tmp = sqrt(2.0) * (t_m / ((0.5 * ((t_3 + t_3) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0)))); elseif (t_m <= 260000.0) tmp = sqrt(t_2) / sqrt((((2.0 * ((t_m ^ 2.0) / x)) + (t_2 + ((l_m ^ 2.0) / x))) + (t_3 / x))); else tmp = sqrt(((-1.0 + x) / (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[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2.1e-159], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(0.5 * N[(N[(t$95$3 + t$95$3), $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, 260000.0], N[(N[Sqrt[t$95$2], $MachinePrecision] / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(-1.0 + x), $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 := 2 \cdot {t\_m}^{2}\\
t_3 := t\_2 + {l\_m}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.1 \cdot 10^{-159}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{0.5 \cdot \frac{t\_3 + t\_3}{t\_m \cdot \left(\sqrt{2} \cdot x\right)} + t\_m \cdot \sqrt{2}}\\
\mathbf{elif}\;t\_m \leq 260000:\\
\;\;\;\;\frac{\sqrt{t\_2}}{\sqrt{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_2 + \frac{{l\_m}^{2}}{x}\right)\right) + \frac{t\_3}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 2.0999999999999999e-159Initial program 27.0%
Simplified27.0%
Taylor expanded in x around inf 17.1%
if 2.0999999999999999e-159 < t < 2.6e5Initial program 37.7%
add-sqr-sqrt37.5%
sqrt-prod37.7%
sqrt-prod38.0%
pow1/238.0%
pow238.0%
Applied egg-rr38.0%
unpow1/238.0%
Simplified38.0%
Taylor expanded in x around inf 89.4%
if 2.6e5 < t Initial program 34.5%
Simplified34.4%
Taylor expanded in l around 0 93.9%
associate-*l*93.9%
+-commutative93.9%
sub-neg93.9%
metadata-eval93.9%
+-commutative93.9%
Simplified93.9%
Taylor expanded in t around 0 94.1%
Final simplification43.6%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* 2.0 (pow t_m 2.0))) (t_3 (+ t_2 (pow l_m 2.0))))
(*
t_s
(if (<= t_m 8.8e-159)
(*
(sqrt 2.0)
(/
t_m
(+
(* 0.5 (/ (+ t_3 t_3) (* t_m (* (sqrt 2.0) x))))
(* t_m (sqrt 2.0)))))
(if (<= t_m 660000.0)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(+
(+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 (/ (pow l_m 2.0) x)))
(/ t_3 x)))))
(sqrt (/ (+ -1.0 x) (+ x 1.0))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = 2.0 * pow(t_m, 2.0);
double t_3 = t_2 + pow(l_m, 2.0);
double tmp;
if (t_m <= 8.8e-159) {
tmp = sqrt(2.0) * (t_m / ((0.5 * ((t_3 + t_3) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
} else if (t_m <= 660000.0) {
tmp = sqrt(2.0) * (t_m / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + (pow(l_m, 2.0) / x))) + (t_3 / x))));
} else {
tmp = sqrt(((-1.0 + x) / (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) :: t_3
real(8) :: tmp
t_2 = 2.0d0 * (t_m ** 2.0d0)
t_3 = t_2 + (l_m ** 2.0d0)
if (t_m <= 8.8d-159) then
tmp = sqrt(2.0d0) * (t_m / ((0.5d0 * ((t_3 + t_3) / (t_m * (sqrt(2.0d0) * x)))) + (t_m * sqrt(2.0d0))))
else if (t_m <= 660000.0d0) then
tmp = sqrt(2.0d0) * (t_m / sqrt((((2.0d0 * ((t_m ** 2.0d0) / x)) + (t_2 + ((l_m ** 2.0d0) / x))) + (t_3 / x))))
else
tmp = sqrt((((-1.0d0) + x) / (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 = 2.0 * Math.pow(t_m, 2.0);
double t_3 = t_2 + Math.pow(l_m, 2.0);
double tmp;
if (t_m <= 8.8e-159) {
tmp = Math.sqrt(2.0) * (t_m / ((0.5 * ((t_3 + t_3) / (t_m * (Math.sqrt(2.0) * x)))) + (t_m * Math.sqrt(2.0))));
} else if (t_m <= 660000.0) {
tmp = Math.sqrt(2.0) * (t_m / Math.sqrt((((2.0 * (Math.pow(t_m, 2.0) / x)) + (t_2 + (Math.pow(l_m, 2.0) / x))) + (t_3 / x))));
} else {
tmp = Math.sqrt(((-1.0 + x) / (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 = 2.0 * math.pow(t_m, 2.0) t_3 = t_2 + math.pow(l_m, 2.0) tmp = 0 if t_m <= 8.8e-159: tmp = math.sqrt(2.0) * (t_m / ((0.5 * ((t_3 + t_3) / (t_m * (math.sqrt(2.0) * x)))) + (t_m * math.sqrt(2.0)))) elif t_m <= 660000.0: tmp = math.sqrt(2.0) * (t_m / math.sqrt((((2.0 * (math.pow(t_m, 2.0) / x)) + (t_2 + (math.pow(l_m, 2.0) / x))) + (t_3 / x)))) else: tmp = math.sqrt(((-1.0 + x) / (x + 1.0))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(2.0 * (t_m ^ 2.0)) t_3 = Float64(t_2 + (l_m ^ 2.0)) tmp = 0.0 if (t_m <= 8.8e-159) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(0.5 * Float64(Float64(t_3 + t_3) / Float64(t_m * Float64(sqrt(2.0) * x)))) + Float64(t_m * sqrt(2.0))))); elseif (t_m <= 660000.0) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + Float64((l_m ^ 2.0) / x))) + Float64(t_3 / x))))); else tmp = sqrt(Float64(Float64(-1.0 + x) / 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 = 2.0 * (t_m ^ 2.0); t_3 = t_2 + (l_m ^ 2.0); tmp = 0.0; if (t_m <= 8.8e-159) tmp = sqrt(2.0) * (t_m / ((0.5 * ((t_3 + t_3) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0)))); elseif (t_m <= 660000.0) tmp = sqrt(2.0) * (t_m / sqrt((((2.0 * ((t_m ^ 2.0) / x)) + (t_2 + ((l_m ^ 2.0) / x))) + (t_3 / x)))); else tmp = sqrt(((-1.0 + x) / (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[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 8.8e-159], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(0.5 * N[(N[(t$95$3 + t$95$3), $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, 660000.0], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(-1.0 + x), $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 := 2 \cdot {t\_m}^{2}\\
t_3 := t\_2 + {l\_m}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 8.8 \cdot 10^{-159}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{0.5 \cdot \frac{t\_3 + t\_3}{t\_m \cdot \left(\sqrt{2} \cdot x\right)} + t\_m \cdot \sqrt{2}}\\
\mathbf{elif}\;t\_m \leq 660000:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_2 + \frac{{l\_m}^{2}}{x}\right)\right) + \frac{t\_3}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 8.8e-159Initial program 27.0%
Simplified27.0%
Taylor expanded in x around inf 17.1%
if 8.8e-159 < t < 6.6e5Initial program 37.7%
Simplified37.6%
Taylor expanded in x around inf 89.8%
if 6.6e5 < t Initial program 34.5%
Simplified34.4%
Taylor expanded in l around 0 93.9%
associate-*l*93.9%
+-commutative93.9%
sub-neg93.9%
metadata-eval93.9%
+-commutative93.9%
Simplified93.9%
Taylor expanded in t around 0 94.1%
Final simplification43.7%
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_3 (+ 1.0 (/ (+ -1.0 (/ 0.5 x)) x))))
(*
t_s
(if (<= l_m 1e+103)
t_3
(if (<= l_m 7e+147)
t_2
(if (<= l_m 2.1e+215)
t_3
(if (or (<= l_m 6.2e+230) (not (<= l_m 1.3e+251))) t_2 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 t_3 = 1.0 + ((-1.0 + (0.5 / x)) / x);
double tmp;
if (l_m <= 1e+103) {
tmp = t_3;
} else if (l_m <= 7e+147) {
tmp = t_2;
} else if (l_m <= 2.1e+215) {
tmp = t_3;
} else if ((l_m <= 6.2e+230) || !(l_m <= 1.3e+251)) {
tmp = t_2;
} else {
tmp = 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) :: t_3
real(8) :: tmp
t_2 = t_m * (sqrt(x) / l_m)
t_3 = 1.0d0 + (((-1.0d0) + (0.5d0 / x)) / x)
if (l_m <= 1d+103) then
tmp = t_3
else if (l_m <= 7d+147) then
tmp = t_2
else if (l_m <= 2.1d+215) then
tmp = t_3
else if ((l_m <= 6.2d+230) .or. (.not. (l_m <= 1.3d+251))) then
tmp = t_2
else
tmp = 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 t_3 = 1.0 + ((-1.0 + (0.5 / x)) / x);
double tmp;
if (l_m <= 1e+103) {
tmp = t_3;
} else if (l_m <= 7e+147) {
tmp = t_2;
} else if (l_m <= 2.1e+215) {
tmp = t_3;
} else if ((l_m <= 6.2e+230) || !(l_m <= 1.3e+251)) {
tmp = t_2;
} else {
tmp = 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) t_3 = 1.0 + ((-1.0 + (0.5 / x)) / x) tmp = 0 if l_m <= 1e+103: tmp = t_3 elif l_m <= 7e+147: tmp = t_2 elif l_m <= 2.1e+215: tmp = t_3 elif (l_m <= 6.2e+230) or not (l_m <= 1.3e+251): tmp = t_2 else: tmp = 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(t_m * Float64(sqrt(x) / l_m)) t_3 = Float64(1.0 + Float64(Float64(-1.0 + Float64(0.5 / x)) / x)) tmp = 0.0 if (l_m <= 1e+103) tmp = t_3; elseif (l_m <= 7e+147) tmp = t_2; elseif (l_m <= 2.1e+215) tmp = t_3; elseif ((l_m <= 6.2e+230) || !(l_m <= 1.3e+251)) tmp = t_2; else tmp = 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); t_3 = 1.0 + ((-1.0 + (0.5 / x)) / x); tmp = 0.0; if (l_m <= 1e+103) tmp = t_3; elseif (l_m <= 7e+147) tmp = t_2; elseif (l_m <= 2.1e+215) tmp = t_3; elseif ((l_m <= 6.2e+230) || ~((l_m <= 1.3e+251))) tmp = t_2; else tmp = 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[(t$95$m * N[(N[Sqrt[x], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(N[(-1.0 + N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 1e+103], t$95$3, If[LessEqual[l$95$m, 7e+147], t$95$2, If[LessEqual[l$95$m, 2.1e+215], t$95$3, If[Or[LessEqual[l$95$m, 6.2e+230], N[Not[LessEqual[l$95$m, 1.3e+251]], $MachinePrecision]], t$95$2, 1.0]]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := t\_m \cdot \frac{\sqrt{x}}{l\_m}\\
t_3 := 1 + \frac{-1 + \frac{0.5}{x}}{x}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 10^{+103}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;l\_m \leq 7 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;l\_m \leq 2.1 \cdot 10^{+215}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;l\_m \leq 6.2 \cdot 10^{+230} \lor \neg \left(l\_m \leq 1.3 \cdot 10^{+251}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
\end{array}
if l < 1e103 or 6.99999999999999949e147 < l < 2.1000000000000002e215Initial program 33.0%
Simplified33.0%
Taylor expanded in l around 0 38.8%
associate-*l*38.8%
+-commutative38.8%
sub-neg38.8%
metadata-eval38.8%
+-commutative38.8%
Simplified38.8%
Taylor expanded in t around 0 38.9%
Taylor expanded in x around inf 38.6%
associate--l+38.6%
unpow238.6%
associate-/r*38.6%
metadata-eval38.6%
metadata-eval38.6%
metadata-eval38.6%
rem-square-sqrt0.0%
unpow20.0%
associate-*l/0.0%
*-commutative0.0%
div-sub0.0%
Simplified38.6%
if 1e103 < l < 6.99999999999999949e147 or 2.1000000000000002e215 < l < 6.19999999999999963e230 or 1.3000000000000001e251 < l Initial program 1.0%
Simplified1.0%
Taylor expanded in l around inf 6.6%
*-commutative6.6%
associate--l+31.4%
sub-neg31.4%
metadata-eval31.4%
+-commutative31.4%
sub-neg31.4%
metadata-eval31.4%
+-commutative31.4%
associate-/l*31.4%
Simplified31.4%
Taylor expanded in x around inf 66.3%
associate-*l/81.1%
sqrt-unprod81.3%
metadata-eval81.3%
metadata-eval81.3%
*-commutative81.3%
*-un-lft-identity81.3%
Applied egg-rr81.3%
associate-/l*81.8%
Simplified81.8%
if 6.19999999999999963e230 < l < 1.3000000000000001e251Initial program 0.0%
Simplified0.0%
Taylor expanded in l around 0 34.4%
associate-*l*34.4%
+-commutative34.4%
sub-neg34.4%
metadata-eval34.4%
+-commutative34.4%
Simplified34.4%
Taylor expanded in x around inf 34.4%
Final simplification42.1%
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_3 (+ 1.0 (/ (+ -1.0 (/ 0.5 x)) x))))
(*
t_s
(if (<= l_m 5.8e+101)
t_3
(if (<= l_m 2e+148)
t_2
(if (<= l_m 2.3e+215)
t_3
(if (<= l_m 4.6e+231)
(/ (* t_m (sqrt x)) l_m)
(if (<= l_m 1.25e+251) 1.0 t_2))))))))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 t_3 = 1.0 + ((-1.0 + (0.5 / x)) / x);
double tmp;
if (l_m <= 5.8e+101) {
tmp = t_3;
} else if (l_m <= 2e+148) {
tmp = t_2;
} else if (l_m <= 2.3e+215) {
tmp = t_3;
} else if (l_m <= 4.6e+231) {
tmp = (t_m * sqrt(x)) / l_m;
} else if (l_m <= 1.25e+251) {
tmp = 1.0;
} else {
tmp = t_2;
}
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) :: t_3
real(8) :: tmp
t_2 = t_m * (sqrt(x) / l_m)
t_3 = 1.0d0 + (((-1.0d0) + (0.5d0 / x)) / x)
if (l_m <= 5.8d+101) then
tmp = t_3
else if (l_m <= 2d+148) then
tmp = t_2
else if (l_m <= 2.3d+215) then
tmp = t_3
else if (l_m <= 4.6d+231) then
tmp = (t_m * sqrt(x)) / l_m
else if (l_m <= 1.25d+251) then
tmp = 1.0d0
else
tmp = t_2
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 t_3 = 1.0 + ((-1.0 + (0.5 / x)) / x);
double tmp;
if (l_m <= 5.8e+101) {
tmp = t_3;
} else if (l_m <= 2e+148) {
tmp = t_2;
} else if (l_m <= 2.3e+215) {
tmp = t_3;
} else if (l_m <= 4.6e+231) {
tmp = (t_m * Math.sqrt(x)) / l_m;
} else if (l_m <= 1.25e+251) {
tmp = 1.0;
} else {
tmp = t_2;
}
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) t_3 = 1.0 + ((-1.0 + (0.5 / x)) / x) tmp = 0 if l_m <= 5.8e+101: tmp = t_3 elif l_m <= 2e+148: tmp = t_2 elif l_m <= 2.3e+215: tmp = t_3 elif l_m <= 4.6e+231: tmp = (t_m * math.sqrt(x)) / l_m elif l_m <= 1.25e+251: tmp = 1.0 else: tmp = t_2 return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(t_m * Float64(sqrt(x) / l_m)) t_3 = Float64(1.0 + Float64(Float64(-1.0 + Float64(0.5 / x)) / x)) tmp = 0.0 if (l_m <= 5.8e+101) tmp = t_3; elseif (l_m <= 2e+148) tmp = t_2; elseif (l_m <= 2.3e+215) tmp = t_3; elseif (l_m <= 4.6e+231) tmp = Float64(Float64(t_m * sqrt(x)) / l_m); elseif (l_m <= 1.25e+251) tmp = 1.0; else tmp = t_2; 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); t_3 = 1.0 + ((-1.0 + (0.5 / x)) / x); tmp = 0.0; if (l_m <= 5.8e+101) tmp = t_3; elseif (l_m <= 2e+148) tmp = t_2; elseif (l_m <= 2.3e+215) tmp = t_3; elseif (l_m <= 4.6e+231) tmp = (t_m * sqrt(x)) / l_m; elseif (l_m <= 1.25e+251) tmp = 1.0; else tmp = t_2; 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[(t$95$m * N[(N[Sqrt[x], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(N[(-1.0 + N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 5.8e+101], t$95$3, If[LessEqual[l$95$m, 2e+148], t$95$2, If[LessEqual[l$95$m, 2.3e+215], t$95$3, If[LessEqual[l$95$m, 4.6e+231], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[l$95$m, 1.25e+251], 1.0, t$95$2]]]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := t\_m \cdot \frac{\sqrt{x}}{l\_m}\\
t_3 := 1 + \frac{-1 + \frac{0.5}{x}}{x}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 5.8 \cdot 10^{+101}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;l\_m \leq 2 \cdot 10^{+148}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;l\_m \leq 2.3 \cdot 10^{+215}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;l\_m \leq 4.6 \cdot 10^{+231}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{l\_m}\\
\mathbf{elif}\;l\_m \leq 1.25 \cdot 10^{+251}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if l < 5.79999999999999974e101 or 2.0000000000000001e148 < l < 2.3000000000000001e215Initial program 33.0%
Simplified33.0%
Taylor expanded in l around 0 38.8%
associate-*l*38.8%
+-commutative38.8%
sub-neg38.8%
metadata-eval38.8%
+-commutative38.8%
Simplified38.8%
Taylor expanded in t around 0 38.9%
Taylor expanded in x around inf 38.6%
associate--l+38.6%
unpow238.6%
associate-/r*38.6%
metadata-eval38.6%
metadata-eval38.6%
metadata-eval38.6%
rem-square-sqrt0.0%
unpow20.0%
associate-*l/0.0%
*-commutative0.0%
div-sub0.0%
Simplified38.6%
if 5.79999999999999974e101 < l < 2.0000000000000001e148 or 1.2500000000000001e251 < l Initial program 1.2%
Simplified1.2%
Taylor expanded in l around inf 7.6%
*-commutative7.6%
associate--l+34.1%
sub-neg34.1%
metadata-eval34.1%
+-commutative34.1%
sub-neg34.1%
metadata-eval34.1%
+-commutative34.1%
associate-/l*34.1%
Simplified34.1%
Taylor expanded in x around inf 62.6%
associate-*l/76.6%
sqrt-unprod77.1%
metadata-eval77.1%
metadata-eval77.1%
*-commutative77.1%
*-un-lft-identity77.1%
Applied egg-rr77.1%
associate-/l*77.8%
Simplified77.8%
if 2.3000000000000001e215 < l < 4.59999999999999998e231Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 2.1%
*-commutative2.1%
associate--l+20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
associate-/l*20.3%
Simplified20.3%
Taylor expanded in x around inf 81.7%
associate-*l/100.0%
sqrt-unprod99.2%
metadata-eval99.2%
metadata-eval99.2%
*-commutative99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
if 4.59999999999999998e231 < l < 1.2500000000000001e251Initial program 0.0%
Simplified0.0%
Taylor expanded in l around 0 34.4%
associate-*l*34.4%
+-commutative34.4%
sub-neg34.4%
metadata-eval34.4%
+-commutative34.4%
Simplified34.4%
Taylor expanded in x around inf 34.4%
Final simplification42.1%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= (* l_m l_m) 2e+202)
(sqrt (/ (+ -1.0 x) (+ x 1.0)))
(* t_m (/ (sqrt x) l_m)))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if ((l_m * l_m) <= 2e+202) {
tmp = sqrt(((-1.0 + x) / (x + 1.0)));
} else {
tmp = t_m * (sqrt(x) / l_m);
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if ((l_m * l_m) <= 2d+202) then
tmp = sqrt((((-1.0d0) + x) / (x + 1.0d0)))
else
tmp = t_m * (sqrt(x) / l_m)
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if ((l_m * l_m) <= 2e+202) {
tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
} else {
tmp = t_m * (Math.sqrt(x) / l_m);
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if (l_m * l_m) <= 2e+202: tmp = math.sqrt(((-1.0 + x) / (x + 1.0))) else: tmp = t_m * (math.sqrt(x) / l_m) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (Float64(l_m * l_m) <= 2e+202) tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))); else tmp = Float64(t_m * Float64(sqrt(x) / l_m)); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if ((l_m * l_m) <= 2e+202) tmp = sqrt(((-1.0 + x) / (x + 1.0))); else tmp = t_m * (sqrt(x) / l_m); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e+202], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[Sqrt[x], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 2 \cdot 10^{+202}:\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{x}}{l\_m}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.9999999999999998e202Initial program 41.3%
Simplified41.2%
Taylor expanded in l around 0 44.6%
associate-*l*44.6%
+-commutative44.6%
sub-neg44.6%
metadata-eval44.6%
+-commutative44.6%
Simplified44.6%
Taylor expanded in t around 0 44.7%
if 1.9999999999999998e202 < (*.f64 l l) Initial program 0.6%
Simplified0.6%
Taylor expanded in l around inf 4.0%
*-commutative4.0%
associate--l+21.4%
sub-neg21.4%
metadata-eval21.4%
+-commutative21.4%
sub-neg21.4%
metadata-eval21.4%
+-commutative21.4%
associate-/l*21.4%
Simplified21.4%
Taylor expanded in x around inf 34.0%
associate-*l/38.2%
sqrt-unprod38.3%
metadata-eval38.3%
metadata-eval38.3%
*-commutative38.3%
*-un-lft-identity38.3%
Applied egg-rr38.3%
associate-/l*38.5%
Simplified38.5%
Final simplification43.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 30.0%
Simplified30.0%
Taylor expanded in l around 0 36.5%
associate-*l*36.5%
+-commutative36.5%
sub-neg36.5%
metadata-eval36.5%
+-commutative36.5%
Simplified36.5%
Taylor expanded in t around 0 36.6%
Taylor expanded in x around inf 36.3%
associate--l+36.3%
unpow236.3%
associate-/r*36.3%
metadata-eval36.3%
metadata-eval36.3%
metadata-eval36.3%
rem-square-sqrt0.0%
unpow20.0%
associate-*l/0.0%
*-commutative0.0%
div-sub0.0%
Simplified36.3%
Final simplification36.3%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (+ 1.0 (/ -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 30.0%
Simplified30.0%
Taylor expanded in l around 0 36.5%
associate-*l*36.5%
+-commutative36.5%
sub-neg36.5%
metadata-eval36.5%
+-commutative36.5%
Simplified36.5%
Taylor expanded in x around inf 36.1%
Final simplification36.1%
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 30.0%
Simplified30.0%
Taylor expanded in l around 0 36.5%
associate-*l*36.5%
+-commutative36.5%
sub-neg36.5%
metadata-eval36.5%
+-commutative36.5%
Simplified36.5%
Taylor expanded in x around inf 35.7%
Final simplification35.7%
herbie shell --seed 2024059
(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)))))