
(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 12 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}
(FPCore (x l t)
:precision binary64
(if (<= t -1.8e+127)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 1.15e+37)
(*
t
(/
(sqrt 2.0)
(sqrt (+ (* 2.0 (* t (+ t (/ t x)))) (* (/ l x) (+ l l))))))
(+ 1.0 (/ -1.0 x)))))
double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e+127) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.15e+37) {
tmp = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + ((l / x) * (l + l)))));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
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 <= (-1.8d+127)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 1.15d+37) then
tmp = t * (sqrt(2.0d0) / sqrt(((2.0d0 * (t * (t + (t / x)))) + ((l / x) * (l + l)))))
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e+127) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.15e+37) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt(((2.0 * (t * (t + (t / x)))) + ((l / x) * (l + l)))));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1.8e+127: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 1.15e+37: tmp = t * (math.sqrt(2.0) / math.sqrt(((2.0 * (t * (t + (t / x)))) + ((l / x) * (l + l))))) else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -1.8e+127) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 1.15e+37) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(Float64(l / x) * Float64(l + l)))))); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1.8e+127) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 1.15e+37) tmp = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + ((l / x) * (l + l))))); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -1.8e+127], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.15e+37], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(l / x), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+127}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+37}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{x} \cdot \left(\ell + \ell\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.79999999999999989e127Initial program 14.9%
associate-*r/14.9%
fma-neg14.9%
sub-neg14.9%
metadata-eval14.9%
+-commutative14.9%
fma-def14.9%
distribute-rgt-neg-in14.9%
Simplified14.9%
Applied egg-rr88.2%
Taylor expanded in t around -inf 98.0%
mul-1-neg98.0%
sub-neg98.0%
metadata-eval98.0%
+-commutative98.0%
Simplified98.0%
if -1.79999999999999989e127 < t < 1.15000000000000001e37Initial program 34.1%
associate-*l/34.1%
Simplified34.1%
Taylor expanded in x around inf 61.7%
associate--l+61.7%
unpow261.7%
distribute-lft-out61.7%
unpow261.7%
unpow261.7%
associate-*r/61.7%
mul-1-neg61.7%
+-commutative61.7%
unpow261.7%
associate-*l*61.7%
unpow261.7%
fma-udef61.7%
Simplified61.7%
Taylor expanded in t around 0 61.7%
associate-*r/61.7%
mul-1-neg61.7%
unpow261.7%
distribute-rgt-neg-out61.7%
Simplified61.7%
expm1-log1p-u60.6%
expm1-udef33.0%
Applied egg-rr45.9%
expm1-def73.5%
expm1-log1p75.6%
+-commutative75.6%
associate-/r/75.6%
remove-double-neg75.6%
distribute-rgt-neg-in75.6%
associate-/r/75.6%
sub-neg75.6%
associate-+l+75.6%
fma-udef75.6%
associate-/r/75.6%
distribute-rgt-out75.6%
Simplified75.6%
if 1.15000000000000001e37 < t Initial program 38.8%
associate-*r/38.8%
fma-neg38.8%
sub-neg38.8%
metadata-eval38.8%
+-commutative38.8%
fma-def38.8%
distribute-rgt-neg-in38.8%
Simplified38.8%
Applied egg-rr85.2%
Taylor expanded in l around 0 97.0%
Taylor expanded in x around inf 97.0%
Final simplification84.8%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -1.35e-276)
(- t_1)
(if (<= t 7.2e-149)
(* (sqrt 2.0) (* t (sqrt (/ x (* l (+ l l))))))
t_1))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.35e-276) {
tmp = -t_1;
} else if (t <= 7.2e-149) {
tmp = sqrt(2.0) * (t * sqrt((x / (l * (l + l)))));
} else {
tmp = t_1;
}
return tmp;
}
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(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-1.35d-276)) then
tmp = -t_1
else if (t <= 7.2d-149) then
tmp = sqrt(2.0d0) * (t * sqrt((x / (l * (l + l)))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.35e-276) {
tmp = -t_1;
} else if (t <= 7.2e-149) {
tmp = Math.sqrt(2.0) * (t * Math.sqrt((x / (l * (l + l)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -1.35e-276: tmp = -t_1 elif t <= 7.2e-149: tmp = math.sqrt(2.0) * (t * math.sqrt((x / (l * (l + l))))) else: tmp = t_1 return tmp
function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -1.35e-276) tmp = Float64(-t_1); elseif (t <= 7.2e-149) tmp = Float64(sqrt(2.0) * Float64(t * sqrt(Float64(x / Float64(l * Float64(l + l)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -1.35e-276) tmp = -t_1; elseif (t <= 7.2e-149) tmp = sqrt(2.0) * (t * sqrt((x / (l * (l + l))))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.35e-276], (-t$95$1), If[LessEqual[t, 7.2e-149], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[Sqrt[N[(x / N[(l * N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-276}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-149}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x}{\ell \cdot \left(\ell + \ell\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.34999999999999993e-276Initial program 29.1%
associate-*r/29.1%
fma-neg29.1%
sub-neg29.1%
metadata-eval29.1%
+-commutative29.1%
fma-def29.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
Applied egg-rr65.3%
Taylor expanded in t around -inf 76.2%
mul-1-neg76.2%
sub-neg76.2%
metadata-eval76.2%
+-commutative76.2%
Simplified76.2%
if -1.34999999999999993e-276 < t < 7.2000000000000004e-149Initial program 6.8%
associate-/l*6.8%
fma-neg6.8%
remove-double-neg6.8%
fma-neg6.8%
sub-neg6.8%
metadata-eval6.8%
remove-double-neg6.8%
fma-def6.8%
Simplified6.8%
Taylor expanded in t around 0 10.0%
associate-*l/10.0%
*-lft-identity10.0%
*-commutative10.0%
unpow210.0%
+-commutative10.0%
sub-neg10.0%
metadata-eval10.0%
+-commutative10.0%
unpow210.0%
Simplified10.0%
Taylor expanded in x around inf 54.3%
unpow254.3%
neg-mul-154.3%
unpow254.3%
distribute-rgt-neg-in54.3%
Simplified54.3%
Taylor expanded in t around 0 54.3%
associate-*l*54.2%
cancel-sign-sub-inv54.2%
unpow254.2%
metadata-eval54.2%
*-lft-identity54.2%
unpow254.2%
distribute-lft-in54.2%
Simplified54.2%
if 7.2000000000000004e-149 < t Initial program 42.1%
associate-*r/42.1%
fma-neg42.1%
sub-neg42.1%
metadata-eval42.1%
+-commutative42.1%
fma-def42.1%
distribute-rgt-neg-in42.1%
Simplified42.1%
Applied egg-rr68.5%
Taylor expanded in l around 0 81.7%
Final simplification75.8%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -7.5e-277)
(- t_1)
(if (<= t 2.4e-130)
(* (* t (sqrt 2.0)) (sqrt (/ (/ x l) (+ l l))))
t_1))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -7.5e-277) {
tmp = -t_1;
} else if (t <= 2.4e-130) {
tmp = (t * sqrt(2.0)) * sqrt(((x / l) / (l + l)));
} else {
tmp = t_1;
}
return tmp;
}
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(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-7.5d-277)) then
tmp = -t_1
else if (t <= 2.4d-130) then
tmp = (t * sqrt(2.0d0)) * sqrt(((x / l) / (l + l)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -7.5e-277) {
tmp = -t_1;
} else if (t <= 2.4e-130) {
tmp = (t * Math.sqrt(2.0)) * Math.sqrt(((x / l) / (l + l)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -7.5e-277: tmp = -t_1 elif t <= 2.4e-130: tmp = (t * math.sqrt(2.0)) * math.sqrt(((x / l) / (l + l))) else: tmp = t_1 return tmp
function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -7.5e-277) tmp = Float64(-t_1); elseif (t <= 2.4e-130) tmp = Float64(Float64(t * sqrt(2.0)) * sqrt(Float64(Float64(x / l) / Float64(l + l)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -7.5e-277) tmp = -t_1; elseif (t <= 2.4e-130) tmp = (t * sqrt(2.0)) * sqrt(((x / l) / (l + l))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -7.5e-277], (-t$95$1), If[LessEqual[t, 2.4e-130], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(x / l), $MachinePrecision] / N[(l + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-277}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-130}:\\
\;\;\;\;\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\frac{x}{\ell}}{\ell + \ell}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -7.49999999999999971e-277Initial program 29.1%
associate-*r/29.1%
fma-neg29.1%
sub-neg29.1%
metadata-eval29.1%
+-commutative29.1%
fma-def29.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
Applied egg-rr65.3%
Taylor expanded in t around -inf 76.2%
mul-1-neg76.2%
sub-neg76.2%
metadata-eval76.2%
+-commutative76.2%
Simplified76.2%
if -7.49999999999999971e-277 < t < 2.39999999999999997e-130Initial program 9.3%
associate-/l*9.3%
fma-neg9.3%
remove-double-neg9.3%
fma-neg9.3%
sub-neg9.3%
metadata-eval9.3%
remove-double-neg9.3%
fma-def9.3%
Simplified9.3%
Taylor expanded in t around 0 9.3%
associate-*l/9.3%
*-lft-identity9.3%
*-commutative9.3%
unpow29.3%
+-commutative9.3%
sub-neg9.3%
metadata-eval9.3%
+-commutative9.3%
unpow29.3%
Simplified9.3%
Taylor expanded in x around inf 52.5%
unpow252.5%
neg-mul-152.5%
unpow252.5%
distribute-rgt-neg-in52.5%
Simplified52.5%
Taylor expanded in t around 0 52.5%
unpow252.5%
mul-1-neg52.5%
unpow252.5%
distribute-rgt-neg-out52.5%
Simplified52.5%
Taylor expanded in x around 0 52.5%
mul-1-neg52.5%
unpow252.5%
distribute-rgt-neg-out52.5%
unpow252.5%
distribute-lft-out--52.5%
associate-/r*60.9%
sub-neg60.9%
remove-double-neg60.9%
Simplified60.9%
if 2.39999999999999997e-130 < t Initial program 42.4%
associate-*r/42.3%
fma-neg42.3%
sub-neg42.3%
metadata-eval42.3%
+-commutative42.3%
fma-def42.3%
distribute-rgt-neg-in42.3%
Simplified42.3%
Applied egg-rr69.4%
Taylor expanded in l around 0 83.0%
Final simplification76.9%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -1.12e-218)
(- t_1)
(if (<= t 1.2e-129)
(* t (/ (sqrt 2.0) (sqrt (/ l (/ x (+ l l))))))
t_1))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.12e-218) {
tmp = -t_1;
} else if (t <= 1.2e-129) {
tmp = t * (sqrt(2.0) / sqrt((l / (x / (l + l)))));
} else {
tmp = t_1;
}
return tmp;
}
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(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-1.12d-218)) then
tmp = -t_1
else if (t <= 1.2d-129) then
tmp = t * (sqrt(2.0d0) / sqrt((l / (x / (l + l)))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.12e-218) {
tmp = -t_1;
} else if (t <= 1.2e-129) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((l / (x / (l + l)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -1.12e-218: tmp = -t_1 elif t <= 1.2e-129: tmp = t * (math.sqrt(2.0) / math.sqrt((l / (x / (l + l))))) else: tmp = t_1 return tmp
function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -1.12e-218) tmp = Float64(-t_1); elseif (t <= 1.2e-129) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(l / Float64(x / Float64(l + l)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -1.12e-218) tmp = -t_1; elseif (t <= 1.2e-129) tmp = t * (sqrt(2.0) / sqrt((l / (x / (l + l))))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.12e-218], (-t$95$1), If[LessEqual[t, 1.2e-129], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(l / N[(x / N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.12 \cdot 10^{-218}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-129}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell}{\frac{x}{\ell + \ell}}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.11999999999999996e-218Initial program 31.5%
associate-*r/31.4%
fma-neg31.4%
sub-neg31.4%
metadata-eval31.4%
+-commutative31.4%
fma-def31.4%
distribute-rgt-neg-in31.4%
Simplified31.4%
Applied egg-rr68.5%
Taylor expanded in t around -inf 79.1%
mul-1-neg79.1%
sub-neg79.1%
metadata-eval79.1%
+-commutative79.1%
Simplified79.1%
if -1.11999999999999996e-218 < t < 1.19999999999999994e-129Initial program 7.6%
associate-*l/7.6%
Simplified7.6%
Taylor expanded in x around inf 54.5%
associate--l+54.5%
unpow254.5%
distribute-lft-out54.5%
unpow254.5%
unpow254.5%
associate-*r/54.5%
mul-1-neg54.5%
+-commutative54.5%
unpow254.5%
associate-*l*54.5%
unpow254.5%
fma-udef54.5%
Simplified54.5%
Taylor expanded in t around 0 52.1%
associate-*r/52.1%
div-sub52.1%
cancel-sign-sub-inv52.1%
unpow252.1%
metadata-eval52.1%
*-lft-identity52.1%
unpow252.1%
distribute-lft-in52.1%
remove-double-neg52.1%
sub-neg52.1%
associate-/l*58.6%
sub-neg58.6%
remove-double-neg58.6%
Simplified58.6%
if 1.19999999999999994e-129 < t Initial program 42.4%
associate-*r/42.3%
fma-neg42.3%
sub-neg42.3%
metadata-eval42.3%
+-commutative42.3%
fma-def42.3%
distribute-rgt-neg-in42.3%
Simplified42.3%
Applied egg-rr69.4%
Taylor expanded in l around 0 83.0%
Final simplification77.2%
(FPCore (x l t)
:precision binary64
(if (<= t -3.2e-277)
(+ -1.0 (/ 1.0 x))
(if (<= t 4e-150)
(* (sqrt x) (- (/ t l)))
(sqrt (/ (+ x -1.0) (+ x 1.0))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -3.2e-277) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 4e-150) {
tmp = sqrt(x) * -(t / l);
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
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 <= (-3.2d-277)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 4d-150) then
tmp = sqrt(x) * -(t / l)
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -3.2e-277) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 4e-150) {
tmp = Math.sqrt(x) * -(t / l);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -3.2e-277: tmp = -1.0 + (1.0 / x) elif t <= 4e-150: tmp = math.sqrt(x) * -(t / l) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -3.2e-277) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 4e-150) tmp = Float64(sqrt(x) * Float64(-Float64(t / l))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -3.2e-277) tmp = -1.0 + (1.0 / x); elseif (t <= 4e-150) tmp = sqrt(x) * -(t / l); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -3.2e-277], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-150], N[(N[Sqrt[x], $MachinePrecision] * (-N[(t / l), $MachinePrecision])), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-277}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-150}:\\
\;\;\;\;\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -3.1999999999999998e-277Initial program 29.1%
associate-*r/29.1%
fma-neg29.1%
sub-neg29.1%
metadata-eval29.1%
+-commutative29.1%
fma-def29.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
Applied egg-rr65.3%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt75.3%
Simplified75.3%
if -3.1999999999999998e-277 < t < 4.00000000000000003e-150Initial program 6.8%
associate-/l*6.8%
fma-neg6.8%
remove-double-neg6.8%
fma-neg6.8%
sub-neg6.8%
metadata-eval6.8%
remove-double-neg6.8%
fma-def6.8%
Simplified6.8%
Taylor expanded in t around 0 10.0%
associate-*l/10.0%
*-lft-identity10.0%
*-commutative10.0%
unpow210.0%
+-commutative10.0%
sub-neg10.0%
metadata-eval10.0%
+-commutative10.0%
unpow210.0%
Simplified10.0%
Taylor expanded in x around inf 54.3%
unpow254.3%
neg-mul-154.3%
unpow254.3%
distribute-rgt-neg-in54.3%
Simplified54.3%
Taylor expanded in l around -inf 51.4%
mul-1-neg51.4%
*-commutative51.4%
distribute-rgt-neg-in51.4%
Simplified51.4%
if 4.00000000000000003e-150 < t Initial program 42.1%
associate-*r/42.1%
fma-neg42.1%
sub-neg42.1%
metadata-eval42.1%
+-commutative42.1%
fma-def42.1%
distribute-rgt-neg-in42.1%
Simplified42.1%
Applied egg-rr68.5%
Taylor expanded in l around 0 81.7%
Final simplification75.1%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -1.35e-276)
(- t_1)
(if (<= t 4e-150) (* (sqrt x) (- (/ t l))) t_1))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.35e-276) {
tmp = -t_1;
} else if (t <= 4e-150) {
tmp = sqrt(x) * -(t / l);
} else {
tmp = t_1;
}
return tmp;
}
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(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-1.35d-276)) then
tmp = -t_1
else if (t <= 4d-150) then
tmp = sqrt(x) * -(t / l)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.35e-276) {
tmp = -t_1;
} else if (t <= 4e-150) {
tmp = Math.sqrt(x) * -(t / l);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -1.35e-276: tmp = -t_1 elif t <= 4e-150: tmp = math.sqrt(x) * -(t / l) else: tmp = t_1 return tmp
function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -1.35e-276) tmp = Float64(-t_1); elseif (t <= 4e-150) tmp = Float64(sqrt(x) * Float64(-Float64(t / l))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -1.35e-276) tmp = -t_1; elseif (t <= 4e-150) tmp = sqrt(x) * -(t / l); else tmp = t_1; end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.35e-276], (-t$95$1), If[LessEqual[t, 4e-150], N[(N[Sqrt[x], $MachinePrecision] * (-N[(t / l), $MachinePrecision])), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-276}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-150}:\\
\;\;\;\;\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.34999999999999993e-276Initial program 29.1%
associate-*r/29.1%
fma-neg29.1%
sub-neg29.1%
metadata-eval29.1%
+-commutative29.1%
fma-def29.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
Applied egg-rr65.3%
Taylor expanded in t around -inf 76.2%
mul-1-neg76.2%
sub-neg76.2%
metadata-eval76.2%
+-commutative76.2%
Simplified76.2%
if -1.34999999999999993e-276 < t < 4.00000000000000003e-150Initial program 6.8%
associate-/l*6.8%
fma-neg6.8%
remove-double-neg6.8%
fma-neg6.8%
sub-neg6.8%
metadata-eval6.8%
remove-double-neg6.8%
fma-def6.8%
Simplified6.8%
Taylor expanded in t around 0 10.0%
associate-*l/10.0%
*-lft-identity10.0%
*-commutative10.0%
unpow210.0%
+-commutative10.0%
sub-neg10.0%
metadata-eval10.0%
+-commutative10.0%
unpow210.0%
Simplified10.0%
Taylor expanded in x around inf 54.3%
unpow254.3%
neg-mul-154.3%
unpow254.3%
distribute-rgt-neg-in54.3%
Simplified54.3%
Taylor expanded in l around -inf 51.4%
mul-1-neg51.4%
*-commutative51.4%
distribute-rgt-neg-in51.4%
Simplified51.4%
if 4.00000000000000003e-150 < t Initial program 42.1%
associate-*r/42.1%
fma-neg42.1%
sub-neg42.1%
metadata-eval42.1%
+-commutative42.1%
fma-def42.1%
distribute-rgt-neg-in42.1%
Simplified42.1%
Applied egg-rr68.5%
Taylor expanded in l around 0 81.7%
Final simplification75.5%
(FPCore (x l t)
:precision binary64
(if (<= t -4.1e-277)
(+ -1.0 (/ 1.0 x))
(if (<= t 5.5e-150)
(* (sqrt x) (- (/ t l)))
(+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x)))))
double code(double x, double l, double t) {
double tmp;
if (t <= -4.1e-277) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 5.5e-150) {
tmp = sqrt(x) * -(t / l);
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
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 <= (-4.1d-277)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 5.5d-150) then
tmp = sqrt(x) * -(t / l)
else
tmp = (1.0d0 + (0.5d0 / (x * x))) + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -4.1e-277) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 5.5e-150) {
tmp = Math.sqrt(x) * -(t / l);
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -4.1e-277: tmp = -1.0 + (1.0 / x) elif t <= 5.5e-150: tmp = math.sqrt(x) * -(t / l) else: tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -4.1e-277) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 5.5e-150) tmp = Float64(sqrt(x) * Float64(-Float64(t / l))); else tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -4.1e-277) tmp = -1.0 + (1.0 / x); elseif (t <= 5.5e-150) tmp = sqrt(x) * -(t / l); else tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -4.1e-277], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-150], N[(N[Sqrt[x], $MachinePrecision] * (-N[(t / l), $MachinePrecision])), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-277}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-150}:\\
\;\;\;\;\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.09999999999999989e-277Initial program 29.1%
associate-*r/29.1%
fma-neg29.1%
sub-neg29.1%
metadata-eval29.1%
+-commutative29.1%
fma-def29.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
Applied egg-rr65.3%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt75.3%
Simplified75.3%
if -4.09999999999999989e-277 < t < 5.4999999999999996e-150Initial program 6.8%
associate-/l*6.8%
fma-neg6.8%
remove-double-neg6.8%
fma-neg6.8%
sub-neg6.8%
metadata-eval6.8%
remove-double-neg6.8%
fma-def6.8%
Simplified6.8%
Taylor expanded in t around 0 10.0%
associate-*l/10.0%
*-lft-identity10.0%
*-commutative10.0%
unpow210.0%
+-commutative10.0%
sub-neg10.0%
metadata-eval10.0%
+-commutative10.0%
unpow210.0%
Simplified10.0%
Taylor expanded in x around inf 54.3%
unpow254.3%
neg-mul-154.3%
unpow254.3%
distribute-rgt-neg-in54.3%
Simplified54.3%
Taylor expanded in l around -inf 51.4%
mul-1-neg51.4%
*-commutative51.4%
distribute-rgt-neg-in51.4%
Simplified51.4%
if 5.4999999999999996e-150 < t Initial program 42.1%
associate-*r/42.1%
fma-neg42.1%
sub-neg42.1%
metadata-eval42.1%
+-commutative42.1%
fma-def42.1%
distribute-rgt-neg-in42.1%
Simplified42.1%
Applied egg-rr68.5%
Taylor expanded in l around 0 81.7%
Taylor expanded in x around inf 81.0%
associate-*r/81.0%
metadata-eval81.0%
unpow281.0%
Simplified81.0%
Final simplification74.8%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
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) + (1.0d0 / x)
else
tmp = (1.0d0 + (0.5d0 / (x * x))) + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 28.2%
associate-*r/28.1%
fma-neg28.1%
sub-neg28.1%
metadata-eval28.1%
+-commutative28.1%
fma-def28.1%
distribute-rgt-neg-in28.1%
Simplified28.1%
Applied egg-rr63.6%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt73.0%
Simplified73.0%
if -4.999999999999985e-310 < t Initial program 35.4%
associate-*r/35.3%
fma-neg35.3%
sub-neg35.3%
metadata-eval35.3%
+-commutative35.3%
fma-def35.3%
distribute-rgt-neg-in35.3%
Simplified35.3%
Applied egg-rr64.4%
Taylor expanded in l around 0 72.8%
Taylor expanded in x around inf 72.2%
associate-*r/72.2%
metadata-eval72.2%
unpow272.2%
Simplified72.2%
Final simplification72.6%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) 1.0))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
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) + (1.0d0 / x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 28.2%
associate-*r/28.1%
fma-neg28.1%
sub-neg28.1%
metadata-eval28.1%
+-commutative28.1%
fma-def28.1%
distribute-rgt-neg-in28.1%
Simplified28.1%
Applied egg-rr63.6%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt73.0%
Simplified73.0%
if -4.999999999999985e-310 < t Initial program 35.4%
associate-*l/35.3%
Simplified35.3%
Taylor expanded in x around inf 70.9%
sqrt-unprod71.9%
metadata-eval71.9%
metadata-eval71.9%
Applied egg-rr71.9%
Final simplification72.5%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
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) + (1.0d0 / x)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 28.2%
associate-*r/28.1%
fma-neg28.1%
sub-neg28.1%
metadata-eval28.1%
+-commutative28.1%
fma-def28.1%
distribute-rgt-neg-in28.1%
Simplified28.1%
Applied egg-rr63.6%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt73.0%
Simplified73.0%
if -4.999999999999985e-310 < t Initial program 35.4%
associate-*r/35.3%
fma-neg35.3%
sub-neg35.3%
metadata-eval35.3%
+-commutative35.3%
fma-def35.3%
distribute-rgt-neg-in35.3%
Simplified35.3%
Applied egg-rr64.4%
Taylor expanded in l around 0 72.8%
Taylor expanded in x around inf 72.2%
Final simplification72.6%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 1.0))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
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
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], -1.0, 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 28.2%
associate-*r/28.1%
fma-neg28.1%
sub-neg28.1%
metadata-eval28.1%
+-commutative28.1%
fma-def28.1%
distribute-rgt-neg-in28.1%
Simplified28.1%
Applied egg-rr63.6%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt72.2%
Simplified72.2%
if -4.999999999999985e-310 < t Initial program 35.4%
associate-*l/35.3%
Simplified35.3%
Taylor expanded in x around inf 70.9%
sqrt-unprod71.9%
metadata-eval71.9%
metadata-eval71.9%
Applied egg-rr71.9%
Final simplification72.1%
(FPCore (x l t) :precision binary64 -1.0)
double code(double x, double l, double t) {
return -1.0;
}
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
public static double code(double x, double l, double t) {
return -1.0;
}
def code(x, l, t): return -1.0
function code(x, l, t) return -1.0 end
function tmp = code(x, l, t) tmp = -1.0; end
code[x_, l_, t_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 31.7%
associate-*r/31.6%
fma-neg31.7%
sub-neg31.7%
metadata-eval31.7%
+-commutative31.7%
fma-def31.7%
distribute-rgt-neg-in31.7%
Simplified31.7%
Applied egg-rr64.0%
Taylor expanded in l around 0 36.5%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt37.8%
Simplified37.8%
Final simplification37.8%
herbie shell --seed 2023182
(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)))))