
(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 11 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}
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(* 2.0 (+ (* t t) (/ (* t t) x)))
(/ (fma 2.0 (* t t) (* l l)) x))))))))
(if (<= t -1.6e+28)
(- -1.0 (- (/ 0.5 (* x x)) (/ 1.0 x)))
(if (<= t -1.45e-162)
t_1
(if (<= t 2.7e-206)
(*
t
(* (/ (sqrt 2.0) l) (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x))))))
(if (<= t 1.15e+32) t_1 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma(2.0, (t * t), (l * l)) / x)))));
double tmp;
if (t <= -1.6e+28) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else if (t <= -1.45e-162) {
tmp = t_1;
} else if (t <= 2.7e-206) {
tmp = t * ((sqrt(2.0) / l) * sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))));
} else if (t <= 1.15e+32) {
tmp = t_1;
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x)))))) tmp = 0.0 if (t <= -1.6e+28) tmp = Float64(-1.0 - Float64(Float64(0.5 / Float64(x * x)) - Float64(1.0 / x))); elseif (t <= -1.45e-162) tmp = t_1; elseif (t <= 2.7e-206) tmp = Float64(t * Float64(Float64(sqrt(2.0) / l) * sqrt(Float64(1.0 / Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x)))))); elseif (t <= 1.15e+32) tmp = t_1; else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e+28], N[(-1.0 - N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.45e-162], t$95$1, If[LessEqual[t, 2.7e-206], N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+32], t$95$1, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+28}:\\
\;\;\;\;-1 - \left(\frac{0.5}{x \cdot x} - \frac{1}{x}\right)\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-162}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-206}:\\
\;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}}\right)\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < -1.6e28Initial program 39.3%
associate-*r/39.2%
fma-neg39.2%
remove-double-neg39.2%
fma-neg39.2%
sub-neg39.2%
metadata-eval39.2%
remove-double-neg39.2%
+-commutative39.2%
fma-def39.2%
Simplified39.2%
Applied egg-rr87.1%
Taylor expanded in t around -inf 97.2%
mul-1-neg97.2%
sub-neg97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in x around inf 97.2%
associate--l+97.2%
associate-*r/97.2%
metadata-eval97.2%
unpow297.2%
Simplified97.2%
if -1.6e28 < t < -1.4500000000000001e-162 or 2.7000000000000001e-206 < t < 1.15e32Initial program 39.5%
associate-*l/39.7%
Simplified39.7%
Taylor expanded in x around inf 91.1%
associate--l+91.1%
unpow291.1%
distribute-lft-out91.1%
unpow291.1%
unpow291.1%
associate-*r/91.1%
mul-1-neg91.1%
unpow291.1%
+-commutative91.1%
unpow291.1%
fma-udef91.1%
Simplified91.1%
if -1.4500000000000001e-162 < t < 2.7000000000000001e-206Initial program 3.2%
associate-*l/3.2%
Simplified3.2%
Taylor expanded in l around inf 2.8%
Taylor expanded in x around inf 49.7%
associate-*r/49.7%
metadata-eval49.7%
unpow249.7%
associate-*r/49.7%
metadata-eval49.7%
Simplified49.7%
if 1.15e32 < t Initial program 37.1%
associate-*r/37.0%
fma-neg37.0%
remove-double-neg37.0%
fma-neg37.0%
sub-neg37.0%
metadata-eval37.0%
remove-double-neg37.0%
+-commutative37.0%
fma-def37.0%
Simplified37.0%
Applied egg-rr82.7%
Taylor expanded in t around inf 93.0%
Final simplification86.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x))
(t_2
(*
(sqrt 2.0)
(/ t (sqrt (+ t_1 (+ t_1 (* 2.0 (+ (* t t) (/ (* t t) x))))))))))
(if (<= t -3.7e+25)
(- -1.0 (- (/ 0.5 (* x x)) (/ 1.0 x)))
(if (<= t -2.2e-162)
t_2
(if (<= t 1.25e-201)
(*
t
(* (/ (sqrt 2.0) l) (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x))))))
(if (<= t 1.35e+36) t_2 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = sqrt(2.0) * (t / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
double tmp;
if (t <= -3.7e+25) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else if (t <= -2.2e-162) {
tmp = t_2;
} else if (t <= 1.25e-201) {
tmp = t * ((sqrt(2.0) / l) * sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))));
} else if (t <= 1.35e+36) {
tmp = t_2;
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (l * l) / x
t_2 = sqrt(2.0d0) * (t / sqrt((t_1 + (t_1 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
if (t <= (-3.7d+25)) then
tmp = (-1.0d0) - ((0.5d0 / (x * x)) - (1.0d0 / x))
else if (t <= (-2.2d-162)) then
tmp = t_2
else if (t <= 1.25d-201) then
tmp = t * ((sqrt(2.0d0) / l) * sqrt((1.0d0 / ((2.0d0 / (x * x)) + (2.0d0 / x)))))
else if (t <= 1.35d+36) then
tmp = t_2
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = Math.sqrt(2.0) * (t / Math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
double tmp;
if (t <= -3.7e+25) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else if (t <= -2.2e-162) {
tmp = t_2;
} else if (t <= 1.25e-201) {
tmp = t * ((Math.sqrt(2.0) / l) * Math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))));
} else if (t <= 1.35e+36) {
tmp = t_2;
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (l * l) / x t_2 = math.sqrt(2.0) * (t / math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))) tmp = 0 if t <= -3.7e+25: tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)) elif t <= -2.2e-162: tmp = t_2 elif t <= 1.25e-201: tmp = t * ((math.sqrt(2.0) / l) * math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x))))) elif t <= 1.35e+36: tmp = t_2 else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = Float64(sqrt(2.0) * Float64(t / sqrt(Float64(t_1 + Float64(t_1 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))) tmp = 0.0 if (t <= -3.7e+25) tmp = Float64(-1.0 - Float64(Float64(0.5 / Float64(x * x)) - Float64(1.0 / x))); elseif (t <= -2.2e-162) tmp = t_2; elseif (t <= 1.25e-201) tmp = Float64(t * Float64(Float64(sqrt(2.0) / l) * sqrt(Float64(1.0 / Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x)))))); elseif (t <= 1.35e+36) tmp = t_2; else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (l * l) / x; t_2 = sqrt(2.0) * (t / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))); tmp = 0.0; if (t <= -3.7e+25) tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)); elseif (t <= -2.2e-162) tmp = t_2; elseif (t <= 1.25e-201) tmp = t * ((sqrt(2.0) / l) * sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x))))); elseif (t <= 1.35e+36) tmp = t_2; else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[Sqrt[N[(t$95$1 + N[(t$95$1 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.7e+25], N[(-1.0 - N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.2e-162], t$95$2, If[LessEqual[t, 1.25e-201], N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+36], t$95$2, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := \sqrt{2} \cdot \frac{t}{\sqrt{t_1 + \left(t_1 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{+25}:\\
\;\;\;\;-1 - \left(\frac{0.5}{x \cdot x} - \frac{1}{x}\right)\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{-162}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-201}:\\
\;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}}\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < -3.6999999999999999e25Initial program 39.3%
associate-*r/39.2%
fma-neg39.2%
remove-double-neg39.2%
fma-neg39.2%
sub-neg39.2%
metadata-eval39.2%
remove-double-neg39.2%
+-commutative39.2%
fma-def39.2%
Simplified39.2%
Applied egg-rr87.1%
Taylor expanded in t around -inf 97.2%
mul-1-neg97.2%
sub-neg97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in x around inf 97.2%
associate--l+97.2%
associate-*r/97.2%
metadata-eval97.2%
unpow297.2%
Simplified97.2%
if -3.6999999999999999e25 < t < -2.1999999999999999e-162 or 1.25e-201 < t < 1.35e36Initial program 40.5%
associate-*r/40.3%
fma-neg40.4%
remove-double-neg40.4%
fma-neg40.3%
sub-neg40.3%
metadata-eval40.3%
remove-double-neg40.3%
+-commutative40.3%
fma-def40.3%
Simplified40.3%
Taylor expanded in x around inf 90.6%
associate--l+90.9%
unpow290.9%
distribute-lft-out90.9%
unpow290.9%
unpow290.9%
associate-*r/90.9%
mul-1-neg90.9%
unpow290.9%
+-commutative90.9%
unpow290.9%
fma-udef90.9%
Simplified90.6%
Taylor expanded in t around 0 90.6%
unpow290.6%
associate-*r/90.6%
mul-1-neg90.6%
Simplified90.6%
if -2.1999999999999999e-162 < t < 1.25e-201Initial program 3.2%
associate-*l/3.2%
Simplified3.2%
Taylor expanded in l around inf 2.8%
Taylor expanded in x around inf 49.7%
associate-*r/49.7%
metadata-eval49.7%
unpow249.7%
associate-*r/49.7%
metadata-eval49.7%
Simplified49.7%
if 1.35e36 < t Initial program 37.1%
associate-*r/37.0%
fma-neg37.0%
remove-double-neg37.0%
fma-neg37.0%
sub-neg37.0%
metadata-eval37.0%
remove-double-neg37.0%
+-commutative37.0%
fma-def37.0%
Simplified37.0%
Applied egg-rr82.7%
Taylor expanded in t around inf 93.0%
Final simplification85.9%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(* (/ (sqrt 2.0) l) (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x))))))))
(if (<= t -1.6e-150)
(- -1.0 (- (/ 0.5 (* x x)) (/ 1.0 x)))
(if (<= t -1.5e-194)
t_1
(if (<= t -3e-231)
(+ (/ 1.0 x) -1.0)
(if (<= t 4e-203) t_1 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * ((sqrt(2.0) / l) * sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))));
double tmp;
if (t <= -1.6e-150) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else if (t <= -1.5e-194) {
tmp = t_1;
} else if (t <= -3e-231) {
tmp = (1.0 / x) + -1.0;
} else if (t <= 4e-203) {
tmp = t_1;
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((sqrt(2.0d0) / l) * sqrt((1.0d0 / ((2.0d0 / (x * x)) + (2.0d0 / x)))))
if (t <= (-1.6d-150)) then
tmp = (-1.0d0) - ((0.5d0 / (x * x)) - (1.0d0 / x))
else if (t <= (-1.5d-194)) then
tmp = t_1
else if (t <= (-3d-231)) then
tmp = (1.0d0 / x) + (-1.0d0)
else if (t <= 4d-203) then
tmp = t_1
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = t * ((Math.sqrt(2.0) / l) * Math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))));
double tmp;
if (t <= -1.6e-150) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else if (t <= -1.5e-194) {
tmp = t_1;
} else if (t <= -3e-231) {
tmp = (1.0 / x) + -1.0;
} else if (t <= 4e-203) {
tmp = t_1;
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * ((math.sqrt(2.0) / l) * math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x))))) tmp = 0 if t <= -1.6e-150: tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)) elif t <= -1.5e-194: tmp = t_1 elif t <= -3e-231: tmp = (1.0 / x) + -1.0 elif t <= 4e-203: tmp = t_1 else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(Float64(sqrt(2.0) / l) * sqrt(Float64(1.0 / Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x)))))) tmp = 0.0 if (t <= -1.6e-150) tmp = Float64(-1.0 - Float64(Float64(0.5 / Float64(x * x)) - Float64(1.0 / x))); elseif (t <= -1.5e-194) tmp = t_1; elseif (t <= -3e-231) tmp = Float64(Float64(1.0 / x) + -1.0); elseif (t <= 4e-203) tmp = t_1; else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t * ((sqrt(2.0) / l) * sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x))))); tmp = 0.0; if (t <= -1.6e-150) tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)); elseif (t <= -1.5e-194) tmp = t_1; elseif (t <= -3e-231) tmp = (1.0 / x) + -1.0; elseif (t <= 4e-203) tmp = t_1; else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e-150], N[(-1.0 - N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.5e-194], t$95$1, If[LessEqual[t, -3e-231], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, 4e-203], t$95$1, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}}\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{-150}:\\
\;\;\;\;-1 - \left(\frac{0.5}{x \cdot x} - \frac{1}{x}\right)\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{-194}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3 \cdot 10^{-231}:\\
\;\;\;\;\frac{1}{x} + -1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-203}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < -1.5999999999999999e-150Initial program 40.9%
associate-*r/40.8%
fma-neg40.8%
remove-double-neg40.8%
fma-neg40.8%
sub-neg40.8%
metadata-eval40.8%
remove-double-neg40.8%
+-commutative40.8%
fma-def40.8%
Simplified40.8%
Applied egg-rr73.0%
Taylor expanded in t around -inf 88.2%
mul-1-neg88.2%
sub-neg88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in x around inf 88.2%
associate--l+88.2%
associate-*r/88.2%
metadata-eval88.2%
unpow288.2%
Simplified88.2%
if -1.5999999999999999e-150 < t < -1.5e-194 or -3.0000000000000003e-231 < t < 4.0000000000000001e-203Initial program 4.2%
associate-*l/4.2%
Simplified4.2%
Taylor expanded in l around inf 4.2%
Taylor expanded in x around inf 56.1%
associate-*r/56.1%
metadata-eval56.1%
unpow256.1%
associate-*r/56.1%
metadata-eval56.1%
Simplified56.1%
if -1.5e-194 < t < -3.0000000000000003e-231Initial program 3.0%
associate-*r/3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
+-commutative3.0%
fma-def3.0%
Simplified3.0%
Applied egg-rr41.9%
Taylor expanded in t around -inf 79.3%
mul-1-neg79.3%
sub-neg79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in x around inf 79.3%
if 4.0000000000000001e-203 < t Initial program 38.3%
associate-*r/38.2%
fma-neg38.2%
remove-double-neg38.2%
fma-neg38.2%
sub-neg38.2%
metadata-eval38.2%
remove-double-neg38.2%
+-commutative38.2%
fma-def38.2%
Simplified38.2%
Applied egg-rr68.3%
Taylor expanded in t around inf 86.7%
Final simplification82.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt 2.0) (/ t (sqrt (* 2.0 (* l (/ l x))))))))
(if (<= t -1.55e-150)
(- -1.0 (- (/ 0.5 (* x x)) (/ 1.0 x)))
(if (<= t -1.5e-194)
t_1
(if (<= t -6.5e-233)
(+ (/ 1.0 x) -1.0)
(if (<= t 1.15e-201) t_1 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * (t / sqrt((2.0 * (l * (l / x)))));
double tmp;
if (t <= -1.55e-150) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else if (t <= -1.5e-194) {
tmp = t_1;
} else if (t <= -6.5e-233) {
tmp = (1.0 / x) + -1.0;
} else if (t <= 1.15e-201) {
tmp = t_1;
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(2.0d0) * (t / sqrt((2.0d0 * (l * (l / x)))))
if (t <= (-1.55d-150)) then
tmp = (-1.0d0) - ((0.5d0 / (x * x)) - (1.0d0 / x))
else if (t <= (-1.5d-194)) then
tmp = t_1
else if (t <= (-6.5d-233)) then
tmp = (1.0d0 / x) + (-1.0d0)
else if (t <= 1.15d-201) then
tmp = t_1
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(2.0) * (t / Math.sqrt((2.0 * (l * (l / x)))));
double tmp;
if (t <= -1.55e-150) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else if (t <= -1.5e-194) {
tmp = t_1;
} else if (t <= -6.5e-233) {
tmp = (1.0 / x) + -1.0;
} else if (t <= 1.15e-201) {
tmp = t_1;
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(2.0) * (t / math.sqrt((2.0 * (l * (l / x))))) tmp = 0 if t <= -1.55e-150: tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)) elif t <= -1.5e-194: tmp = t_1 elif t <= -6.5e-233: tmp = (1.0 / x) + -1.0 elif t <= 1.15e-201: tmp = t_1 else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(2.0) * Float64(t / sqrt(Float64(2.0 * Float64(l * Float64(l / x)))))) tmp = 0.0 if (t <= -1.55e-150) tmp = Float64(-1.0 - Float64(Float64(0.5 / Float64(x * x)) - Float64(1.0 / x))); elseif (t <= -1.5e-194) tmp = t_1; elseif (t <= -6.5e-233) tmp = Float64(Float64(1.0 / x) + -1.0); elseif (t <= 1.15e-201) tmp = t_1; else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(2.0) * (t / sqrt((2.0 * (l * (l / x))))); tmp = 0.0; if (t <= -1.55e-150) tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)); elseif (t <= -1.5e-194) tmp = t_1; elseif (t <= -6.5e-233) tmp = (1.0 / x) + -1.0; elseif (t <= 1.15e-201) tmp = t_1; else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[Sqrt[N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e-150], N[(-1.0 - N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.5e-194], t$95$1, If[LessEqual[t, -6.5e-233], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, 1.15e-201], t$95$1, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{-150}:\\
\;\;\;\;-1 - \left(\frac{0.5}{x \cdot x} - \frac{1}{x}\right)\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{-194}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{-233}:\\
\;\;\;\;\frac{1}{x} + -1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-201}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < -1.54999999999999999e-150Initial program 40.9%
associate-*r/40.8%
fma-neg40.8%
remove-double-neg40.8%
fma-neg40.8%
sub-neg40.8%
metadata-eval40.8%
remove-double-neg40.8%
+-commutative40.8%
fma-def40.8%
Simplified40.8%
Applied egg-rr73.0%
Taylor expanded in t around -inf 88.2%
mul-1-neg88.2%
sub-neg88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in x around inf 88.2%
associate--l+88.2%
associate-*r/88.2%
metadata-eval88.2%
unpow288.2%
Simplified88.2%
if -1.54999999999999999e-150 < t < -1.5e-194 or -6.49999999999999989e-233 < t < 1.14999999999999993e-201Initial program 4.2%
associate-*r/4.2%
fma-neg4.2%
remove-double-neg4.2%
fma-neg4.2%
sub-neg4.2%
metadata-eval4.2%
remove-double-neg4.2%
+-commutative4.2%
fma-def4.2%
Simplified4.2%
Taylor expanded in x around inf 65.6%
associate--l+65.6%
unpow265.6%
distribute-lft-out65.6%
unpow265.6%
unpow265.6%
associate-*r/65.6%
mul-1-neg65.6%
unpow265.6%
+-commutative65.6%
unpow265.6%
fma-udef65.6%
Simplified65.6%
Taylor expanded in t around 0 62.9%
cancel-sign-sub-inv62.9%
metadata-eval62.9%
distribute-rgt1-in62.9%
metadata-eval62.9%
unpow262.9%
associate-*l/69.7%
*-commutative69.7%
Simplified69.7%
if -1.5e-194 < t < -6.49999999999999989e-233Initial program 3.0%
associate-*r/3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
+-commutative3.0%
fma-def3.0%
Simplified3.0%
Applied egg-rr41.9%
Taylor expanded in t around -inf 79.3%
mul-1-neg79.3%
sub-neg79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in x around inf 79.3%
if 1.14999999999999993e-201 < t Initial program 38.3%
associate-*r/38.2%
fma-neg38.2%
remove-double-neg38.2%
fma-neg38.2%
sub-neg38.2%
metadata-eval38.2%
remove-double-neg38.2%
+-commutative38.2%
fma-def38.2%
Simplified38.2%
Applied egg-rr68.3%
Taylor expanded in t around inf 86.7%
Final simplification84.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -2.7e-150)
(- -1.0 (- (/ 0.5 (* x x)) (/ 1.0 x)))
(if (<= t -1.5e-194)
(* (sqrt 2.0) (/ t (sqrt (* 2.0 (* l (/ l x))))))
(if (<= t -1.05e-235)
(+ (/ 1.0 x) -1.0)
(if (<= t 1.35e-203)
(* t (* (/ (sqrt 2.0) l) (sqrt (/ 1.0 (/ 2.0 x)))))
(sqrt (/ (+ x -1.0) (+ 1.0 x))))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2.7e-150) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else if (t <= -1.5e-194) {
tmp = sqrt(2.0) * (t / sqrt((2.0 * (l * (l / x)))));
} else if (t <= -1.05e-235) {
tmp = (1.0 / x) + -1.0;
} else if (t <= 1.35e-203) {
tmp = t * ((sqrt(2.0) / l) * sqrt((1.0 / (2.0 / x))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.7d-150)) then
tmp = (-1.0d0) - ((0.5d0 / (x * x)) - (1.0d0 / x))
else if (t <= (-1.5d-194)) then
tmp = sqrt(2.0d0) * (t / sqrt((2.0d0 * (l * (l / x)))))
else if (t <= (-1.05d-235)) then
tmp = (1.0d0 / x) + (-1.0d0)
else if (t <= 1.35d-203) then
tmp = t * ((sqrt(2.0d0) / l) * sqrt((1.0d0 / (2.0d0 / x))))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -2.7e-150) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else if (t <= -1.5e-194) {
tmp = Math.sqrt(2.0) * (t / Math.sqrt((2.0 * (l * (l / x)))));
} else if (t <= -1.05e-235) {
tmp = (1.0 / x) + -1.0;
} else if (t <= 1.35e-203) {
tmp = t * ((Math.sqrt(2.0) / l) * Math.sqrt((1.0 / (2.0 / x))));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -2.7e-150: tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)) elif t <= -1.5e-194: tmp = math.sqrt(2.0) * (t / math.sqrt((2.0 * (l * (l / x))))) elif t <= -1.05e-235: tmp = (1.0 / x) + -1.0 elif t <= 1.35e-203: tmp = t * ((math.sqrt(2.0) / l) * math.sqrt((1.0 / (2.0 / x)))) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -2.7e-150) tmp = Float64(-1.0 - Float64(Float64(0.5 / Float64(x * x)) - Float64(1.0 / x))); elseif (t <= -1.5e-194) tmp = Float64(sqrt(2.0) * Float64(t / sqrt(Float64(2.0 * Float64(l * Float64(l / x)))))); elseif (t <= -1.05e-235) tmp = Float64(Float64(1.0 / x) + -1.0); elseif (t <= 1.35e-203) tmp = Float64(t * Float64(Float64(sqrt(2.0) / l) * sqrt(Float64(1.0 / Float64(2.0 / x))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -2.7e-150) tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)); elseif (t <= -1.5e-194) tmp = sqrt(2.0) * (t / sqrt((2.0 * (l * (l / x))))); elseif (t <= -1.05e-235) tmp = (1.0 / x) + -1.0; elseif (t <= 1.35e-203) tmp = t * ((sqrt(2.0) / l) * sqrt((1.0 / (2.0 / x)))); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -2.7e-150], N[(-1.0 - N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.5e-194], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[Sqrt[N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.05e-235], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, 1.35e-203], N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-150}:\\
\;\;\;\;-1 - \left(\frac{0.5}{x \cdot x} - \frac{1}{x}\right)\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{-194}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{-235}:\\
\;\;\;\;\frac{1}{x} + -1\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-203}:\\
\;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\frac{2}{x}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < -2.7000000000000001e-150Initial program 40.9%
associate-*r/40.8%
fma-neg40.8%
remove-double-neg40.8%
fma-neg40.8%
sub-neg40.8%
metadata-eval40.8%
remove-double-neg40.8%
+-commutative40.8%
fma-def40.8%
Simplified40.8%
Applied egg-rr73.0%
Taylor expanded in t around -inf 88.2%
mul-1-neg88.2%
sub-neg88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in x around inf 88.2%
associate--l+88.2%
associate-*r/88.2%
metadata-eval88.2%
unpow288.2%
Simplified88.2%
if -2.7000000000000001e-150 < t < -1.5e-194Initial program 5.1%
associate-*r/5.1%
fma-neg5.4%
remove-double-neg5.4%
fma-neg5.1%
sub-neg5.1%
metadata-eval5.1%
remove-double-neg5.1%
+-commutative5.1%
fma-def5.1%
Simplified5.1%
Taylor expanded in x around inf 67.0%
associate--l+67.1%
unpow267.1%
distribute-lft-out67.1%
unpow267.1%
unpow267.1%
associate-*r/67.1%
mul-1-neg67.1%
unpow267.1%
+-commutative67.1%
unpow267.1%
fma-udef67.1%
Simplified67.0%
Taylor expanded in t around 0 58.5%
cancel-sign-sub-inv58.5%
metadata-eval58.5%
distribute-rgt1-in58.5%
metadata-eval58.5%
unpow258.5%
associate-*l/81.1%
*-commutative81.1%
Simplified81.1%
if -1.5e-194 < t < -1.05e-235Initial program 3.0%
associate-*r/3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
+-commutative3.0%
fma-def3.0%
Simplified3.0%
Applied egg-rr41.9%
Taylor expanded in t around -inf 79.3%
mul-1-neg79.3%
sub-neg79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in x around inf 79.3%
if -1.05e-235 < t < 1.34999999999999999e-203Initial program 3.8%
associate-*l/3.8%
Simplified3.8%
Taylor expanded in l around inf 3.5%
Taylor expanded in x around inf 50.4%
if 1.34999999999999999e-203 < t Initial program 38.3%
associate-*r/38.2%
fma-neg38.2%
remove-double-neg38.2%
fma-neg38.2%
sub-neg38.2%
metadata-eval38.2%
remove-double-neg38.2%
+-commutative38.2%
fma-def38.2%
Simplified38.2%
Applied egg-rr68.3%
Taylor expanded in t around inf 86.7%
Final simplification83.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (- -1.0 (- (/ 0.5 (* x x)) (/ 1.0 x))) (sqrt (/ (+ x -1.0) (+ 1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (-1.0d0) - ((0.5d0 / (x * x)) - (1.0d0 / x))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 - Float64(Float64(0.5 / Float64(x * x)) - Float64(1.0 / x))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 - ((0.5 / (x * x)) - (1.0 / x)); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 - N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 - \left(\frac{0.5}{x \cdot x} - \frac{1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 32.0%
associate-*r/31.9%
fma-neg31.9%
remove-double-neg31.9%
fma-neg31.9%
sub-neg31.9%
metadata-eval31.9%
remove-double-neg31.9%
+-commutative31.9%
fma-def31.9%
Simplified31.9%
Applied egg-rr63.7%
Taylor expanded in t around -inf 75.4%
mul-1-neg75.4%
sub-neg75.4%
metadata-eval75.4%
Simplified75.4%
Taylor expanded in x around inf 75.4%
associate--l+75.4%
associate-*r/75.4%
metadata-eval75.4%
unpow275.4%
Simplified75.4%
if -4.999999999999985e-310 < t Initial program 33.9%
associate-*r/33.8%
fma-neg33.8%
remove-double-neg33.8%
fma-neg33.8%
sub-neg33.8%
metadata-eval33.8%
remove-double-neg33.8%
+-commutative33.8%
fma-def33.8%
Simplified33.8%
Applied egg-rr63.3%
Taylor expanded in t around inf 79.8%
Final simplification77.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ (/ 1.0 x) -1.0) (+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (1.0d0 / x) + (-1.0d0)
else
tmp = (1.0d0 + (0.5d0 / (x * x))) + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = (1.0 / x) + -1.0 else: tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(Float64(1.0 / x) + -1.0); else tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = (1.0 / x) + -1.0; else tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{x} + -1\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 32.0%
associate-*r/31.9%
fma-neg31.9%
remove-double-neg31.9%
fma-neg31.9%
sub-neg31.9%
metadata-eval31.9%
remove-double-neg31.9%
+-commutative31.9%
fma-def31.9%
Simplified31.9%
Applied egg-rr63.7%
Taylor expanded in t around -inf 75.4%
mul-1-neg75.4%
sub-neg75.4%
metadata-eval75.4%
Simplified75.4%
Taylor expanded in x around inf 75.3%
if -4.999999999999985e-310 < t Initial program 33.9%
associate-*l/34.0%
Simplified34.0%
Taylor expanded in t around inf 32.2%
associate-/l*36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
unpow236.2%
Simplified36.2%
add-sqr-sqrt35.9%
sqrt-prod35.7%
times-frac35.9%
pow1/235.9%
sqrt-pow135.9%
metadata-eval35.9%
pow1/235.9%
sqrt-pow135.9%
metadata-eval35.9%
associate-/r/47.0%
+-commutative47.0%
sqrt-prod47.0%
sqrt-prod78.7%
add-sqr-sqrt78.9%
Applied egg-rr78.9%
associate-*r/78.6%
*-commutative78.6%
metadata-eval78.6%
sub-neg78.6%
+-commutative78.6%
sub-neg78.6%
metadata-eval78.6%
Simplified78.6%
Taylor expanded in x around inf 79.3%
sub-neg79.3%
associate-*r/79.3%
metadata-eval79.3%
unpow279.3%
distribute-neg-frac79.3%
metadata-eval79.3%
Simplified79.3%
Final simplification77.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (let* ((t_1 (/ 0.5 (* x x)))) (if (<= t -5e-310) (- -1.0 (- t_1 (/ 1.0 x))) (+ (+ 1.0 t_1) (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -5e-310) {
tmp = -1.0 - (t_1 - (1.0 / x));
} else {
tmp = (1.0 + t_1) + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (x * x)
if (t <= (-5d-310)) then
tmp = (-1.0d0) - (t_1 - (1.0d0 / x))
else
tmp = (1.0d0 + t_1) + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -5e-310) {
tmp = -1.0 - (t_1 - (1.0 / x));
} else {
tmp = (1.0 + t_1) + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -5e-310: tmp = -1.0 - (t_1 - (1.0 / x)) else: tmp = (1.0 + t_1) + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 - Float64(t_1 - Float64(1.0 / x))); else tmp = Float64(Float64(1.0 + t_1) + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -5e-310) tmp = -1.0 - (t_1 - (1.0 / x)); else tmp = (1.0 + t_1) + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5e-310], N[(-1.0 - N[(t$95$1 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + t$95$1), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 - \left(t_1 - \frac{1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t_1\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 32.0%
associate-*r/31.9%
fma-neg31.9%
remove-double-neg31.9%
fma-neg31.9%
sub-neg31.9%
metadata-eval31.9%
remove-double-neg31.9%
+-commutative31.9%
fma-def31.9%
Simplified31.9%
Applied egg-rr63.7%
Taylor expanded in t around -inf 75.4%
mul-1-neg75.4%
sub-neg75.4%
metadata-eval75.4%
Simplified75.4%
Taylor expanded in x around inf 75.4%
associate--l+75.4%
associate-*r/75.4%
metadata-eval75.4%
unpow275.4%
Simplified75.4%
if -4.999999999999985e-310 < t Initial program 33.9%
associate-*l/34.0%
Simplified34.0%
Taylor expanded in t around inf 32.2%
associate-/l*36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
unpow236.2%
Simplified36.2%
add-sqr-sqrt35.9%
sqrt-prod35.7%
times-frac35.9%
pow1/235.9%
sqrt-pow135.9%
metadata-eval35.9%
pow1/235.9%
sqrt-pow135.9%
metadata-eval35.9%
associate-/r/47.0%
+-commutative47.0%
sqrt-prod47.0%
sqrt-prod78.7%
add-sqr-sqrt78.9%
Applied egg-rr78.9%
associate-*r/78.6%
*-commutative78.6%
metadata-eval78.6%
sub-neg78.6%
+-commutative78.6%
sub-neg78.6%
metadata-eval78.6%
Simplified78.6%
Taylor expanded in x around inf 79.3%
sub-neg79.3%
associate-*r/79.3%
metadata-eval79.3%
unpow279.3%
distribute-neg-frac79.3%
metadata-eval79.3%
Simplified79.3%
Final simplification77.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ (/ 1.0 x) -1.0) (- 1.0 (/ 1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (1.0d0 / x) + (-1.0d0)
else
tmp = 1.0d0 - (1.0d0 / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = (1.0 / x) + -1.0 else: tmp = 1.0 - (1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(Float64(1.0 / x) + -1.0); else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = (1.0 / x) + -1.0; else tmp = 1.0 - (1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{x} + -1\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 32.0%
associate-*r/31.9%
fma-neg31.9%
remove-double-neg31.9%
fma-neg31.9%
sub-neg31.9%
metadata-eval31.9%
remove-double-neg31.9%
+-commutative31.9%
fma-def31.9%
Simplified31.9%
Applied egg-rr63.7%
Taylor expanded in t around -inf 75.4%
mul-1-neg75.4%
sub-neg75.4%
metadata-eval75.4%
Simplified75.4%
Taylor expanded in x around inf 75.3%
if -4.999999999999985e-310 < t Initial program 33.9%
associate-*l/34.0%
Simplified34.0%
Taylor expanded in t around inf 32.2%
associate-/l*36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
unpow236.2%
Simplified36.2%
add-sqr-sqrt35.9%
sqrt-prod35.7%
times-frac35.9%
pow1/235.9%
sqrt-pow135.9%
metadata-eval35.9%
pow1/235.9%
sqrt-pow135.9%
metadata-eval35.9%
associate-/r/47.0%
+-commutative47.0%
sqrt-prod47.0%
sqrt-prod78.7%
add-sqr-sqrt78.9%
Applied egg-rr78.9%
associate-*r/78.6%
*-commutative78.6%
metadata-eval78.6%
sub-neg78.6%
+-commutative78.6%
sub-neg78.6%
metadata-eval78.6%
Simplified78.6%
Taylor expanded in x around inf 79.0%
Final simplification77.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (- 1.0 (/ 1.0 x)))
l = abs(l);
double code(double x, double l, double t) {
return 1.0 - (1.0 / x);
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = 1.0d0 - (1.0d0 / x)
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
return 1.0 - (1.0 / x);
}
l = abs(l) def code(x, l, t): return 1.0 - (1.0 / x)
l = abs(l) function code(x, l, t) return Float64(1.0 - Float64(1.0 / x)) end
l = abs(l) function tmp = code(x, l, t) tmp = 1.0 - (1.0 / x); end
NOTE: l should be positive before calling this function code[x_, l_, t_] := N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
1 - \frac{1}{x}
\end{array}
Initial program 32.9%
associate-*l/32.9%
Simplified32.9%
Taylor expanded in t around inf 30.9%
associate-/l*35.3%
+-commutative35.3%
sub-neg35.3%
metadata-eval35.3%
+-commutative35.3%
unpow235.3%
Simplified35.3%
add-sqr-sqrt35.2%
sqrt-prod35.0%
times-frac35.2%
pow1/235.2%
sqrt-pow135.2%
metadata-eval35.2%
pow1/235.2%
sqrt-pow135.2%
metadata-eval35.2%
associate-/r/44.3%
+-commutative44.3%
sqrt-prod44.3%
sqrt-prod37.2%
add-sqr-sqrt38.2%
Applied egg-rr38.2%
associate-*r/38.1%
*-commutative38.1%
metadata-eval38.1%
sub-neg38.1%
+-commutative38.1%
sub-neg38.1%
metadata-eval38.1%
Simplified38.1%
Taylor expanded in x around inf 38.3%
Final simplification38.3%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 1.0)
l = abs(l);
double code(double x, double l, double t) {
return 1.0;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = 1.0d0
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
return 1.0;
}
l = abs(l) def code(x, l, t): return 1.0
l = abs(l) function code(x, l, t) return 1.0 end
l = abs(l) function tmp = code(x, l, t) tmp = 1.0; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := 1.0
\begin{array}{l}
l = |l|\\
\\
1
\end{array}
Initial program 32.9%
associate-*l/32.9%
Simplified32.9%
Taylor expanded in t around inf 30.9%
associate-/l*35.3%
+-commutative35.3%
sub-neg35.3%
metadata-eval35.3%
+-commutative35.3%
unpow235.3%
Simplified35.3%
Taylor expanded in x around inf 38.0%
Taylor expanded in t around 0 38.1%
Final simplification38.1%
herbie shell --seed 2023224
(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)))))