
(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 13 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 (+ (/ (+ 2.0 (/ 2.0 z)) t) (+ -2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / 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 + (2.0d0 / z)) / t) + ((-2.0d0) + (x / y))
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / y));
}
def code(x, y, z, t): return ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + Float64(-2.0 + Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 + \frac{2}{z}}{t} + \left(-2 + \frac{x}{y}\right)
\end{array}
Initial program 86.2%
+-commutative86.2%
remove-double-neg86.2%
distribute-frac-neg86.2%
unsub-neg86.2%
*-commutative86.2%
associate-*r*86.2%
distribute-rgt1-in86.2%
associate-/l*86.5%
fma-neg86.5%
*-commutative86.5%
fma-define86.5%
*-commutative86.5%
distribute-frac-neg86.5%
remove-double-neg86.5%
Simplified86.5%
Taylor expanded in t around inf 99.1%
associate--l+99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
associate-*r/99.1%
distribute-lft-in99.1%
metadata-eval99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))) (t_2 (+ -2.0 (/ x y))))
(if (<= z -4e+212)
t_2
(if (<= z -7.2e+29)
t_1
(if (<= z -3.8e-172)
t_2
(if (<= z 3.8e-97)
(/ (/ 2.0 t) z)
(if (or (<= z 2.25e+136) (not (<= z 3.6e+236))) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = -2.0 + (x / y);
double tmp;
if (z <= -4e+212) {
tmp = t_2;
} else if (z <= -7.2e+29) {
tmp = t_1;
} else if (z <= -3.8e-172) {
tmp = t_2;
} else if (z <= 3.8e-97) {
tmp = (2.0 / t) / z;
} else if ((z <= 2.25e+136) || !(z <= 3.6e+236)) {
tmp = t_2;
} else {
tmp = t_1;
}
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) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / t)
t_2 = (-2.0d0) + (x / y)
if (z <= (-4d+212)) then
tmp = t_2
else if (z <= (-7.2d+29)) then
tmp = t_1
else if (z <= (-3.8d-172)) then
tmp = t_2
else if (z <= 3.8d-97) then
tmp = (2.0d0 / t) / z
else if ((z <= 2.25d+136) .or. (.not. (z <= 3.6d+236))) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = -2.0 + (x / y);
double tmp;
if (z <= -4e+212) {
tmp = t_2;
} else if (z <= -7.2e+29) {
tmp = t_1;
} else if (z <= -3.8e-172) {
tmp = t_2;
} else if (z <= 3.8e-97) {
tmp = (2.0 / t) / z;
} else if ((z <= 2.25e+136) || !(z <= 3.6e+236)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) t_2 = -2.0 + (x / y) tmp = 0 if z <= -4e+212: tmp = t_2 elif z <= -7.2e+29: tmp = t_1 elif z <= -3.8e-172: tmp = t_2 elif z <= 3.8e-97: tmp = (2.0 / t) / z elif (z <= 2.25e+136) or not (z <= 3.6e+236): tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / t)) t_2 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (z <= -4e+212) tmp = t_2; elseif (z <= -7.2e+29) tmp = t_1; elseif (z <= -3.8e-172) tmp = t_2; elseif (z <= 3.8e-97) tmp = Float64(Float64(2.0 / t) / z); elseif ((z <= 2.25e+136) || !(z <= 3.6e+236)) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / t); t_2 = -2.0 + (x / y); tmp = 0.0; if (z <= -4e+212) tmp = t_2; elseif (z <= -7.2e+29) tmp = t_1; elseif (z <= -3.8e-172) tmp = t_2; elseif (z <= 3.8e-97) tmp = (2.0 / t) / z; elseif ((z <= 2.25e+136) || ~((z <= 3.6e+236))) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+212], t$95$2, If[LessEqual[z, -7.2e+29], t$95$1, If[LessEqual[z, -3.8e-172], t$95$2, If[LessEqual[z, 3.8e-97], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, 2.25e+136], N[Not[LessEqual[z, 3.6e+236]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
t_2 := -2 + \frac{x}{y}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+212}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-172}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-97}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+136} \lor \neg \left(z \leq 3.6 \cdot 10^{+236}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.9999999999999996e212 or -7.19999999999999952e29 < z < -3.79999999999999987e-172 or 3.8000000000000001e-97 < z < 2.25e136 or 3.6e236 < z Initial program 83.5%
Taylor expanded in t around inf 68.6%
if -3.9999999999999996e212 < z < -7.19999999999999952e29 or 2.25e136 < z < 3.6e236Initial program 77.9%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 71.7%
sub-neg71.7%
associate-*r/71.7%
metadata-eval71.7%
metadata-eval71.7%
Simplified71.7%
if -3.79999999999999987e-172 < z < 3.8000000000000001e-97Initial program 98.3%
Taylor expanded in z around 0 93.2%
associate-/r*93.2%
Simplified93.2%
Taylor expanded in t around 0 83.3%
associate-*r/83.3%
metadata-eval83.3%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in z around 0 83.8%
associate-/r*83.8%
Simplified83.8%
Final simplification73.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))) (t_2 (+ -2.0 (/ x y))))
(if (<= z -1.22e+213)
t_2
(if (<= z -1.16e+30)
t_1
(if (<= z -1.35e-171)
t_2
(if (<= z 8.5e-94)
(/ 2.0 (* z t))
(if (or (<= z 1.5e+136) (not (<= z 8e+236))) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = -2.0 + (x / y);
double tmp;
if (z <= -1.22e+213) {
tmp = t_2;
} else if (z <= -1.16e+30) {
tmp = t_1;
} else if (z <= -1.35e-171) {
tmp = t_2;
} else if (z <= 8.5e-94) {
tmp = 2.0 / (z * t);
} else if ((z <= 1.5e+136) || !(z <= 8e+236)) {
tmp = t_2;
} else {
tmp = t_1;
}
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) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / t)
t_2 = (-2.0d0) + (x / y)
if (z <= (-1.22d+213)) then
tmp = t_2
else if (z <= (-1.16d+30)) then
tmp = t_1
else if (z <= (-1.35d-171)) then
tmp = t_2
else if (z <= 8.5d-94) then
tmp = 2.0d0 / (z * t)
else if ((z <= 1.5d+136) .or. (.not. (z <= 8d+236))) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = -2.0 + (x / y);
double tmp;
if (z <= -1.22e+213) {
tmp = t_2;
} else if (z <= -1.16e+30) {
tmp = t_1;
} else if (z <= -1.35e-171) {
tmp = t_2;
} else if (z <= 8.5e-94) {
tmp = 2.0 / (z * t);
} else if ((z <= 1.5e+136) || !(z <= 8e+236)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) t_2 = -2.0 + (x / y) tmp = 0 if z <= -1.22e+213: tmp = t_2 elif z <= -1.16e+30: tmp = t_1 elif z <= -1.35e-171: tmp = t_2 elif z <= 8.5e-94: tmp = 2.0 / (z * t) elif (z <= 1.5e+136) or not (z <= 8e+236): tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / t)) t_2 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (z <= -1.22e+213) tmp = t_2; elseif (z <= -1.16e+30) tmp = t_1; elseif (z <= -1.35e-171) tmp = t_2; elseif (z <= 8.5e-94) tmp = Float64(2.0 / Float64(z * t)); elseif ((z <= 1.5e+136) || !(z <= 8e+236)) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / t); t_2 = -2.0 + (x / y); tmp = 0.0; if (z <= -1.22e+213) tmp = t_2; elseif (z <= -1.16e+30) tmp = t_1; elseif (z <= -1.35e-171) tmp = t_2; elseif (z <= 8.5e-94) tmp = 2.0 / (z * t); elseif ((z <= 1.5e+136) || ~((z <= 8e+236))) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.22e+213], t$95$2, If[LessEqual[z, -1.16e+30], t$95$1, If[LessEqual[z, -1.35e-171], t$95$2, If[LessEqual[z, 8.5e-94], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.5e+136], N[Not[LessEqual[z, 8e+236]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
t_2 := -2 + \frac{x}{y}\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{+213}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-171}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-94}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+136} \lor \neg \left(z \leq 8 \cdot 10^{+236}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2199999999999999e213 or -1.16e30 < z < -1.35000000000000007e-171 or 8.50000000000000003e-94 < z < 1.49999999999999989e136 or 8.00000000000000043e236 < z Initial program 83.5%
Taylor expanded in t around inf 68.6%
if -1.2199999999999999e213 < z < -1.16e30 or 1.49999999999999989e136 < z < 8.00000000000000043e236Initial program 77.9%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 71.7%
sub-neg71.7%
associate-*r/71.7%
metadata-eval71.7%
metadata-eval71.7%
Simplified71.7%
if -1.35000000000000007e-171 < z < 8.50000000000000003e-94Initial program 98.3%
+-commutative98.3%
remove-double-neg98.3%
distribute-frac-neg98.3%
unsub-neg98.3%
*-commutative98.3%
associate-*r*98.3%
distribute-rgt1-in98.3%
associate-/l*98.3%
fma-neg98.3%
*-commutative98.3%
fma-define98.3%
*-commutative98.3%
distribute-frac-neg98.3%
remove-double-neg98.3%
Simplified98.3%
Taylor expanded in t around inf 98.3%
associate--l+98.3%
+-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
+-commutative98.3%
associate-*r/98.3%
distribute-lft-in98.3%
metadata-eval98.3%
associate-*r/98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in z around 0 83.8%
Final simplification73.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 (* z t)))))
(if (<= (/ x y) -2e+63)
(/ x y)
(if (<= (/ x y) -2e-65)
t_1
(if (<= (/ x y) -4e-118)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 5e+73) t_1 (+ -2.0 (/ x y))))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / (z * t));
double tmp;
if ((x / y) <= -2e+63) {
tmp = x / y;
} else if ((x / y) <= -2e-65) {
tmp = t_1;
} else if ((x / y) <= -4e-118) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 5e+73) {
tmp = t_1;
} else {
tmp = -2.0 + (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) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / (z * t))
if ((x / y) <= (-2d+63)) then
tmp = x / y
else if ((x / y) <= (-2d-65)) then
tmp = t_1
else if ((x / y) <= (-4d-118)) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 5d+73) then
tmp = t_1
else
tmp = (-2.0d0) + (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / (z * t));
double tmp;
if ((x / y) <= -2e+63) {
tmp = x / y;
} else if ((x / y) <= -2e-65) {
tmp = t_1;
} else if ((x / y) <= -4e-118) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 5e+73) {
tmp = t_1;
} else {
tmp = -2.0 + (x / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / (z * t)) tmp = 0 if (x / y) <= -2e+63: tmp = x / y elif (x / y) <= -2e-65: tmp = t_1 elif (x / y) <= -4e-118: tmp = -2.0 + (2.0 / t) elif (x / y) <= 5e+73: tmp = t_1 else: tmp = -2.0 + (x / y) return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / Float64(z * t))) tmp = 0.0 if (Float64(x / y) <= -2e+63) tmp = Float64(x / y); elseif (Float64(x / y) <= -2e-65) tmp = t_1; elseif (Float64(x / y) <= -4e-118) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 5e+73) tmp = t_1; else tmp = Float64(-2.0 + Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / (z * t)); tmp = 0.0; if ((x / y) <= -2e+63) tmp = x / y; elseif ((x / y) <= -2e-65) tmp = t_1; elseif ((x / y) <= -4e-118) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 5e+73) tmp = t_1; else tmp = -2.0 + (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2e+63], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2e-65], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -4e-118], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e+73], t$95$1, N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{z \cdot t}\\
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+63}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -4 \cdot 10^{-118}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.00000000000000012e63Initial program 87.0%
Taylor expanded in x around inf 77.7%
if -2.00000000000000012e63 < (/.f64 x y) < -1.99999999999999985e-65 or -3.99999999999999994e-118 < (/.f64 x y) < 4.99999999999999976e73Initial program 84.5%
+-commutative84.5%
remove-double-neg84.5%
distribute-frac-neg84.5%
unsub-neg84.5%
*-commutative84.5%
associate-*r*84.5%
distribute-rgt1-in84.5%
associate-/l*85.1%
fma-neg85.2%
*-commutative85.2%
fma-define85.2%
*-commutative85.2%
distribute-frac-neg85.2%
remove-double-neg85.2%
Simplified85.2%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 92.6%
sub-neg92.6%
metadata-eval92.6%
associate-*r/92.6%
metadata-eval92.6%
+-commutative92.6%
associate-*r/92.6%
metadata-eval92.6%
Simplified92.6%
Taylor expanded in z around 0 71.9%
*-commutative71.9%
Simplified71.9%
if -1.99999999999999985e-65 < (/.f64 x y) < -3.99999999999999994e-118Initial program 99.5%
Taylor expanded in z around inf 90.1%
div-sub90.1%
sub-neg90.1%
*-inverses90.1%
metadata-eval90.1%
distribute-lft-in90.1%
associate-*r/90.1%
metadata-eval90.1%
metadata-eval90.1%
Simplified90.1%
Taylor expanded in x around 0 90.1%
sub-neg90.1%
associate-*r/90.1%
metadata-eval90.1%
metadata-eval90.1%
Simplified90.1%
if 4.99999999999999976e73 < (/.f64 x y) Initial program 87.5%
Taylor expanded in t around inf 74.1%
Final simplification74.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 2.0 (/ 2.0 z))) (t_2 (+ -2.0 (/ x y))))
(if (<= t -3.1e-27)
t_2
(if (<= t 1e-167)
(/ t_1 t)
(if (or (<= t 6.2e-115) (not (<= t 3e-21))) t_2 (* t_1 (/ 1.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 + (2.0 / z);
double t_2 = -2.0 + (x / y);
double tmp;
if (t <= -3.1e-27) {
tmp = t_2;
} else if (t <= 1e-167) {
tmp = t_1 / t;
} else if ((t <= 6.2e-115) || !(t <= 3e-21)) {
tmp = t_2;
} else {
tmp = t_1 * (1.0 / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 + (2.0d0 / z)
t_2 = (-2.0d0) + (x / y)
if (t <= (-3.1d-27)) then
tmp = t_2
else if (t <= 1d-167) then
tmp = t_1 / t
else if ((t <= 6.2d-115) .or. (.not. (t <= 3d-21))) then
tmp = t_2
else
tmp = t_1 * (1.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 + (2.0 / z);
double t_2 = -2.0 + (x / y);
double tmp;
if (t <= -3.1e-27) {
tmp = t_2;
} else if (t <= 1e-167) {
tmp = t_1 / t;
} else if ((t <= 6.2e-115) || !(t <= 3e-21)) {
tmp = t_2;
} else {
tmp = t_1 * (1.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 + (2.0 / z) t_2 = -2.0 + (x / y) tmp = 0 if t <= -3.1e-27: tmp = t_2 elif t <= 1e-167: tmp = t_1 / t elif (t <= 6.2e-115) or not (t <= 3e-21): tmp = t_2 else: tmp = t_1 * (1.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 + Float64(2.0 / z)) t_2 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (t <= -3.1e-27) tmp = t_2; elseif (t <= 1e-167) tmp = Float64(t_1 / t); elseif ((t <= 6.2e-115) || !(t <= 3e-21)) tmp = t_2; else tmp = Float64(t_1 * Float64(1.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 + (2.0 / z); t_2 = -2.0 + (x / y); tmp = 0.0; if (t <= -3.1e-27) tmp = t_2; elseif (t <= 1e-167) tmp = t_1 / t; elseif ((t <= 6.2e-115) || ~((t <= 3e-21))) tmp = t_2; else tmp = t_1 * (1.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.1e-27], t$95$2, If[LessEqual[t, 1e-167], N[(t$95$1 / t), $MachinePrecision], If[Or[LessEqual[t, 6.2e-115], N[Not[LessEqual[t, 3e-21]], $MachinePrecision]], t$95$2, N[(t$95$1 * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 + \frac{2}{z}\\
t_2 := -2 + \frac{x}{y}\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{-27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 10^{-167}:\\
\;\;\;\;\frac{t\_1}{t}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-115} \lor \neg \left(t \leq 3 \cdot 10^{-21}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{1}{t}\\
\end{array}
\end{array}
if t < -3.0999999999999998e-27 or 1e-167 < t < 6.20000000000000013e-115 or 2.99999999999999991e-21 < t Initial program 78.3%
Taylor expanded in t around inf 79.6%
if -3.0999999999999998e-27 < t < 1e-167Initial program 97.5%
Taylor expanded in t around 0 84.7%
associate-*r/84.7%
metadata-eval84.7%
Simplified84.7%
if 6.20000000000000013e-115 < t < 2.99999999999999991e-21Initial program 94.9%
Taylor expanded in t around 0 95.2%
associate-*r/95.2%
metadata-eval95.2%
Simplified95.2%
clear-num95.3%
associate-/r/95.3%
Applied egg-rr95.3%
Final simplification82.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 (* z t)))) (t_2 (+ (/ x y) (+ -2.0 (/ 2.0 t)))))
(if (<= z -6.4e-42)
t_2
(if (<= z -1.8e-143)
t_1
(if (<= z -3.6e-167) (/ x y) (if (<= z 1.4e-59) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / (z * t));
double t_2 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if (z <= -6.4e-42) {
tmp = t_2;
} else if (z <= -1.8e-143) {
tmp = t_1;
} else if (z <= -3.6e-167) {
tmp = x / y;
} else if (z <= 1.4e-59) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / (z * t))
t_2 = (x / y) + ((-2.0d0) + (2.0d0 / t))
if (z <= (-6.4d-42)) then
tmp = t_2
else if (z <= (-1.8d-143)) then
tmp = t_1
else if (z <= (-3.6d-167)) then
tmp = x / y
else if (z <= 1.4d-59) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / (z * t));
double t_2 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if (z <= -6.4e-42) {
tmp = t_2;
} else if (z <= -1.8e-143) {
tmp = t_1;
} else if (z <= -3.6e-167) {
tmp = x / y;
} else if (z <= 1.4e-59) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / (z * t)) t_2 = (x / y) + (-2.0 + (2.0 / t)) tmp = 0 if z <= -6.4e-42: tmp = t_2 elif z <= -1.8e-143: tmp = t_1 elif z <= -3.6e-167: tmp = x / y elif z <= 1.4e-59: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / Float64(z * t))) t_2 = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))) tmp = 0.0 if (z <= -6.4e-42) tmp = t_2; elseif (z <= -1.8e-143) tmp = t_1; elseif (z <= -3.6e-167) tmp = Float64(x / y); elseif (z <= 1.4e-59) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / (z * t)); t_2 = (x / y) + (-2.0 + (2.0 / t)); tmp = 0.0; if (z <= -6.4e-42) tmp = t_2; elseif (z <= -1.8e-143) tmp = t_1; elseif (z <= -3.6e-167) tmp = x / y; elseif (z <= 1.4e-59) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e-42], t$95$2, If[LessEqual[z, -1.8e-143], t$95$1, If[LessEqual[z, -3.6e-167], N[(x / y), $MachinePrecision], If[LessEqual[z, 1.4e-59], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{z \cdot t}\\
t_2 := \frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-167}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.4000000000000005e-42 or 1.3999999999999999e-59 < z Initial program 78.7%
Taylor expanded in z around inf 94.8%
div-sub94.8%
sub-neg94.8%
*-inverses94.8%
metadata-eval94.8%
distribute-lft-in94.8%
associate-*r/94.8%
metadata-eval94.8%
metadata-eval94.8%
Simplified94.8%
if -6.4000000000000005e-42 < z < -1.7999999999999999e-143 or -3.6000000000000001e-167 < z < 1.3999999999999999e-59Initial program 98.8%
+-commutative98.8%
remove-double-neg98.8%
distribute-frac-neg98.8%
unsub-neg98.8%
*-commutative98.8%
associate-*r*98.8%
distribute-rgt1-in98.8%
associate-/l*98.7%
fma-neg98.7%
*-commutative98.7%
fma-define98.7%
*-commutative98.7%
distribute-frac-neg98.7%
remove-double-neg98.7%
Simplified98.7%
Taylor expanded in t around inf 98.8%
associate--l+98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
associate-*r/98.8%
distribute-lft-in98.8%
metadata-eval98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in x around 0 82.9%
sub-neg82.9%
metadata-eval82.9%
associate-*r/82.9%
metadata-eval82.9%
+-commutative82.9%
associate-*r/82.9%
metadata-eval82.9%
Simplified82.9%
Taylor expanded in z around 0 82.9%
*-commutative82.9%
Simplified82.9%
if -1.7999999999999999e-143 < z < -3.6000000000000001e-167Initial program 80.0%
Taylor expanded in x around inf 100.0%
Final simplification90.5%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -2.3e-27)
(and (not (<= t 1e-167)) (or (<= t 1.06e-114) (not (<= t 1.06e-20)))))
(+ -2.0 (/ x y))
(/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.3e-27) || (!(t <= 1e-167) && ((t <= 1.06e-114) || !(t <= 1.06e-20)))) {
tmp = -2.0 + (x / y);
} 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 <= (-2.3d-27)) .or. (.not. (t <= 1d-167)) .and. (t <= 1.06d-114) .or. (.not. (t <= 1.06d-20))) then
tmp = (-2.0d0) + (x / y)
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 <= -2.3e-27) || (!(t <= 1e-167) && ((t <= 1.06e-114) || !(t <= 1.06e-20)))) {
tmp = -2.0 + (x / y);
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.3e-27) or (not (t <= 1e-167) and ((t <= 1.06e-114) or not (t <= 1.06e-20))): tmp = -2.0 + (x / y) else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.3e-27) || (!(t <= 1e-167) && ((t <= 1.06e-114) || !(t <= 1.06e-20)))) tmp = Float64(-2.0 + Float64(x / y)); 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 <= -2.3e-27) || (~((t <= 1e-167)) && ((t <= 1.06e-114) || ~((t <= 1.06e-20))))) tmp = -2.0 + (x / y); else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.3e-27], And[N[Not[LessEqual[t, 1e-167]], $MachinePrecision], Or[LessEqual[t, 1.06e-114], N[Not[LessEqual[t, 1.06e-20]], $MachinePrecision]]]], N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{-27} \lor \neg \left(t \leq 10^{-167}\right) \land \left(t \leq 1.06 \cdot 10^{-114} \lor \neg \left(t \leq 1.06 \cdot 10^{-20}\right)\right):\\
\;\;\;\;-2 + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -2.2999999999999999e-27 or 1e-167 < t < 1.06e-114 or 1.06e-20 < t Initial program 78.3%
Taylor expanded in t around inf 79.6%
if -2.2999999999999999e-27 < t < 1e-167 or 1.06e-114 < t < 1.06e-20Initial program 97.0%
Taylor expanded in t around 0 86.6%
associate-*r/86.6%
metadata-eval86.6%
Simplified86.6%
Final simplification82.5%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e-17) (/ x y) (if (<= (/ x y) -2e-139) (/ 2.0 t) (if (<= (/ x y) 2e-10) -2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-17) {
tmp = x / y;
} else if ((x / y) <= -2e-139) {
tmp = 2.0 / t;
} else if ((x / y) <= 2e-10) {
tmp = -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) <= (-5d-17)) then
tmp = x / y
else if ((x / y) <= (-2d-139)) then
tmp = 2.0d0 / t
else if ((x / y) <= 2d-10) then
tmp = -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) <= -5e-17) {
tmp = x / y;
} else if ((x / y) <= -2e-139) {
tmp = 2.0 / t;
} else if ((x / y) <= 2e-10) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e-17: tmp = x / y elif (x / y) <= -2e-139: tmp = 2.0 / t elif (x / y) <= 2e-10: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e-17) tmp = Float64(x / y); elseif (Float64(x / y) <= -2e-139) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2e-10) tmp = -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) <= -5e-17) tmp = x / y; elseif ((x / y) <= -2e-139) tmp = 2.0 / t; elseif ((x / y) <= 2e-10) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e-17], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2e-139], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-10], -2.0, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{-139}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-10}:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.9999999999999999e-17 or 2.00000000000000007e-10 < (/.f64 x y) Initial program 86.4%
Taylor expanded in x around inf 64.0%
if -4.9999999999999999e-17 < (/.f64 x y) < -2.00000000000000006e-139Initial program 96.1%
Taylor expanded in t around 0 77.4%
associate-*r/77.4%
metadata-eval77.4%
Simplified77.4%
Taylor expanded in z around inf 44.7%
if -2.00000000000000006e-139 < (/.f64 x y) < 2.00000000000000007e-10Initial program 83.0%
+-commutative83.0%
remove-double-neg83.0%
distribute-frac-neg83.0%
unsub-neg83.0%
*-commutative83.0%
associate-*r*83.0%
distribute-rgt1-in83.0%
associate-/l*83.9%
fma-neg83.9%
*-commutative83.9%
fma-define83.9%
*-commutative83.9%
distribute-frac-neg83.9%
remove-double-neg83.9%
Simplified83.9%
Taylor expanded in x around 0 83.9%
Taylor expanded in t around inf 41.8%
Final simplification53.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.1e-32) (not (<= z 2.7e-26))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.1e-32) || !(z <= 2.7e-26)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
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 <= (-5.1d-32)) .or. (.not. (z <= 2.7d-26))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.1e-32) || !(z <= 2.7e-26)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.1e-32) or not (z <= 2.7e-26): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.1e-32) || !(z <= 2.7e-26)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.1e-32) || ~((z <= 2.7e-26))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.1e-32], N[Not[LessEqual[z, 2.7e-26]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{-32} \lor \neg \left(z \leq 2.7 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -5.09999999999999994e-32 or 2.69999999999999982e-26 < z Initial program 77.7%
Taylor expanded in z around inf 96.4%
div-sub96.4%
sub-neg96.4%
*-inverses96.4%
metadata-eval96.4%
distribute-lft-in96.4%
associate-*r/96.4%
metadata-eval96.4%
metadata-eval96.4%
Simplified96.4%
if -5.09999999999999994e-32 < z < 2.69999999999999982e-26Initial program 98.0%
Taylor expanded in z around 0 90.0%
associate-/r*90.0%
Simplified90.0%
Final simplification93.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e-12) (not (<= (/ x y) 2e-8))) (+ -2.0 (/ x y)) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e-12) || !((x / y) <= 2e-8)) {
tmp = -2.0 + (x / y);
} else {
tmp = -2.0 + (2.0 / 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 (((x / y) <= (-5d-12)) .or. (.not. ((x / y) <= 2d-8))) then
tmp = (-2.0d0) + (x / y)
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e-12) || !((x / y) <= 2e-8)) {
tmp = -2.0 + (x / y);
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e-12) or not ((x / y) <= 2e-8): tmp = -2.0 + (x / y) else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e-12) || !(Float64(x / y) <= 2e-8)) tmp = Float64(-2.0 + Float64(x / y)); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5e-12) || ~(((x / y) <= 2e-8))) tmp = -2.0 + (x / y); else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e-12], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-8]], $MachinePrecision]], N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-12} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-8}\right):\\
\;\;\;\;-2 + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.9999999999999997e-12 or 2e-8 < (/.f64 x y) Initial program 86.2%
Taylor expanded in t around inf 67.9%
if -4.9999999999999997e-12 < (/.f64 x y) < 2e-8Initial program 86.2%
Taylor expanded in z around inf 64.5%
div-sub64.5%
sub-neg64.5%
*-inverses64.5%
metadata-eval64.5%
distribute-lft-in64.5%
associate-*r/64.5%
metadata-eval64.5%
metadata-eval64.5%
Simplified64.5%
Taylor expanded in x around 0 64.5%
sub-neg64.5%
associate-*r/64.5%
metadata-eval64.5%
metadata-eval64.5%
Simplified64.5%
Final simplification66.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -100000000.0) (not (<= (/ x y) 2e-8))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -100000000.0) || !((x / y) <= 2e-8)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / 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 (((x / y) <= (-100000000.0d0)) .or. (.not. ((x / y) <= 2d-8))) then
tmp = x / y
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -100000000.0) || !((x / y) <= 2e-8)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -100000000.0) or not ((x / y) <= 2e-8): tmp = x / y else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -100000000.0) || !(Float64(x / y) <= 2e-8)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -100000000.0) || ~(((x / y) <= 2e-8))) tmp = x / y; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -100000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-8]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -100000000 \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e8 or 2e-8 < (/.f64 x y) Initial program 86.8%
Taylor expanded in x around inf 65.7%
if -1e8 < (/.f64 x y) < 2e-8Initial program 85.6%
Taylor expanded in z around inf 64.3%
div-sub64.3%
sub-neg64.3%
*-inverses64.3%
metadata-eval64.3%
distribute-lft-in64.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
Simplified64.3%
Taylor expanded in x around 0 64.1%
sub-neg64.1%
associate-*r/64.1%
metadata-eval64.1%
metadata-eval64.1%
Simplified64.1%
Final simplification64.9%
(FPCore (x y z t) :precision binary64 (if (<= t -15000000000000.0) -2.0 (if (<= t 3.7e-6) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -15000000000000.0) {
tmp = -2.0;
} else if (t <= 3.7e-6) {
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 <= (-15000000000000.0d0)) then
tmp = -2.0d0
else if (t <= 3.7d-6) 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 <= -15000000000000.0) {
tmp = -2.0;
} else if (t <= 3.7e-6) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -15000000000000.0: tmp = -2.0 elif t <= 3.7e-6: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -15000000000000.0) tmp = -2.0; elseif (t <= 3.7e-6) 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 <= -15000000000000.0) tmp = -2.0; elseif (t <= 3.7e-6) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -15000000000000.0], -2.0, If[LessEqual[t, 3.7e-6], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -15000000000000:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.5e13 or 3.7000000000000002e-6 < t Initial program 74.7%
+-commutative74.7%
remove-double-neg74.7%
distribute-frac-neg74.7%
unsub-neg74.7%
*-commutative74.7%
associate-*r*74.7%
distribute-rgt1-in74.7%
associate-/l*74.6%
fma-neg74.6%
*-commutative74.6%
fma-define74.6%
*-commutative74.6%
distribute-frac-neg74.6%
remove-double-neg74.6%
Simplified74.6%
Taylor expanded in x around 0 44.1%
Taylor expanded in t around inf 37.8%
if -1.5e13 < t < 3.7000000000000002e-6Initial program 97.5%
Taylor expanded in t around 0 76.3%
associate-*r/76.3%
metadata-eval76.3%
Simplified76.3%
Taylor expanded in z around inf 34.7%
Final simplification36.2%
(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%
+-commutative86.2%
remove-double-neg86.2%
distribute-frac-neg86.2%
unsub-neg86.2%
*-commutative86.2%
associate-*r*86.2%
distribute-rgt1-in86.2%
associate-/l*86.5%
fma-neg86.5%
*-commutative86.5%
fma-define86.5%
*-commutative86.5%
distribute-frac-neg86.5%
remove-double-neg86.5%
Simplified86.5%
Taylor expanded in x around 0 60.5%
Taylor expanded in t around inf 20.0%
Final simplification20.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 2024085
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))