
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (fma x (/ 1.0 y) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
return fma(x, (1.0 / y), (-2.0 + ((2.0 + (2.0 / z)) / t)));
}
function code(x, y, z, t) return fma(x, Float64(1.0 / y), Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t))) end
code[x_, y_, z_, t_] := N[(x * N[(1.0 / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \frac{1}{y}, -2 + \frac{2 + \frac{2}{z}}{t}\right)
\end{array}
Initial program 86.2%
sub-neg86.2%
distribute-rgt-in86.2%
*-lft-identity86.2%
associate-+r+86.2%
cancel-sign-sub-inv86.2%
div-sub76.0%
associate-*r*76.0%
associate-*l/76.0%
*-inverses99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
metadata-eval99.5%
associate-/l/99.6%
Simplified99.6%
div-inv99.5%
fma-def99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -5e+55)
(+ (/ x y) (/ 2.0 t))
(if (<= (/ x y) 1.9e-5)
(+ (/ 2.0 t) (- (/ (/ 2.0 t) z) 2.0))
(+ (/ x y) (- (/ 2.0 t) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+55) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1.9e-5) {
tmp = (2.0 / t) + (((2.0 / t) / z) - 2.0);
} else {
tmp = (x / y) + ((2.0 / t) - 2.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-5d+55)) then
tmp = (x / y) + (2.0d0 / t)
else if ((x / y) <= 1.9d-5) then
tmp = (2.0d0 / t) + (((2.0d0 / t) / z) - 2.0d0)
else
tmp = (x / y) + ((2.0d0 / t) - 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+55) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1.9e-5) {
tmp = (2.0 / t) + (((2.0 / t) / z) - 2.0);
} else {
tmp = (x / y) + ((2.0 / t) - 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+55: tmp = (x / y) + (2.0 / t) elif (x / y) <= 1.9e-5: tmp = (2.0 / t) + (((2.0 / t) / z) - 2.0) else: tmp = (x / y) + ((2.0 / t) - 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+55) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (Float64(x / y) <= 1.9e-5) tmp = Float64(Float64(2.0 / t) + Float64(Float64(Float64(2.0 / t) / z) - 2.0)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) - 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e+55) tmp = (x / y) + (2.0 / t); elseif ((x / y) <= 1.9e-5) tmp = (2.0 / t) + (((2.0 / t) / z) - 2.0); else tmp = (x / y) + ((2.0 / t) - 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+55], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.9e-5], N[(N[(2.0 / t), $MachinePrecision] + N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+55}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.9 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{t} + \left(\frac{\frac{2}{t}}{z} - 2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} - 2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -5.00000000000000046e55Initial program 81.8%
sub-neg81.8%
distribute-rgt-in81.8%
*-lft-identity81.8%
associate-+r+81.8%
cancel-sign-sub-inv81.8%
div-sub70.9%
associate-*r*70.9%
associate-*l/70.9%
*-inverses98.2%
metadata-eval98.2%
sub-neg98.2%
metadata-eval98.2%
metadata-eval98.2%
+-commutative98.2%
metadata-eval98.2%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in z around inf 80.8%
associate--l+80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
Taylor expanded in t around 0 80.8%
if -5.00000000000000046e55 < (/.f64 x y) < 1.9000000000000001e-5Initial program 88.7%
sub-neg88.7%
distribute-rgt-in88.7%
*-lft-identity88.7%
associate-+r+88.7%
cancel-sign-sub-inv88.7%
div-sub76.8%
associate-*r*76.8%
associate-*l/76.8%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
div-inv99.9%
fma-def99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 99.2%
associate--l+99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/r*99.3%
Simplified99.3%
if 1.9000000000000001e-5 < (/.f64 x y) Initial program 84.8%
sub-neg84.8%
distribute-rgt-in84.8%
*-lft-identity84.8%
associate-+r+84.8%
cancel-sign-sub-inv84.8%
div-sub78.7%
associate-*r*78.7%
associate-*l/78.7%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 84.7%
associate--l+84.7%
associate-*r/84.7%
metadata-eval84.7%
Simplified84.7%
Final simplification91.6%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -1.15e+55)
(/ x y)
(if (<= (/ x y) -5e-21)
(/ 2.0 (* z t))
(if (<= (/ x y) 1.1e+16) (- (/ 2.0 t) 2.0) (- (/ x y) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.15e+55) {
tmp = x / y;
} else if ((x / y) <= -5e-21) {
tmp = 2.0 / (z * t);
} else if ((x / y) <= 1.1e+16) {
tmp = (2.0 / t) - 2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-1.15d+55)) then
tmp = x / y
else if ((x / y) <= (-5d-21)) then
tmp = 2.0d0 / (z * t)
else if ((x / y) <= 1.1d+16) then
tmp = (2.0d0 / t) - 2.0d0
else
tmp = (x / y) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.15e+55) {
tmp = x / y;
} else if ((x / y) <= -5e-21) {
tmp = 2.0 / (z * t);
} else if ((x / y) <= 1.1e+16) {
tmp = (2.0 / t) - 2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.15e+55: tmp = x / y elif (x / y) <= -5e-21: tmp = 2.0 / (z * t) elif (x / y) <= 1.1e+16: tmp = (2.0 / t) - 2.0 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.15e+55) tmp = Float64(x / y); elseif (Float64(x / y) <= -5e-21) tmp = Float64(2.0 / Float64(z * t)); elseif (Float64(x / y) <= 1.1e+16) tmp = Float64(Float64(2.0 / t) - 2.0); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1.15e+55) tmp = x / y; elseif ((x / y) <= -5e-21) tmp = 2.0 / (z * t); elseif ((x / y) <= 1.1e+16) tmp = (2.0 / t) - 2.0; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.15e+55], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -5e-21], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.1e+16], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.15 \cdot 10^{+55}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-21}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.1 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{t} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.14999999999999994e55Initial program 81.8%
sub-neg81.8%
distribute-rgt-in81.8%
*-lft-identity81.8%
associate-+r+81.8%
cancel-sign-sub-inv81.8%
div-sub70.9%
associate-*r*70.9%
associate-*l/70.9%
*-inverses98.2%
metadata-eval98.2%
sub-neg98.2%
metadata-eval98.2%
metadata-eval98.2%
+-commutative98.2%
metadata-eval98.2%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in x around inf 75.1%
if -1.14999999999999994e55 < (/.f64 x y) < -4.99999999999999973e-21Initial program 88.7%
sub-neg88.7%
distribute-rgt-in88.7%
*-lft-identity88.7%
associate-+r+88.7%
cancel-sign-sub-inv88.7%
div-sub44.3%
associate-*r*44.3%
associate-*l/44.3%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in z around 0 78.5%
if -4.99999999999999973e-21 < (/.f64 x y) < 1.1e16Initial program 88.2%
sub-neg88.2%
distribute-rgt-in88.2%
*-lft-identity88.2%
associate-+r+88.2%
cancel-sign-sub-inv88.2%
div-sub79.0%
associate-*r*79.0%
associate-*l/79.0%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.1%
associate-*r/99.1%
metadata-eval99.1%
+-commutative99.1%
associate--l+99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in z around inf 66.6%
associate-*r/66.6%
metadata-eval66.6%
Simplified66.6%
if 1.1e16 < (/.f64 x y) Initial program 85.4%
sub-neg85.4%
distribute-rgt-in85.4%
*-lft-identity85.4%
associate-+r+85.4%
cancel-sign-sub-inv85.4%
div-sub78.9%
associate-*r*78.9%
associate-*l/78.9%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around inf 75.6%
Final simplification71.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= z -8.6e+63)
t_1
(if (<= z -2.55e-78)
(- (/ x y) 2.0)
(if (<= z 1.6e-73)
(/ (/ 2.0 z) t)
(if (<= z 3.15e+257) t_1 (- (/ 2.0 t) 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -8.6e+63) {
tmp = t_1;
} else if (z <= -2.55e-78) {
tmp = (x / y) - 2.0;
} else if (z <= 1.6e-73) {
tmp = (2.0 / z) / t;
} else if (z <= 3.15e+257) {
tmp = t_1;
} else {
tmp = (2.0 / t) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (2.0d0 / t)
if (z <= (-8.6d+63)) then
tmp = t_1
else if (z <= (-2.55d-78)) then
tmp = (x / y) - 2.0d0
else if (z <= 1.6d-73) then
tmp = (2.0d0 / z) / t
else if (z <= 3.15d+257) then
tmp = t_1
else
tmp = (2.0d0 / t) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -8.6e+63) {
tmp = t_1;
} else if (z <= -2.55e-78) {
tmp = (x / y) - 2.0;
} else if (z <= 1.6e-73) {
tmp = (2.0 / z) / t;
} else if (z <= 3.15e+257) {
tmp = t_1;
} else {
tmp = (2.0 / t) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if z <= -8.6e+63: tmp = t_1 elif z <= -2.55e-78: tmp = (x / y) - 2.0 elif z <= 1.6e-73: tmp = (2.0 / z) / t elif z <= 3.15e+257: tmp = t_1 else: tmp = (2.0 / t) - 2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (z <= -8.6e+63) tmp = t_1; elseif (z <= -2.55e-78) tmp = Float64(Float64(x / y) - 2.0); elseif (z <= 1.6e-73) tmp = Float64(Float64(2.0 / z) / t); elseif (z <= 3.15e+257) tmp = t_1; else tmp = Float64(Float64(2.0 / t) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if (z <= -8.6e+63) tmp = t_1; elseif (z <= -2.55e-78) tmp = (x / y) - 2.0; elseif (z <= 1.6e-73) tmp = (2.0 / z) / t; elseif (z <= 3.15e+257) tmp = t_1; else tmp = (2.0 / t) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.6e+63], t$95$1, If[LessEqual[z, -2.55e-78], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[z, 1.6e-73], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.15e+257], t$95$1, N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;z \leq -8.6 \cdot 10^{+63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.55 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-73}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{+257}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} - 2\\
\end{array}
\end{array}
if z < -8.6000000000000001e63 or 1.59999999999999993e-73 < z < 3.15000000000000006e257Initial program 75.5%
sub-neg75.5%
distribute-rgt-in75.5%
*-lft-identity75.5%
associate-+r+75.5%
cancel-sign-sub-inv75.5%
div-sub75.5%
associate-*r*75.5%
associate-*l/75.5%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 96.4%
associate--l+96.4%
associate-*r/96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in t around 0 80.6%
if -8.6000000000000001e63 < z < -2.55e-78Initial program 99.9%
sub-neg99.9%
distribute-rgt-in99.9%
*-lft-identity99.9%
associate-+r+99.9%
cancel-sign-sub-inv99.9%
div-sub99.9%
associate-*r*99.9%
associate-*l/99.9%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 73.6%
if -2.55e-78 < z < 1.59999999999999993e-73Initial program 98.6%
sub-neg98.6%
distribute-rgt-in98.6%
*-lft-identity98.6%
associate-+r+98.6%
cancel-sign-sub-inv98.6%
div-sub68.1%
associate-*r*68.1%
associate-*l/68.1%
*-inverses98.7%
metadata-eval98.7%
sub-neg98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
metadata-eval98.7%
associate-/l/98.8%
Simplified98.8%
div-inv98.7%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 80.6%
associate--l+80.6%
associate-*r/80.6%
metadata-eval80.6%
associate-*r/80.6%
metadata-eval80.6%
associate-/r*80.7%
Simplified80.7%
Taylor expanded in z around 0 71.4%
*-commutative71.4%
associate-/r*71.5%
Simplified71.5%
if 3.15000000000000006e257 < z Initial program 49.8%
sub-neg49.8%
distribute-rgt-in49.8%
*-lft-identity49.8%
associate-+r+49.8%
cancel-sign-sub-inv49.8%
div-sub49.8%
associate-*r*49.8%
associate-*l/49.8%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in x around 0 90.1%
associate-*r/90.1%
metadata-eval90.1%
+-commutative90.1%
associate--l+90.1%
associate-*r/90.1%
metadata-eval90.1%
Simplified90.1%
Taylor expanded in z around inf 90.1%
associate-*r/90.1%
metadata-eval90.1%
Simplified90.1%
Final simplification76.8%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2.7e-20)
(/ x y)
(if (<= (/ x y) 6.3e-106)
-2.0
(if (<= (/ x y) 9.2e+16) (/ 2.0 t) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.7e-20) {
tmp = x / y;
} else if ((x / y) <= 6.3e-106) {
tmp = -2.0;
} else if ((x / y) <= 9.2e+16) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-2.7d-20)) then
tmp = x / y
else if ((x / y) <= 6.3d-106) then
tmp = -2.0d0
else if ((x / y) <= 9.2d+16) then
tmp = 2.0d0 / t
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.7e-20) {
tmp = x / y;
} else if ((x / y) <= 6.3e-106) {
tmp = -2.0;
} else if ((x / y) <= 9.2e+16) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2.7e-20: tmp = x / y elif (x / y) <= 6.3e-106: tmp = -2.0 elif (x / y) <= 9.2e+16: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2.7e-20) tmp = Float64(x / y); elseif (Float64(x / y) <= 6.3e-106) tmp = -2.0; elseif (Float64(x / y) <= 9.2e+16) tmp = Float64(2.0 / t); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2.7e-20) tmp = x / y; elseif ((x / y) <= 6.3e-106) tmp = -2.0; elseif ((x / y) <= 9.2e+16) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2.7e-20], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 6.3e-106], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 9.2e+16], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.7 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 6.3 \cdot 10^{-106}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 9.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.7e-20 or 9.2e16 < (/.f64 x y) Initial program 83.9%
sub-neg83.9%
distribute-rgt-in83.9%
*-lft-identity83.9%
associate-+r+83.9%
cancel-sign-sub-inv83.9%
div-sub73.5%
associate-*r*73.5%
associate-*l/73.5%
*-inverses99.1%
metadata-eval99.1%
sub-neg99.1%
metadata-eval99.1%
metadata-eval99.1%
+-commutative99.1%
metadata-eval99.1%
associate-/l/99.2%
Simplified99.2%
Taylor expanded in x around inf 71.4%
if -2.7e-20 < (/.f64 x y) < 6.3000000000000003e-106Initial program 89.2%
sub-neg89.2%
distribute-rgt-in89.2%
*-lft-identity89.2%
associate-+r+89.2%
cancel-sign-sub-inv89.2%
div-sub80.6%
associate-*r*80.6%
associate-*l/80.6%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
+-commutative99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 41.8%
if 6.3000000000000003e-106 < (/.f64 x y) < 9.2e16Initial program 84.8%
sub-neg84.8%
distribute-rgt-in84.8%
*-lft-identity84.8%
associate-+r+84.8%
cancel-sign-sub-inv84.8%
div-sub70.1%
associate-*r*70.1%
associate-*l/70.1%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 74.9%
associate--l+74.9%
associate-*r/74.9%
metadata-eval74.9%
Simplified74.9%
Taylor expanded in t around 0 46.6%
Final simplification56.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9e-78) (not (<= z 2.4e-122))) (+ (/ x y) (- (/ 2.0 t) 2.0)) (/ (/ 2.0 z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e-78) || !(z <= 2.4e-122)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} else {
tmp = (2.0 / z) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-9d-78)) .or. (.not. (z <= 2.4d-122))) then
tmp = (x / y) + ((2.0d0 / t) - 2.0d0)
else
tmp = (2.0d0 / z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e-78) || !(z <= 2.4e-122)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} else {
tmp = (2.0 / z) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9e-78) or not (z <= 2.4e-122): tmp = (x / y) + ((2.0 / t) - 2.0) else: tmp = (2.0 / z) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9e-78) || !(z <= 2.4e-122)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) - 2.0)); else tmp = Float64(Float64(2.0 / z) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9e-78) || ~((z <= 2.4e-122))) tmp = (x / y) + ((2.0 / t) - 2.0); else tmp = (2.0 / z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9e-78], N[Not[LessEqual[z, 2.4e-122]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-78} \lor \neg \left(z \leq 2.4 \cdot 10^{-122}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} - 2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -9e-78 or 2.39999999999999987e-122 < z Initial program 81.2%
sub-neg81.2%
distribute-rgt-in81.2%
*-lft-identity81.2%
associate-+r+81.2%
cancel-sign-sub-inv81.2%
div-sub80.1%
associate-*r*80.1%
associate-*l/80.1%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in z around inf 90.8%
associate--l+90.8%
associate-*r/90.8%
metadata-eval90.8%
Simplified90.8%
if -9e-78 < z < 2.39999999999999987e-122Initial program 98.5%
sub-neg98.5%
distribute-rgt-in98.5%
*-lft-identity98.5%
associate-+r+98.5%
cancel-sign-sub-inv98.5%
div-sub66.0%
associate-*r*66.0%
associate-*l/66.0%
*-inverses98.5%
metadata-eval98.5%
sub-neg98.5%
metadata-eval98.5%
metadata-eval98.5%
+-commutative98.5%
metadata-eval98.5%
associate-/l/98.6%
Simplified98.6%
div-inv98.5%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 80.4%
associate--l+80.4%
associate-*r/80.4%
metadata-eval80.4%
associate-*r/80.4%
metadata-eval80.4%
associate-/r*80.5%
Simplified80.5%
Taylor expanded in z around 0 75.0%
*-commutative75.0%
associate-/r*75.1%
Simplified75.1%
Final simplification86.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -63000000.0) (/ x y) (if (<= (/ x y) 3.2e+16) (- (/ 2.0 t) 2.0) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -63000000.0) {
tmp = x / y;
} else if ((x / y) <= 3.2e+16) {
tmp = (2.0 / t) - 2.0;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-63000000.0d0)) then
tmp = x / y
else if ((x / y) <= 3.2d+16) then
tmp = (2.0d0 / t) - 2.0d0
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -63000000.0) {
tmp = x / y;
} else if ((x / y) <= 3.2e+16) {
tmp = (2.0 / t) - 2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -63000000.0: tmp = x / y elif (x / y) <= 3.2e+16: tmp = (2.0 / t) - 2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -63000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 3.2e+16) tmp = Float64(Float64(2.0 / t) - 2.0); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -63000000.0) tmp = x / y; elseif ((x / y) <= 3.2e+16) tmp = (2.0 / t) - 2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -63000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 3.2e+16], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -63000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 3.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{t} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -6.3e7 or 3.2e16 < (/.f64 x y) Initial program 83.4%
sub-neg83.4%
distribute-rgt-in83.4%
*-lft-identity83.4%
associate-+r+83.4%
cancel-sign-sub-inv83.4%
div-sub72.7%
associate-*r*72.7%
associate-*l/72.7%
*-inverses99.1%
metadata-eval99.1%
sub-neg99.1%
metadata-eval99.1%
metadata-eval99.1%
+-commutative99.1%
metadata-eval99.1%
associate-/l/99.1%
Simplified99.1%
Taylor expanded in x around inf 73.7%
if -6.3e7 < (/.f64 x y) < 3.2e16Initial program 88.7%
sub-neg88.7%
distribute-rgt-in88.7%
*-lft-identity88.7%
associate-+r+88.7%
cancel-sign-sub-inv88.7%
div-sub79.0%
associate-*r*79.0%
associate-*l/79.0%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.1%
associate-*r/99.1%
metadata-eval99.1%
+-commutative99.1%
associate--l+99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in z around inf 64.9%
associate-*r/64.9%
metadata-eval64.9%
Simplified64.9%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1720000000000.0) (/ x y) (if (<= (/ x y) 4.5e+16) (- (/ 2.0 t) 2.0) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1720000000000.0) {
tmp = x / y;
} else if ((x / y) <= 4.5e+16) {
tmp = (2.0 / t) - 2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-1720000000000.0d0)) then
tmp = x / y
else if ((x / y) <= 4.5d+16) then
tmp = (2.0d0 / t) - 2.0d0
else
tmp = (x / y) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1720000000000.0) {
tmp = x / y;
} else if ((x / y) <= 4.5e+16) {
tmp = (2.0 / t) - 2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1720000000000.0: tmp = x / y elif (x / y) <= 4.5e+16: tmp = (2.0 / t) - 2.0 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1720000000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 4.5e+16) tmp = Float64(Float64(2.0 / t) - 2.0); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1720000000000.0) tmp = x / y; elseif ((x / y) <= 4.5e+16) tmp = (2.0 / t) - 2.0; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1720000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.5e+16], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1720000000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.5 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{t} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.72e12Initial program 81.3%
sub-neg81.3%
distribute-rgt-in81.3%
*-lft-identity81.3%
associate-+r+81.3%
cancel-sign-sub-inv81.3%
div-sub66.1%
associate-*r*66.1%
associate-*l/66.1%
*-inverses98.3%
metadata-eval98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
+-commutative98.3%
metadata-eval98.3%
associate-/l/98.3%
Simplified98.3%
Taylor expanded in x around inf 71.8%
if -1.72e12 < (/.f64 x y) < 4.5e16Initial program 88.7%
sub-neg88.7%
distribute-rgt-in88.7%
*-lft-identity88.7%
associate-+r+88.7%
cancel-sign-sub-inv88.7%
div-sub79.0%
associate-*r*79.0%
associate-*l/79.0%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.1%
associate-*r/99.1%
metadata-eval99.1%
+-commutative99.1%
associate--l+99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in z around inf 64.9%
associate-*r/64.9%
metadata-eval64.9%
Simplified64.9%
if 4.5e16 < (/.f64 x y) Initial program 85.4%
sub-neg85.4%
distribute-rgt-in85.4%
*-lft-identity85.4%
associate-+r+85.4%
cancel-sign-sub-inv85.4%
div-sub78.9%
associate-*r*78.9%
associate-*l/78.9%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around inf 75.6%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 (+ (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t)) (/ x y)))
double code(double x, double y, double z, double t) {
return (-2.0 + ((2.0 + (2.0 / z)) / t)) + (x / y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)) + (x / y)
end function
public static double code(double x, double y, double z, double t) {
return (-2.0 + ((2.0 + (2.0 / z)) / t)) + (x / y);
}
def code(x, y, z, t): return (-2.0 + ((2.0 + (2.0 / z)) / t)) + (x / y)
function code(x, y, z, t) return Float64(Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)) + Float64(x / y)) end
function tmp = code(x, y, z, t) tmp = (-2.0 + ((2.0 + (2.0 / z)) / t)) + (x / y); end
code[x_, y_, z_, t_] := N[(N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-2 + \frac{2 + \frac{2}{z}}{t}\right) + \frac{x}{y}
\end{array}
Initial program 86.2%
sub-neg86.2%
distribute-rgt-in86.2%
*-lft-identity86.2%
associate-+r+86.2%
cancel-sign-sub-inv86.2%
div-sub76.0%
associate-*r*76.0%
associate-*l/76.0%
*-inverses99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
metadata-eval99.5%
associate-/l/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.7e-35) (not (<= t 1e-38))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.7e-35) || !(t <= 1e-38)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-3.7d-35)) .or. (.not. (t <= 1d-38))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 + (2.0d0 / z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.7e-35) || !(t <= 1e-38)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.7e-35) or not (t <= 1e-38): tmp = (x / y) - 2.0 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.7e-35) || !(t <= 1e-38)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.7e-35) || ~((t <= 1e-38))) tmp = (x / y) - 2.0; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.7e-35], N[Not[LessEqual[t, 1e-38]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-35} \lor \neg \left(t \leq 10^{-38}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -3.6999999999999999e-35 or 9.9999999999999996e-39 < t Initial program 75.6%
sub-neg75.6%
distribute-rgt-in75.6%
*-lft-identity75.6%
associate-+r+75.6%
cancel-sign-sub-inv75.6%
div-sub75.6%
associate-*r*75.6%
associate-*l/75.6%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around inf 82.8%
if -3.6999999999999999e-35 < t < 9.9999999999999996e-39Initial program 98.9%
sub-neg98.9%
distribute-rgt-in98.9%
*-lft-identity98.9%
associate-+r+98.9%
cancel-sign-sub-inv98.9%
div-sub76.5%
associate-*r*76.5%
associate-*l/76.5%
*-inverses98.9%
metadata-eval98.9%
sub-neg98.9%
metadata-eval98.9%
metadata-eval98.9%
+-commutative98.9%
metadata-eval98.9%
associate-/l/99.1%
Simplified99.1%
Taylor expanded in t around 0 80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
Final simplification81.9%
(FPCore (x y z t) :precision binary64 (if (<= t -280.0) -2.0 (if (<= t 1.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -280.0) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-280.0d0)) then
tmp = -2.0d0
else if (t <= 1.0d0) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -280.0) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -280.0: tmp = -2.0 elif t <= 1.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -280.0) tmp = -2.0; elseif (t <= 1.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -280.0) tmp = -2.0; elseif (t <= 1.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -280.0], -2.0, If[LessEqual[t, 1.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -280:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -280 or 1 < t Initial program 72.5%
sub-neg72.5%
distribute-rgt-in72.5%
*-lft-identity72.5%
associate-+r+72.5%
cancel-sign-sub-inv72.5%
div-sub72.5%
associate-*r*72.5%
associate-*l/72.5%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around 0 56.1%
associate-*r/56.1%
metadata-eval56.1%
+-commutative56.1%
associate--l+56.1%
associate-*r/56.1%
metadata-eval56.1%
Simplified56.1%
Taylor expanded in t around inf 40.6%
if -280 < t < 1Initial program 99.0%
sub-neg99.0%
distribute-rgt-in99.0%
*-lft-identity99.0%
associate-+r+99.0%
cancel-sign-sub-inv99.0%
div-sub79.3%
associate-*r*79.3%
associate-*l/79.3%
*-inverses99.0%
metadata-eval99.0%
sub-neg99.0%
metadata-eval99.0%
metadata-eval99.0%
+-commutative99.0%
metadata-eval99.0%
associate-/l/99.2%
Simplified99.2%
Taylor expanded in z around inf 60.9%
associate--l+60.9%
associate-*r/60.9%
metadata-eval60.9%
Simplified60.9%
Taylor expanded in t around 0 35.7%
Final simplification38.1%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 86.2%
sub-neg86.2%
distribute-rgt-in86.2%
*-lft-identity86.2%
associate-+r+86.2%
cancel-sign-sub-inv86.2%
div-sub76.0%
associate-*r*76.0%
associate-*l/76.0%
*-inverses99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
metadata-eval99.5%
associate-/l/99.6%
Simplified99.6%
Taylor expanded in x around 0 65.9%
associate-*r/65.9%
metadata-eval65.9%
+-commutative65.9%
associate--l+65.9%
associate-*r/65.9%
metadata-eval65.9%
Simplified65.9%
Taylor expanded in t around inf 21.0%
Final simplification21.0%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2023200
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))