
(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 (/ x y)) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t);
}
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) + (x / y)) + ((2.0d0 + (2.0d0 / z)) / t)
end function
public static double code(double x, double y, double z, double t) {
return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t);
}
def code(x, y, z, t): return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t)
function code(x, y, z, t) return Float64(Float64(-2.0 + Float64(x / y)) + Float64(Float64(2.0 + Float64(2.0 / z)) / t)) end
function tmp = code(x, y, z, t) tmp = (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t); end
code[x_, y_, z_, t_] := N[(N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-2 + \frac{x}{y}\right) + \frac{2 + \frac{2}{z}}{t}
\end{array}
Initial program 83.5%
+-commutative83.5%
remove-double-neg83.5%
distribute-frac-neg83.5%
unsub-neg83.5%
*-commutative83.5%
associate-*r*83.5%
distribute-rgt1-in83.5%
associate-/l*83.4%
fma-neg83.4%
*-commutative83.4%
fma-define83.4%
*-commutative83.4%
distribute-frac-neg83.4%
remove-double-neg83.4%
Simplified83.4%
Taylor expanded in t around inf 99.2%
associate--l+99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
associate-*r/99.2%
distribute-lft-in99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -5.2e+164)
t_2
(if (<= z -5.6e-22)
t_1
(if (<= z 3.9e-97)
(/ 2.0 (* z t))
(if (<= z 690000000.0)
t_1
(if (<= z 2.3e+68)
t_2
(if (or (<= z 1.2e+151) (not (<= z 1.82e+174)))
t_1
(/ 2.0 t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -5.2e+164) {
tmp = t_2;
} else if (z <= -5.6e-22) {
tmp = t_1;
} else if (z <= 3.9e-97) {
tmp = 2.0 / (z * t);
} else if (z <= 690000000.0) {
tmp = t_1;
} else if (z <= 2.3e+68) {
tmp = t_2;
} else if ((z <= 1.2e+151) || !(z <= 1.82e+174)) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) - 2.0d0
t_2 = (-2.0d0) + (2.0d0 / t)
if (z <= (-5.2d+164)) then
tmp = t_2
else if (z <= (-5.6d-22)) then
tmp = t_1
else if (z <= 3.9d-97) then
tmp = 2.0d0 / (z * t)
else if (z <= 690000000.0d0) then
tmp = t_1
else if (z <= 2.3d+68) then
tmp = t_2
else if ((z <= 1.2d+151) .or. (.not. (z <= 1.82d+174))) then
tmp = t_1
else
tmp = 2.0d0 / t
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;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -5.2e+164) {
tmp = t_2;
} else if (z <= -5.6e-22) {
tmp = t_1;
} else if (z <= 3.9e-97) {
tmp = 2.0 / (z * t);
} else if (z <= 690000000.0) {
tmp = t_1;
} else if (z <= 2.3e+68) {
tmp = t_2;
} else if ((z <= 1.2e+151) || !(z <= 1.82e+174)) {
tmp = t_1;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 t_2 = -2.0 + (2.0 / t) tmp = 0 if z <= -5.2e+164: tmp = t_2 elif z <= -5.6e-22: tmp = t_1 elif z <= 3.9e-97: tmp = 2.0 / (z * t) elif z <= 690000000.0: tmp = t_1 elif z <= 2.3e+68: tmp = t_2 elif (z <= 1.2e+151) or not (z <= 1.82e+174): tmp = t_1 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (z <= -5.2e+164) tmp = t_2; elseif (z <= -5.6e-22) tmp = t_1; elseif (z <= 3.9e-97) tmp = Float64(2.0 / Float64(z * t)); elseif (z <= 690000000.0) tmp = t_1; elseif (z <= 2.3e+68) tmp = t_2; elseif ((z <= 1.2e+151) || !(z <= 1.82e+174)) tmp = t_1; else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; t_2 = -2.0 + (2.0 / t); tmp = 0.0; if (z <= -5.2e+164) tmp = t_2; elseif (z <= -5.6e-22) tmp = t_1; elseif (z <= 3.9e-97) tmp = 2.0 / (z * t); elseif (z <= 690000000.0) tmp = t_1; elseif (z <= 2.3e+68) tmp = t_2; elseif ((z <= 1.2e+151) || ~((z <= 1.82e+174))) tmp = t_1; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+164], t$95$2, If[LessEqual[z, -5.6e-22], t$95$1, If[LessEqual[z, 3.9e-97], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 690000000.0], t$95$1, If[LessEqual[z, 2.3e+68], t$95$2, If[Or[LessEqual[z, 1.2e+151], N[Not[LessEqual[z, 1.82e+174]], $MachinePrecision]], t$95$1, N[(2.0 / t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+164}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-97}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 690000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+151} \lor \neg \left(z \leq 1.82 \cdot 10^{+174}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if z < -5.1999999999999998e164 or 6.9e8 < z < 2.3e68Initial program 72.3%
Taylor expanded in z around inf 98.0%
div-sub98.0%
sub-neg98.0%
*-inverses98.0%
metadata-eval98.0%
distribute-lft-in98.0%
associate-*r/98.0%
metadata-eval98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in x around 0 74.8%
sub-neg74.8%
associate-*r/74.8%
metadata-eval74.8%
metadata-eval74.8%
Simplified74.8%
if -5.1999999999999998e164 < z < -5.5999999999999999e-22 or 3.8999999999999998e-97 < z < 6.9e8 or 2.3e68 < z < 1.20000000000000005e151 or 1.8199999999999999e174 < z Initial program 72.1%
Taylor expanded in t around inf 79.3%
if -5.5999999999999999e-22 < z < 3.8999999999999998e-97Initial program 98.9%
+-commutative98.9%
remove-double-neg98.9%
distribute-frac-neg98.9%
unsub-neg98.9%
*-commutative98.9%
associate-*r*98.9%
distribute-rgt1-in98.9%
associate-/l*98.9%
fma-neg98.9%
*-commutative98.9%
fma-define98.9%
*-commutative98.9%
distribute-frac-neg98.9%
remove-double-neg98.9%
Simplified98.9%
Taylor expanded in t around inf 98.9%
associate--l+98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
associate-*r/98.9%
distribute-lft-in98.9%
metadata-eval98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around 0 70.5%
if 1.20000000000000005e151 < z < 1.8199999999999999e174Initial program 100.0%
Taylor expanded in t around 0 100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Final simplification75.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -6.3e+164)
t_2
(if (<= z -3.3e-22)
t_1
(if (<= z 3.7e-97)
(/ (/ 2.0 t) z)
(if (<= z 940000000.0)
t_1
(if (<= z 1.08e+70)
t_2
(if (or (<= z 1.02e+152) (not (<= z 2.8e+174)))
t_1
(/ 2.0 t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -6.3e+164) {
tmp = t_2;
} else if (z <= -3.3e-22) {
tmp = t_1;
} else if (z <= 3.7e-97) {
tmp = (2.0 / t) / z;
} else if (z <= 940000000.0) {
tmp = t_1;
} else if (z <= 1.08e+70) {
tmp = t_2;
} else if ((z <= 1.02e+152) || !(z <= 2.8e+174)) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) - 2.0d0
t_2 = (-2.0d0) + (2.0d0 / t)
if (z <= (-6.3d+164)) then
tmp = t_2
else if (z <= (-3.3d-22)) then
tmp = t_1
else if (z <= 3.7d-97) then
tmp = (2.0d0 / t) / z
else if (z <= 940000000.0d0) then
tmp = t_1
else if (z <= 1.08d+70) then
tmp = t_2
else if ((z <= 1.02d+152) .or. (.not. (z <= 2.8d+174))) then
tmp = t_1
else
tmp = 2.0d0 / t
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;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -6.3e+164) {
tmp = t_2;
} else if (z <= -3.3e-22) {
tmp = t_1;
} else if (z <= 3.7e-97) {
tmp = (2.0 / t) / z;
} else if (z <= 940000000.0) {
tmp = t_1;
} else if (z <= 1.08e+70) {
tmp = t_2;
} else if ((z <= 1.02e+152) || !(z <= 2.8e+174)) {
tmp = t_1;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 t_2 = -2.0 + (2.0 / t) tmp = 0 if z <= -6.3e+164: tmp = t_2 elif z <= -3.3e-22: tmp = t_1 elif z <= 3.7e-97: tmp = (2.0 / t) / z elif z <= 940000000.0: tmp = t_1 elif z <= 1.08e+70: tmp = t_2 elif (z <= 1.02e+152) or not (z <= 2.8e+174): tmp = t_1 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (z <= -6.3e+164) tmp = t_2; elseif (z <= -3.3e-22) tmp = t_1; elseif (z <= 3.7e-97) tmp = Float64(Float64(2.0 / t) / z); elseif (z <= 940000000.0) tmp = t_1; elseif (z <= 1.08e+70) tmp = t_2; elseif ((z <= 1.02e+152) || !(z <= 2.8e+174)) tmp = t_1; else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; t_2 = -2.0 + (2.0 / t); tmp = 0.0; if (z <= -6.3e+164) tmp = t_2; elseif (z <= -3.3e-22) tmp = t_1; elseif (z <= 3.7e-97) tmp = (2.0 / t) / z; elseif (z <= 940000000.0) tmp = t_1; elseif (z <= 1.08e+70) tmp = t_2; elseif ((z <= 1.02e+152) || ~((z <= 2.8e+174))) tmp = t_1; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.3e+164], t$95$2, If[LessEqual[z, -3.3e-22], t$95$1, If[LessEqual[z, 3.7e-97], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 940000000.0], t$95$1, If[LessEqual[z, 1.08e+70], t$95$2, If[Or[LessEqual[z, 1.02e+152], N[Not[LessEqual[z, 2.8e+174]], $MachinePrecision]], t$95$1, N[(2.0 / t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -6.3 \cdot 10^{+164}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-97}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;z \leq 940000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+70}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+152} \lor \neg \left(z \leq 2.8 \cdot 10^{+174}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if z < -6.29999999999999996e164 or 9.4e8 < z < 1.0799999999999999e70Initial program 72.3%
Taylor expanded in z around inf 98.0%
div-sub98.0%
sub-neg98.0%
*-inverses98.0%
metadata-eval98.0%
distribute-lft-in98.0%
associate-*r/98.0%
metadata-eval98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in x around 0 74.8%
sub-neg74.8%
associate-*r/74.8%
metadata-eval74.8%
metadata-eval74.8%
Simplified74.8%
if -6.29999999999999996e164 < z < -3.3000000000000001e-22 or 3.69999999999999976e-97 < z < 9.4e8 or 1.0799999999999999e70 < z < 1.01999999999999999e152 or 2.7999999999999999e174 < z Initial program 72.1%
Taylor expanded in t around inf 79.3%
if -3.3000000000000001e-22 < z < 3.69999999999999976e-97Initial program 98.9%
+-commutative98.9%
remove-double-neg98.9%
distribute-frac-neg98.9%
unsub-neg98.9%
*-commutative98.9%
associate-*r*98.9%
distribute-rgt1-in98.9%
associate-/l*98.9%
fma-neg98.9%
*-commutative98.9%
fma-define98.9%
*-commutative98.9%
distribute-frac-neg98.9%
remove-double-neg98.9%
Simplified98.9%
Taylor expanded in t around inf 98.9%
associate--l+98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
associate-*r/98.9%
distribute-lft-in98.9%
metadata-eval98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in x around -inf 86.0%
Simplified86.1%
Taylor expanded in z around 0 70.5%
associate-/r*70.5%
Simplified70.5%
if 1.01999999999999999e152 < z < 2.7999999999999999e174Initial program 100.0%
Taylor expanded in t around 0 100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Final simplification75.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -1.22e+166)
t_2
(if (<= z -5.5e-20)
t_1
(if (<= z 3.2e-97)
(/ (/ 2.0 z) t)
(if (<= z 950000000.0)
t_1
(if (<= z 8e+68)
t_2
(if (or (<= z 1.8e+153) (not (<= z 9.2e+173)))
t_1
(/ 2.0 t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -1.22e+166) {
tmp = t_2;
} else if (z <= -5.5e-20) {
tmp = t_1;
} else if (z <= 3.2e-97) {
tmp = (2.0 / z) / t;
} else if (z <= 950000000.0) {
tmp = t_1;
} else if (z <= 8e+68) {
tmp = t_2;
} else if ((z <= 1.8e+153) || !(z <= 9.2e+173)) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) - 2.0d0
t_2 = (-2.0d0) + (2.0d0 / t)
if (z <= (-1.22d+166)) then
tmp = t_2
else if (z <= (-5.5d-20)) then
tmp = t_1
else if (z <= 3.2d-97) then
tmp = (2.0d0 / z) / t
else if (z <= 950000000.0d0) then
tmp = t_1
else if (z <= 8d+68) then
tmp = t_2
else if ((z <= 1.8d+153) .or. (.not. (z <= 9.2d+173))) then
tmp = t_1
else
tmp = 2.0d0 / t
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;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -1.22e+166) {
tmp = t_2;
} else if (z <= -5.5e-20) {
tmp = t_1;
} else if (z <= 3.2e-97) {
tmp = (2.0 / z) / t;
} else if (z <= 950000000.0) {
tmp = t_1;
} else if (z <= 8e+68) {
tmp = t_2;
} else if ((z <= 1.8e+153) || !(z <= 9.2e+173)) {
tmp = t_1;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 t_2 = -2.0 + (2.0 / t) tmp = 0 if z <= -1.22e+166: tmp = t_2 elif z <= -5.5e-20: tmp = t_1 elif z <= 3.2e-97: tmp = (2.0 / z) / t elif z <= 950000000.0: tmp = t_1 elif z <= 8e+68: tmp = t_2 elif (z <= 1.8e+153) or not (z <= 9.2e+173): tmp = t_1 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (z <= -1.22e+166) tmp = t_2; elseif (z <= -5.5e-20) tmp = t_1; elseif (z <= 3.2e-97) tmp = Float64(Float64(2.0 / z) / t); elseif (z <= 950000000.0) tmp = t_1; elseif (z <= 8e+68) tmp = t_2; elseif ((z <= 1.8e+153) || !(z <= 9.2e+173)) tmp = t_1; else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; t_2 = -2.0 + (2.0 / t); tmp = 0.0; if (z <= -1.22e+166) tmp = t_2; elseif (z <= -5.5e-20) tmp = t_1; elseif (z <= 3.2e-97) tmp = (2.0 / z) / t; elseif (z <= 950000000.0) tmp = t_1; elseif (z <= 8e+68) tmp = t_2; elseif ((z <= 1.8e+153) || ~((z <= 9.2e+173))) tmp = t_1; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.22e+166], t$95$2, If[LessEqual[z, -5.5e-20], t$95$1, If[LessEqual[z, 3.2e-97], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 950000000.0], t$95$1, If[LessEqual[z, 8e+68], t$95$2, If[Or[LessEqual[z, 1.8e+153], N[Not[LessEqual[z, 9.2e+173]], $MachinePrecision]], t$95$1, N[(2.0 / t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{+166}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-97}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 950000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+153} \lor \neg \left(z \leq 9.2 \cdot 10^{+173}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if z < -1.21999999999999993e166 or 9.5e8 < z < 7.99999999999999962e68Initial program 72.3%
Taylor expanded in z around inf 98.0%
div-sub98.0%
sub-neg98.0%
*-inverses98.0%
metadata-eval98.0%
distribute-lft-in98.0%
associate-*r/98.0%
metadata-eval98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in x around 0 74.8%
sub-neg74.8%
associate-*r/74.8%
metadata-eval74.8%
metadata-eval74.8%
Simplified74.8%
if -1.21999999999999993e166 < z < -5.4999999999999996e-20 or 3.1999999999999998e-97 < z < 9.5e8 or 7.99999999999999962e68 < z < 1.8e153 or 9.1999999999999998e173 < z Initial program 72.1%
Taylor expanded in t around inf 79.3%
if -5.4999999999999996e-20 < z < 3.1999999999999998e-97Initial program 98.9%
Taylor expanded in t around 0 70.5%
associate-*r/70.5%
metadata-eval70.5%
Simplified70.5%
Taylor expanded in z around 0 70.5%
if 1.8e153 < z < 9.1999999999999998e173Initial program 100.0%
Taylor expanded in t around 0 100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Final simplification75.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ (/ 2.0 z) t))))
(if (<= (/ x y) -5.6e+32)
(/ x y)
(if (<= (/ x y) -4e-319)
t_1
(if (<= (/ x y) 9.5e-308)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 2.7e-9) t_1 (- (/ x y) 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + ((2.0 / z) / t);
double tmp;
if ((x / y) <= -5.6e+32) {
tmp = x / y;
} else if ((x / y) <= -4e-319) {
tmp = t_1;
} else if ((x / y) <= 9.5e-308) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 2.7e-9) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) + ((2.0d0 / z) / t)
if ((x / y) <= (-5.6d+32)) then
tmp = x / y
else if ((x / y) <= (-4d-319)) then
tmp = t_1
else if ((x / y) <= 9.5d-308) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 2.7d-9) then
tmp = t_1
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 t_1 = -2.0 + ((2.0 / z) / t);
double tmp;
if ((x / y) <= -5.6e+32) {
tmp = x / y;
} else if ((x / y) <= -4e-319) {
tmp = t_1;
} else if ((x / y) <= 9.5e-308) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 2.7e-9) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + ((2.0 / z) / t) tmp = 0 if (x / y) <= -5.6e+32: tmp = x / y elif (x / y) <= -4e-319: tmp = t_1 elif (x / y) <= 9.5e-308: tmp = -2.0 + (2.0 / t) elif (x / y) <= 2.7e-9: tmp = t_1 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(Float64(2.0 / z) / t)) tmp = 0.0 if (Float64(x / y) <= -5.6e+32) tmp = Float64(x / y); elseif (Float64(x / y) <= -4e-319) tmp = t_1; elseif (Float64(x / y) <= 9.5e-308) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 2.7e-9) tmp = t_1; else tmp = Float64(Float64(x / y) - 2.0); 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) <= -5.6e+32) tmp = x / y; elseif ((x / y) <= -4e-319) tmp = t_1; elseif ((x / y) <= 9.5e-308) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 2.7e-9) tmp = t_1; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5.6e+32], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -4e-319], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 9.5e-308], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.7e-9], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{\frac{2}{z}}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -5.6 \cdot 10^{+32}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -4 \cdot 10^{-319}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 9.5 \cdot 10^{-308}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2.7 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -5.6e32Initial program 73.4%
Taylor expanded in x around inf 77.3%
if -5.6e32 < (/.f64 x y) < -4.0000049e-319 or 9.49999999999999963e-308 < (/.f64 x y) < 2.7000000000000002e-9Initial program 89.2%
+-commutative89.2%
remove-double-neg89.2%
distribute-frac-neg89.2%
unsub-neg89.2%
*-commutative89.2%
associate-*r*89.2%
distribute-rgt1-in89.2%
associate-/l*89.1%
fma-neg89.1%
*-commutative89.1%
fma-define89.1%
*-commutative89.1%
distribute-frac-neg89.1%
remove-double-neg89.1%
Simplified89.1%
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 97.9%
associate--l+97.9%
associate-*r/97.9%
metadata-eval97.9%
sub-neg97.9%
metadata-eval97.9%
associate-+l+97.9%
+-commutative97.9%
associate-/r*97.8%
associate-*r/97.8%
*-commutative97.8%
associate-/l*97.7%
metadata-eval97.7%
associate-*l/97.7%
distribute-lft-in97.8%
+-commutative97.8%
*-commutative97.8%
associate-*r/97.9%
*-rgt-identity97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in z around 0 75.7%
if -4.0000049e-319 < (/.f64 x y) < 9.49999999999999963e-308Initial program 80.5%
Taylor expanded in z around inf 78.7%
div-sub78.7%
sub-neg78.7%
*-inverses78.7%
metadata-eval78.7%
distribute-lft-in78.7%
associate-*r/78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.7%
Taylor expanded in x around 0 78.7%
sub-neg78.7%
associate-*r/78.7%
metadata-eval78.7%
metadata-eval78.7%
Simplified78.7%
if 2.7000000000000002e-9 < (/.f64 x y) Initial program 85.6%
Taylor expanded in t around inf 69.2%
Final simplification74.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (+ -2.0 (/ 2.0 t)))))
(if (<= z -6.4)
t_1
(if (<= z -2.4e-107)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(if (<= z 6.7e-90) (+ (/ x y) (/ (/ 2.0 t) z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if (z <= -6.4) {
tmp = t_1;
} else if (z <= -2.4e-107) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else if (z <= 6.7e-90) {
tmp = (x / y) + ((2.0 / t) / z);
} 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) :: tmp
t_1 = (x / y) + ((-2.0d0) + (2.0d0 / t))
if (z <= (-6.4d0)) then
tmp = t_1
else if (z <= (-2.4d-107)) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else if (z <= 6.7d-90) then
tmp = (x / y) + ((2.0d0 / t) / z)
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 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if (z <= -6.4) {
tmp = t_1;
} else if (z <= -2.4e-107) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else if (z <= 6.7e-90) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (-2.0 + (2.0 / t)) tmp = 0 if z <= -6.4: tmp = t_1 elif z <= -2.4e-107: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) elif z <= 6.7e-90: tmp = (x / y) + ((2.0 / t) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))) tmp = 0.0 if (z <= -6.4) tmp = t_1; elseif (z <= -2.4e-107) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); elseif (z <= 6.7e-90) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (-2.0 + (2.0 / t)); tmp = 0.0; if (z <= -6.4) tmp = t_1; elseif (z <= -2.4e-107) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); elseif (z <= 6.7e-90) tmp = (x / y) + ((2.0 / t) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4], t$95$1, If[LessEqual[z, -2.4e-107], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.7e-90], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{if}\;z \leq -6.4:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-107}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 6.7 \cdot 10^{-90}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.4000000000000004 or 6.7000000000000004e-90 < z Initial program 72.2%
Taylor expanded in z around inf 96.1%
div-sub96.1%
sub-neg96.1%
*-inverses96.1%
metadata-eval96.1%
distribute-lft-in96.1%
associate-*r/96.1%
metadata-eval96.1%
metadata-eval96.1%
Simplified96.1%
if -6.4000000000000004 < z < -2.39999999999999994e-107Initial program 99.7%
+-commutative99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
unsub-neg99.7%
*-commutative99.7%
associate-*r*99.7%
distribute-rgt1-in99.7%
associate-/l*99.6%
fma-neg99.6%
*-commutative99.6%
fma-define99.6%
*-commutative99.6%
distribute-frac-neg99.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 99.7%
associate--l+99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
associate-*r/99.7%
distribute-lft-in99.7%
metadata-eval99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*99.7%
associate-*r/99.7%
*-commutative99.7%
associate-/l*99.5%
metadata-eval99.5%
associate-*l/99.5%
distribute-lft-in99.6%
+-commutative99.6%
*-commutative99.6%
associate-*r/99.7%
*-rgt-identity99.7%
+-commutative99.7%
Simplified99.7%
if -2.39999999999999994e-107 < z < 6.7000000000000004e-90Initial program 98.8%
Taylor expanded in z around 0 94.3%
associate-/r*94.3%
Simplified94.3%
Final simplification95.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5.6e+32) (not (<= (/ x y) 2.7e-9))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5.6e+32) || !((x / y) <= 2.7e-9)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + ((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 (((x / y) <= (-5.6d+32)) .or. (.not. ((x / y) <= 2.7d-9))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (-2.0d0) + ((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 (((x / y) <= -5.6e+32) || !((x / y) <= 2.7e-9)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5.6e+32) or not ((x / y) <= 2.7e-9): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5.6e+32) || !(Float64(x / y) <= 2.7e-9)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(-2.0 + 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 (((x / y) <= -5.6e+32) || ~(((x / y) <= 2.7e-9))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5.6e+32], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.7e-9]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5.6 \cdot 10^{+32} \lor \neg \left(\frac{x}{y} \leq 2.7 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -5.6e32 or 2.7000000000000002e-9 < (/.f64 x y) Initial program 79.5%
Taylor expanded in z around inf 83.1%
div-sub83.1%
sub-neg83.1%
*-inverses83.1%
metadata-eval83.1%
distribute-lft-in83.1%
associate-*r/83.1%
metadata-eval83.1%
metadata-eval83.1%
Simplified83.1%
if -5.6e32 < (/.f64 x y) < 2.7000000000000002e-9Initial program 87.4%
+-commutative87.4%
remove-double-neg87.4%
distribute-frac-neg87.4%
unsub-neg87.4%
*-commutative87.4%
associate-*r*87.4%
distribute-rgt1-in87.4%
associate-/l*87.3%
fma-neg87.3%
*-commutative87.3%
fma-define87.3%
*-commutative87.3%
distribute-frac-neg87.3%
remove-double-neg87.3%
Simplified87.3%
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 98.3%
associate--l+98.3%
associate-*r/98.3%
metadata-eval98.3%
sub-neg98.3%
metadata-eval98.3%
associate-+l+98.3%
+-commutative98.3%
associate-/r*98.2%
associate-*r/98.2%
*-commutative98.2%
associate-/l*98.2%
metadata-eval98.2%
associate-*l/98.2%
distribute-lft-in98.2%
+-commutative98.2%
*-commutative98.2%
associate-*r/98.3%
*-rgt-identity98.3%
+-commutative98.3%
Simplified98.3%
Final simplification90.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -8.6e+22) (not (<= (/ x y) 4500.0))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -8.6e+22) || !((x / y) <= 4500.0)) {
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) <= (-8.6d+22)) .or. (.not. ((x / y) <= 4500.0d0))) 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) <= -8.6e+22) || !((x / y) <= 4500.0)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -8.6e+22) or not ((x / y) <= 4500.0): 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) <= -8.6e+22) || !(Float64(x / y) <= 4500.0)) 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) <= -8.6e+22) || ~(((x / y) <= 4500.0))) 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], -8.6e+22], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4500.0]], $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 -8.6 \cdot 10^{+22} \lor \neg \left(\frac{x}{y} \leq 4500\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -8.6000000000000004e22 or 4500 < (/.f64 x y) Initial program 80.5%
Taylor expanded in x around inf 71.7%
if -8.6000000000000004e22 < (/.f64 x y) < 4500Initial program 86.4%
Taylor expanded in z around inf 57.5%
div-sub57.5%
sub-neg57.5%
*-inverses57.5%
metadata-eval57.5%
distribute-lft-in57.5%
associate-*r/57.5%
metadata-eval57.5%
metadata-eval57.5%
Simplified57.5%
Taylor expanded in x around 0 56.4%
sub-neg56.4%
associate-*r/56.4%
metadata-eval56.4%
metadata-eval56.4%
Simplified56.4%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.5e+74) (not (<= t 920000000.0))) (- (/ x y) 2.0) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.5e+74) || !(t <= 920000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + ((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 <= (-4.5d+74)) .or. (.not. (t <= 920000000.0d0))) then
tmp = (x / y) - 2.0d0
else
tmp = (-2.0d0) + ((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 <= -4.5e+74) || !(t <= 920000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.5e+74) or not (t <= 920000000.0): tmp = (x / y) - 2.0 else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.5e+74) || !(t <= 920000000.0)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(-2.0 + 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 <= -4.5e+74) || ~((t <= 920000000.0))) tmp = (x / y) - 2.0; else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.5e+74], N[Not[LessEqual[t, 920000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+74} \lor \neg \left(t \leq 920000000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -4.5e74 or 9.2e8 < t Initial program 66.0%
Taylor expanded in t around inf 89.2%
if -4.5e74 < t < 9.2e8Initial program 97.7%
+-commutative97.7%
remove-double-neg97.7%
distribute-frac-neg97.7%
unsub-neg97.7%
*-commutative97.7%
associate-*r*97.7%
distribute-rgt1-in97.7%
associate-/l*97.6%
fma-neg97.6%
*-commutative97.6%
fma-define97.6%
*-commutative97.6%
distribute-frac-neg97.6%
remove-double-neg97.6%
Simplified97.6%
Taylor expanded in t around inf 98.5%
associate--l+98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
+-commutative98.5%
associate-*r/98.5%
distribute-lft-in98.5%
metadata-eval98.5%
associate-*r/98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in x around 0 82.1%
associate--l+82.1%
associate-*r/82.1%
metadata-eval82.1%
sub-neg82.1%
metadata-eval82.1%
associate-+l+82.1%
+-commutative82.1%
associate-/r*82.1%
associate-*r/82.1%
*-commutative82.1%
associate-/l*82.0%
metadata-eval82.0%
associate-*l/82.0%
distribute-lft-in82.1%
+-commutative82.1%
*-commutative82.1%
associate-*r/82.1%
*-rgt-identity82.1%
+-commutative82.1%
Simplified82.1%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -3.4e+23) (/ x y) (if (<= (/ x y) 6.8e-8) (+ -2.0 (/ 2.0 t)) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -3.4e+23) {
tmp = x / y;
} else if ((x / y) <= 6.8e-8) {
tmp = -2.0 + (2.0 / t);
} 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) <= (-3.4d+23)) then
tmp = x / y
else if ((x / y) <= 6.8d-8) then
tmp = (-2.0d0) + (2.0d0 / t)
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) <= -3.4e+23) {
tmp = x / y;
} else if ((x / y) <= 6.8e-8) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -3.4e+23: tmp = x / y elif (x / y) <= 6.8e-8: tmp = -2.0 + (2.0 / t) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -3.4e+23) tmp = Float64(x / y); elseif (Float64(x / y) <= 6.8e-8) tmp = Float64(-2.0 + Float64(2.0 / t)); 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) <= -3.4e+23) tmp = x / y; elseif ((x / y) <= 6.8e-8) tmp = -2.0 + (2.0 / t); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -3.4e+23], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 6.8e-8], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3.4 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 6.8 \cdot 10^{-8}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.39999999999999992e23Initial program 75.0%
Taylor expanded in x around inf 74.3%
if -3.39999999999999992e23 < (/.f64 x y) < 6.8e-8Initial program 87.1%
Taylor expanded in z around inf 57.2%
div-sub57.2%
sub-neg57.2%
*-inverses57.2%
metadata-eval57.2%
distribute-lft-in57.2%
associate-*r/57.2%
metadata-eval57.2%
metadata-eval57.2%
Simplified57.2%
Taylor expanded in x around 0 56.6%
sub-neg56.6%
associate-*r/56.6%
metadata-eval56.6%
metadata-eval56.6%
Simplified56.6%
if 6.8e-8 < (/.f64 x y) Initial program 85.4%
Taylor expanded in t around inf 70.3%
Final simplification64.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.8e+22) (not (<= (/ x y) 6300.0))) (/ x y) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.8e+22) || !((x / y) <= 6300.0)) {
tmp = x / y;
} else {
tmp = 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) <= (-2.8d+22)) .or. (.not. ((x / y) <= 6300.0d0))) then
tmp = x / y
else
tmp = 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) <= -2.8e+22) || !((x / y) <= 6300.0)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2.8e+22) or not ((x / y) <= 6300.0): tmp = x / y else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2.8e+22) || !(Float64(x / y) <= 6300.0)) tmp = Float64(x / y); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2.8e+22) || ~(((x / y) <= 6300.0))) tmp = x / y; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2.8e+22], N[Not[LessEqual[N[(x / y), $MachinePrecision], 6300.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.8 \cdot 10^{+22} \lor \neg \left(\frac{x}{y} \leq 6300\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.8e22 or 6300 < (/.f64 x y) Initial program 80.5%
Taylor expanded in x around inf 71.7%
if -2.8e22 < (/.f64 x y) < 6300Initial program 86.4%
Taylor expanded in t around 0 69.1%
associate-*r/69.1%
metadata-eval69.1%
Simplified69.1%
Taylor expanded in z around inf 27.4%
Final simplification49.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.55e+70) (not (<= t 5800000000000.0))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.55e+70) || !(t <= 5800000000000.0)) {
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 <= (-1.55d+70)) .or. (.not. (t <= 5800000000000.0d0))) 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 <= -1.55e+70) || !(t <= 5800000000000.0)) {
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 <= -1.55e+70) or not (t <= 5800000000000.0): 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 <= -1.55e+70) || !(t <= 5800000000000.0)) 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 <= -1.55e+70) || ~((t <= 5800000000000.0))) 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, -1.55e+70], N[Not[LessEqual[t, 5800000000000.0]], $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 -1.55 \cdot 10^{+70} \lor \neg \left(t \leq 5800000000000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.55000000000000015e70 or 5.8e12 < t Initial program 64.9%
Taylor expanded in t around inf 90.0%
if -1.55000000000000015e70 < t < 5.8e12Initial program 98.4%
Taylor expanded in t around 0 80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (/ 2.0 t))
double code(double x, double y, double z, double t) {
return 2.0 / t;
}
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 / t
end function
public static double code(double x, double y, double z, double t) {
return 2.0 / t;
}
def code(x, y, z, t): return 2.0 / t
function code(x, y, z, t) return Float64(2.0 / t) end
function tmp = code(x, y, z, t) tmp = 2.0 / t; end
code[x_, y_, z_, t_] := N[(2.0 / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t}
\end{array}
Initial program 83.5%
Taylor expanded in t around 0 49.8%
associate-*r/49.8%
metadata-eval49.8%
Simplified49.8%
Taylor expanded in z around inf 19.8%
Final simplification19.8%
(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 2024075
(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))))