
(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 11 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 (+ (/ x y) (+ -2.0 (* (/ 1.0 t) (+ 2.0 (/ 2.0 z))))))
double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / 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) + ((1.0d0 / t) * (2.0d0 + (2.0d0 / z))))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / z))));
}
def code(x, y, z, t): return (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / z))))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(1.0 / t) * Float64(2.0 + Float64(2.0 / z))))) end
function tmp = code(x, y, z, t) tmp = (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / z)))); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(1.0 / t), $MachinePrecision] * N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(-2 + \frac{1}{t} \cdot \left(2 + \frac{2}{z}\right)\right)
\end{array}
Initial program 84.2%
+-commutative84.2%
remove-double-neg84.2%
distribute-frac-neg84.2%
unsub-neg84.2%
*-commutative84.2%
associate-*r*84.2%
distribute-rgt1-in84.2%
associate-/l*84.1%
fma-neg84.1%
*-commutative84.1%
fma-define84.1%
*-commutative84.1%
distribute-frac-neg84.1%
remove-double-neg84.1%
Simplified84.1%
Taylor expanded in z around inf 98.7%
associate-+r+98.7%
+-commutative98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-/r*98.7%
+-commutative98.7%
div-sub98.7%
sub-neg98.7%
*-inverses98.7%
metadata-eval98.7%
distribute-lft-in98.7%
metadata-eval98.7%
associate-+l+98.7%
+-commutative98.7%
associate-/r*98.7%
+-commutative98.7%
Simplified98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (* -2.0 t)) t)) (t_2 (- (/ x y) 2.0)))
(if (<= z -6.2e+235)
t_2
(if (<= z -3.4e+198)
t_1
(if (<= z -9e+122)
t_2
(if (<= z -4.8e+58)
t_1
(if (<= z -1.85e-116)
t_2
(if (<= z 4.8e-90)
(/ 2.0 (* t z))
(if (<= z 9.5e+76) t_2 t_1)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (-2.0 * t)) / t;
double t_2 = (x / y) - 2.0;
double tmp;
if (z <= -6.2e+235) {
tmp = t_2;
} else if (z <= -3.4e+198) {
tmp = t_1;
} else if (z <= -9e+122) {
tmp = t_2;
} else if (z <= -4.8e+58) {
tmp = t_1;
} else if (z <= -1.85e-116) {
tmp = t_2;
} else if (z <= 4.8e-90) {
tmp = 2.0 / (t * z);
} else if (z <= 9.5e+76) {
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
t_2 = (x / y) - 2.0d0
if (z <= (-6.2d+235)) then
tmp = t_2
else if (z <= (-3.4d+198)) then
tmp = t_1
else if (z <= (-9d+122)) then
tmp = t_2
else if (z <= (-4.8d+58)) then
tmp = t_1
else if (z <= (-1.85d-116)) then
tmp = t_2
else if (z <= 4.8d-90) then
tmp = 2.0d0 / (t * z)
else if (z <= 9.5d+76) 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)) / t;
double t_2 = (x / y) - 2.0;
double tmp;
if (z <= -6.2e+235) {
tmp = t_2;
} else if (z <= -3.4e+198) {
tmp = t_1;
} else if (z <= -9e+122) {
tmp = t_2;
} else if (z <= -4.8e+58) {
tmp = t_1;
} else if (z <= -1.85e-116) {
tmp = t_2;
} else if (z <= 4.8e-90) {
tmp = 2.0 / (t * z);
} else if (z <= 9.5e+76) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (-2.0 * t)) / t t_2 = (x / y) - 2.0 tmp = 0 if z <= -6.2e+235: tmp = t_2 elif z <= -3.4e+198: tmp = t_1 elif z <= -9e+122: tmp = t_2 elif z <= -4.8e+58: tmp = t_1 elif z <= -1.85e-116: tmp = t_2 elif z <= 4.8e-90: tmp = 2.0 / (t * z) elif z <= 9.5e+76: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(-2.0 * t)) / t) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -6.2e+235) tmp = t_2; elseif (z <= -3.4e+198) tmp = t_1; elseif (z <= -9e+122) tmp = t_2; elseif (z <= -4.8e+58) tmp = t_1; elseif (z <= -1.85e-116) tmp = t_2; elseif (z <= 4.8e-90) tmp = Float64(2.0 / Float64(t * z)); elseif (z <= 9.5e+76) 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; t_2 = (x / y) - 2.0; tmp = 0.0; if (z <= -6.2e+235) tmp = t_2; elseif (z <= -3.4e+198) tmp = t_1; elseif (z <= -9e+122) tmp = t_2; elseif (z <= -4.8e+58) tmp = t_1; elseif (z <= -1.85e-116) tmp = t_2; elseif (z <= 4.8e-90) tmp = 2.0 / (t * z); elseif (z <= 9.5e+76) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(-2.0 * t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -6.2e+235], t$95$2, If[LessEqual[z, -3.4e+198], t$95$1, If[LessEqual[z, -9e+122], t$95$2, If[LessEqual[z, -4.8e+58], t$95$1, If[LessEqual[z, -1.85e-116], t$95$2, If[LessEqual[z, 4.8e-90], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+76], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + -2 \cdot t}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+235}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{+198}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{+122}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-116}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-90}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+76}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.20000000000000022e235 or -3.4e198 < z < -8.99999999999999995e122 or -4.8e58 < z < -1.8500000000000001e-116 or 4.8000000000000003e-90 < z < 9.5000000000000003e76Initial program 76.9%
+-commutative76.9%
remove-double-neg76.9%
distribute-frac-neg76.9%
unsub-neg76.9%
*-commutative76.9%
associate-*r*76.9%
distribute-rgt1-in76.9%
associate-/l*76.7%
fma-neg76.7%
*-commutative76.7%
fma-define76.7%
*-commutative76.7%
distribute-frac-neg76.7%
remove-double-neg76.7%
Simplified76.7%
Taylor expanded in t around inf 74.9%
if -6.20000000000000022e235 < z < -3.4e198 or -8.99999999999999995e122 < z < -4.8e58 or 9.5000000000000003e76 < z Initial program 80.8%
+-commutative80.8%
remove-double-neg80.8%
distribute-frac-neg80.8%
unsub-neg80.8%
*-commutative80.8%
associate-*r*80.8%
distribute-rgt1-in80.8%
associate-/l*80.7%
fma-neg80.7%
*-commutative80.7%
fma-define80.7%
*-commutative80.7%
distribute-frac-neg80.7%
remove-double-neg80.7%
Simplified80.7%
Taylor expanded in t around 0 95.0%
Taylor expanded in z around inf 95.0%
Taylor expanded in x around 0 73.4%
*-commutative73.4%
Simplified73.4%
if -1.8500000000000001e-116 < z < 4.8000000000000003e-90Initial program 96.3%
+-commutative96.3%
remove-double-neg96.3%
distribute-frac-neg96.3%
unsub-neg96.3%
*-commutative96.3%
associate-*r*96.3%
distribute-rgt1-in96.3%
associate-/l*96.3%
fma-neg96.3%
*-commutative96.3%
fma-define96.3%
*-commutative96.3%
distribute-frac-neg96.3%
remove-double-neg96.3%
Simplified96.3%
Taylor expanded in z around 0 75.6%
Final simplification74.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -5.2e+122)
t_1
(if (<= z -6e+80)
(/ 2.0 t)
(if (<= z -1.65e-116)
t_1
(if (<= z 9e-91)
(/ 2.0 (* t z))
(if (or (<= z 1.3e+86) (not (<= z 2.9e+186))) t_1 (/ 2.0 t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -5.2e+122) {
tmp = t_1;
} else if (z <= -6e+80) {
tmp = 2.0 / t;
} else if (z <= -1.65e-116) {
tmp = t_1;
} else if (z <= 9e-91) {
tmp = 2.0 / (t * z);
} else if ((z <= 1.3e+86) || !(z <= 2.9e+186)) {
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) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-5.2d+122)) then
tmp = t_1
else if (z <= (-6d+80)) then
tmp = 2.0d0 / t
else if (z <= (-1.65d-116)) then
tmp = t_1
else if (z <= 9d-91) then
tmp = 2.0d0 / (t * z)
else if ((z <= 1.3d+86) .or. (.not. (z <= 2.9d+186))) 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 tmp;
if (z <= -5.2e+122) {
tmp = t_1;
} else if (z <= -6e+80) {
tmp = 2.0 / t;
} else if (z <= -1.65e-116) {
tmp = t_1;
} else if (z <= 9e-91) {
tmp = 2.0 / (t * z);
} else if ((z <= 1.3e+86) || !(z <= 2.9e+186)) {
tmp = t_1;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -5.2e+122: tmp = t_1 elif z <= -6e+80: tmp = 2.0 / t elif z <= -1.65e-116: tmp = t_1 elif z <= 9e-91: tmp = 2.0 / (t * z) elif (z <= 1.3e+86) or not (z <= 2.9e+186): tmp = t_1 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -5.2e+122) tmp = t_1; elseif (z <= -6e+80) tmp = Float64(2.0 / t); elseif (z <= -1.65e-116) tmp = t_1; elseif (z <= 9e-91) tmp = Float64(2.0 / Float64(t * z)); elseif ((z <= 1.3e+86) || !(z <= 2.9e+186)) 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; tmp = 0.0; if (z <= -5.2e+122) tmp = t_1; elseif (z <= -6e+80) tmp = 2.0 / t; elseif (z <= -1.65e-116) tmp = t_1; elseif (z <= 9e-91) tmp = 2.0 / (t * z); elseif ((z <= 1.3e+86) || ~((z <= 2.9e+186))) 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]}, If[LessEqual[z, -5.2e+122], t$95$1, If[LessEqual[z, -6e+80], N[(2.0 / t), $MachinePrecision], If[LessEqual[z, -1.65e-116], t$95$1, If[LessEqual[z, 9e-91], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.3e+86], N[Not[LessEqual[z, 2.9e+186]], $MachinePrecision]], t$95$1, N[(2.0 / t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{+80}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-91}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+86} \lor \neg \left(z \leq 2.9 \cdot 10^{+186}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if z < -5.20000000000000015e122 or -5.99999999999999974e80 < z < -1.65e-116 or 8.99999999999999952e-91 < z < 1.2999999999999999e86 or 2.9e186 < z Initial program 76.4%
+-commutative76.4%
remove-double-neg76.4%
distribute-frac-neg76.4%
unsub-neg76.4%
*-commutative76.4%
associate-*r*76.4%
distribute-rgt1-in76.4%
associate-/l*76.3%
fma-neg76.3%
*-commutative76.3%
fma-define76.3%
*-commutative76.3%
distribute-frac-neg76.3%
remove-double-neg76.3%
Simplified76.3%
Taylor expanded in t around inf 71.1%
if -5.20000000000000015e122 < z < -5.99999999999999974e80 or 1.2999999999999999e86 < z < 2.9e186Initial program 88.2%
+-commutative88.2%
remove-double-neg88.2%
distribute-frac-neg88.2%
unsub-neg88.2%
*-commutative88.2%
associate-*r*88.2%
distribute-rgt1-in88.2%
associate-/l*88.0%
fma-neg88.0%
*-commutative88.0%
fma-define88.0%
*-commutative88.0%
distribute-frac-neg88.0%
remove-double-neg88.0%
Simplified88.0%
Taylor expanded in t around 0 96.3%
Taylor expanded in z around inf 96.3%
Taylor expanded in t around 0 72.6%
if -1.65e-116 < z < 8.99999999999999952e-91Initial program 96.3%
+-commutative96.3%
remove-double-neg96.3%
distribute-frac-neg96.3%
unsub-neg96.3%
*-commutative96.3%
associate-*r*96.3%
distribute-rgt1-in96.3%
associate-/l*96.3%
fma-neg96.3%
*-commutative96.3%
fma-define96.3%
*-commutative96.3%
distribute-frac-neg96.3%
remove-double-neg96.3%
Simplified96.3%
Taylor expanded in z around 0 75.6%
Final simplification72.7%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -1.7e+14)
(and (not (<= t -1.45e-25))
(or (<= t -3.6e-79) (not (<= t 2.15e-54)))))
(- (/ 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.7e+14) || (!(t <= -1.45e-25) && ((t <= -3.6e-79) || !(t <= 2.15e-54)))) {
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.7d+14)) .or. (.not. (t <= (-1.45d-25))) .and. (t <= (-3.6d-79)) .or. (.not. (t <= 2.15d-54))) 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.7e+14) || (!(t <= -1.45e-25) && ((t <= -3.6e-79) || !(t <= 2.15e-54)))) {
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.7e+14) or (not (t <= -1.45e-25) and ((t <= -3.6e-79) or not (t <= 2.15e-54))): 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.7e+14) || (!(t <= -1.45e-25) && ((t <= -3.6e-79) || !(t <= 2.15e-54)))) 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.7e+14) || (~((t <= -1.45e-25)) && ((t <= -3.6e-79) || ~((t <= 2.15e-54))))) 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.7e+14], And[N[Not[LessEqual[t, -1.45e-25]], $MachinePrecision], Or[LessEqual[t, -3.6e-79], N[Not[LessEqual[t, 2.15e-54]], $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.7 \cdot 10^{+14} \lor \neg \left(t \leq -1.45 \cdot 10^{-25}\right) \land \left(t \leq -3.6 \cdot 10^{-79} \lor \neg \left(t \leq 2.15 \cdot 10^{-54}\right)\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.7e14 or -1.45e-25 < t < -3.6000000000000002e-79 or 2.15e-54 < t Initial program 73.7%
+-commutative73.7%
remove-double-neg73.7%
distribute-frac-neg73.7%
unsub-neg73.7%
*-commutative73.7%
associate-*r*73.7%
distribute-rgt1-in73.7%
associate-/l*73.6%
fma-neg73.6%
*-commutative73.6%
fma-define73.6%
*-commutative73.6%
distribute-frac-neg73.6%
remove-double-neg73.6%
Simplified73.6%
Taylor expanded in t around inf 80.5%
if -1.7e14 < t < -1.45e-25 or -3.6000000000000002e-79 < t < 2.15e-54Initial program 98.8%
Taylor expanded in t around 0 89.5%
associate-*r/89.5%
metadata-eval89.5%
Simplified89.5%
Final simplification84.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.6e+168) (not (<= (/ x y) 2.4e+18))) (+ (/ 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) <= -2.6e+168) || !((x / y) <= 2.4e+18)) {
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) <= (-2.6d+168)) .or. (.not. ((x / y) <= 2.4d+18))) 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) <= -2.6e+168) || !((x / y) <= 2.4e+18)) {
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) <= -2.6e+168) or not ((x / y) <= 2.4e+18): 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) <= -2.6e+168) || !(Float64(x / y) <= 2.4e+18)) 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) <= -2.6e+168) || ~(((x / y) <= 2.4e+18))) 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], -2.6e+168], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.4e+18]], $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 -2.6 \cdot 10^{+168} \lor \neg \left(\frac{x}{y} \leq 2.4 \cdot 10^{+18}\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) < -2.6e168 or 2.4e18 < (/.f64 x y) Initial program 77.4%
+-commutative77.4%
remove-double-neg77.4%
distribute-frac-neg77.4%
unsub-neg77.4%
*-commutative77.4%
associate-*r*77.4%
distribute-rgt1-in77.4%
associate-/l*77.4%
fma-neg77.4%
*-commutative77.4%
fma-define77.4%
*-commutative77.4%
distribute-frac-neg77.4%
remove-double-neg77.4%
Simplified77.4%
Taylor expanded in z around inf 93.6%
+-commutative93.6%
div-sub93.6%
*-inverses93.6%
sub-neg93.6%
metadata-eval93.6%
distribute-lft-in93.6%
associate-*r/93.6%
metadata-eval93.6%
metadata-eval93.6%
Simplified93.6%
if -2.6e168 < (/.f64 x y) < 2.4e18Initial program 87.3%
+-commutative87.3%
remove-double-neg87.3%
distribute-frac-neg87.3%
unsub-neg87.3%
*-commutative87.3%
associate-*r*87.3%
distribute-rgt1-in87.3%
associate-/l*87.2%
fma-neg87.2%
*-commutative87.2%
fma-define87.2%
*-commutative87.2%
distribute-frac-neg87.2%
remove-double-neg87.2%
Simplified87.2%
Taylor expanded in z around inf 99.9%
associate-+r+99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.8%
+-commutative99.8%
div-sub99.8%
sub-neg99.8%
*-inverses99.8%
metadata-eval99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*99.9%
+-commutative99.9%
Simplified99.8%
Taylor expanded in x around 0 94.4%
sub-neg94.4%
associate-*r/94.4%
metadata-eval94.4%
associate-/l/94.3%
*-rgt-identity94.3%
associate-*r/94.3%
distribute-rgt-in94.3%
associate-*l/94.3%
*-lft-identity94.3%
metadata-eval94.3%
+-commutative94.3%
Simplified94.3%
Final simplification94.1%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -4e+169)
(/ x y)
(if (<= (/ x y) 1.22e+81)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4e+169) {
tmp = x / y;
} else if ((x / y) <= 1.22e+81) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / 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) <= (-4d+169)) then
tmp = x / y
else if ((x / y) <= 1.22d+81) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / 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) <= -4e+169) {
tmp = x / y;
} else if ((x / y) <= 1.22e+81) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -4e+169: tmp = x / y elif (x / y) <= 1.22e+81: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -4e+169) tmp = Float64(x / y); elseif (Float64(x / y) <= 1.22e+81) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / 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) <= -4e+169) tmp = x / y; elseif ((x / y) <= 1.22e+81) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -4e+169], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.22e+81], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+169}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.22 \cdot 10^{+81}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.99999999999999974e169Initial program 75.0%
+-commutative75.0%
remove-double-neg75.0%
distribute-frac-neg75.0%
unsub-neg75.0%
*-commutative75.0%
associate-*r*75.0%
distribute-rgt1-in75.0%
associate-/l*75.0%
fma-neg75.0%
*-commutative75.0%
fma-define75.0%
*-commutative75.0%
distribute-frac-neg75.0%
remove-double-neg75.0%
Simplified75.0%
Taylor expanded in x around inf 88.1%
if -3.99999999999999974e169 < (/.f64 x y) < 1.21999999999999995e81Initial program 86.8%
+-commutative86.8%
remove-double-neg86.8%
distribute-frac-neg86.8%
unsub-neg86.8%
*-commutative86.8%
associate-*r*86.8%
distribute-rgt1-in86.8%
associate-/l*86.7%
fma-neg86.7%
*-commutative86.7%
fma-define86.7%
*-commutative86.7%
distribute-frac-neg86.7%
remove-double-neg86.7%
Simplified86.7%
Taylor expanded in z around inf 99.9%
associate-+r+99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.8%
+-commutative99.8%
div-sub99.8%
sub-neg99.8%
*-inverses99.8%
metadata-eval99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*99.9%
+-commutative99.9%
Simplified99.8%
Taylor expanded in x around 0 93.0%
sub-neg93.0%
associate-*r/93.0%
metadata-eval93.0%
associate-/l/93.0%
*-rgt-identity93.0%
associate-*r/93.0%
distribute-rgt-in93.0%
associate-*l/93.0%
*-lft-identity93.0%
metadata-eval93.0%
+-commutative93.0%
Simplified93.0%
if 1.21999999999999995e81 < (/.f64 x y) Initial program 79.4%
+-commutative79.4%
remove-double-neg79.4%
distribute-frac-neg79.4%
unsub-neg79.4%
*-commutative79.4%
associate-*r*79.4%
distribute-rgt1-in79.4%
associate-/l*79.4%
fma-neg79.4%
*-commutative79.4%
fma-define79.4%
*-commutative79.4%
distribute-frac-neg79.4%
remove-double-neg79.4%
Simplified79.4%
Taylor expanded in t around inf 92.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.8e+15) (not (<= z 0.00085))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ 2.0 (* t z)) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.8e+15) || !(z <= 0.00085)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (2.0 / (t * z)) + ((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 ((z <= (-7.8d+15)) .or. (.not. (z <= 0.00085d0))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (2.0d0 / (t * z)) + ((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 ((z <= -7.8e+15) || !(z <= 0.00085)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (2.0 / (t * z)) + ((x / y) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.8e+15) or not (z <= 0.00085): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (2.0 / (t * z)) + ((x / y) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.8e+15) || !(z <= 0.00085)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(Float64(x / y) + -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.8e+15) || ~((z <= 0.00085))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (2.0 / (t * z)) + ((x / y) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.8e+15], N[Not[LessEqual[z, 0.00085]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+15} \lor \neg \left(z \leq 0.00085\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} + \left(\frac{x}{y} + -2\right)\\
\end{array}
\end{array}
if z < -7.8e15 or 8.49999999999999953e-4 < z Initial program 69.5%
+-commutative69.5%
remove-double-neg69.5%
distribute-frac-neg69.5%
unsub-neg69.5%
*-commutative69.5%
associate-*r*69.5%
distribute-rgt1-in69.5%
associate-/l*69.4%
fma-neg69.4%
*-commutative69.4%
fma-define69.4%
*-commutative69.4%
distribute-frac-neg69.4%
remove-double-neg69.4%
Simplified69.4%
Taylor expanded in z around inf 98.9%
+-commutative98.9%
div-sub98.9%
*-inverses98.9%
sub-neg98.9%
metadata-eval98.9%
distribute-lft-in98.9%
associate-*r/98.9%
metadata-eval98.9%
metadata-eval98.9%
Simplified98.9%
if -7.8e15 < z < 8.49999999999999953e-4Initial program 97.6%
+-commutative97.6%
remove-double-neg97.6%
distribute-frac-neg97.6%
unsub-neg97.6%
*-commutative97.6%
associate-*r*97.6%
distribute-rgt1-in97.6%
associate-/l*97.5%
fma-neg97.5%
*-commutative97.5%
fma-define97.5%
*-commutative97.5%
distribute-frac-neg97.5%
remove-double-neg97.5%
Simplified97.5%
Taylor expanded in t around 0 94.1%
Taylor expanded in z around 0 93.6%
Taylor expanded in z around inf 97.1%
associate--l+97.1%
associate-*r/97.1%
metadata-eval97.1%
sub-neg97.1%
metadata-eval97.1%
Simplified97.1%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -6.6e-124) (not (<= t 4.8e-55))) (- (/ x y) 2.0) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.6e-124) || !(t <= 4.8e-55)) {
tmp = (x / y) - 2.0;
} 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 ((t <= (-6.6d-124)) .or. (.not. (t <= 4.8d-55))) then
tmp = (x / y) - 2.0d0
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 ((t <= -6.6e-124) || !(t <= 4.8e-55)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -6.6e-124) or not (t <= 4.8e-55): tmp = (x / y) - 2.0 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -6.6e-124) || !(t <= 4.8e-55)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -6.6e-124) || ~((t <= 4.8e-55))) tmp = (x / y) - 2.0; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -6.6e-124], N[Not[LessEqual[t, 4.8e-55]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{-124} \lor \neg \left(t \leq 4.8 \cdot 10^{-55}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if t < -6.59999999999999969e-124 or 4.79999999999999983e-55 < t Initial program 76.8%
+-commutative76.8%
remove-double-neg76.8%
distribute-frac-neg76.8%
unsub-neg76.8%
*-commutative76.8%
associate-*r*76.8%
distribute-rgt1-in76.8%
associate-/l*76.7%
fma-neg76.7%
*-commutative76.7%
fma-define76.7%
*-commutative76.7%
distribute-frac-neg76.7%
remove-double-neg76.7%
Simplified76.7%
Taylor expanded in t around inf 73.1%
if -6.59999999999999969e-124 < t < 4.79999999999999983e-55Initial program 98.6%
+-commutative98.6%
remove-double-neg98.6%
distribute-frac-neg98.6%
unsub-neg98.6%
*-commutative98.6%
associate-*r*98.6%
distribute-rgt1-in98.6%
associate-/l*98.6%
fma-neg98.6%
*-commutative98.6%
fma-define98.6%
*-commutative98.6%
distribute-frac-neg98.6%
remove-double-neg98.6%
Simplified98.6%
Taylor expanded in t around 0 99.8%
Taylor expanded in z around inf 56.3%
Taylor expanded in t around 0 46.6%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7.8e-125) (not (<= t 3.4e-56))) (/ x y) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.8e-125) || !(t <= 3.4e-56)) {
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 ((t <= (-7.8d-125)) .or. (.not. (t <= 3.4d-56))) 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 ((t <= -7.8e-125) || !(t <= 3.4e-56)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7.8e-125) or not (t <= 3.4e-56): tmp = x / y else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7.8e-125) || !(t <= 3.4e-56)) 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 ((t <= -7.8e-125) || ~((t <= 3.4e-56))) tmp = x / y; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7.8e-125], N[Not[LessEqual[t, 3.4e-56]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-125} \lor \neg \left(t \leq 3.4 \cdot 10^{-56}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if t < -7.79999999999999965e-125 or 3.39999999999999982e-56 < t Initial program 76.8%
+-commutative76.8%
remove-double-neg76.8%
distribute-frac-neg76.8%
unsub-neg76.8%
*-commutative76.8%
associate-*r*76.8%
distribute-rgt1-in76.8%
associate-/l*76.7%
fma-neg76.7%
*-commutative76.7%
fma-define76.7%
*-commutative76.7%
distribute-frac-neg76.7%
remove-double-neg76.7%
Simplified76.7%
Taylor expanded in x around inf 41.8%
if -7.79999999999999965e-125 < t < 3.39999999999999982e-56Initial program 98.6%
+-commutative98.6%
remove-double-neg98.6%
distribute-frac-neg98.6%
unsub-neg98.6%
*-commutative98.6%
associate-*r*98.6%
distribute-rgt1-in98.6%
associate-/l*98.6%
fma-neg98.6%
*-commutative98.6%
fma-define98.6%
*-commutative98.6%
distribute-frac-neg98.6%
remove-double-neg98.6%
Simplified98.6%
Taylor expanded in t around 0 99.8%
Taylor expanded in z around inf 56.3%
Taylor expanded in t around 0 46.6%
Final simplification43.4%
(FPCore (x y z t) :precision binary64 (+ (/ x y) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((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 = (x / y) + ((-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t));
}
def code(x, y, z, t): return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t))) end
function tmp = code(x, y, z, t) tmp = (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)
\end{array}
Initial program 84.2%
+-commutative84.2%
remove-double-neg84.2%
distribute-frac-neg84.2%
unsub-neg84.2%
*-commutative84.2%
associate-*r*84.2%
distribute-rgt1-in84.2%
associate-/l*84.1%
fma-neg84.1%
*-commutative84.1%
fma-define84.1%
*-commutative84.1%
distribute-frac-neg84.1%
remove-double-neg84.1%
Simplified84.1%
Taylor expanded in t around inf 98.7%
sub-neg98.7%
+-commutative98.7%
metadata-eval98.7%
associate-+l+98.7%
associate-*r/98.7%
distribute-lft-in98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification98.7%
(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 84.2%
+-commutative84.2%
remove-double-neg84.2%
distribute-frac-neg84.2%
unsub-neg84.2%
*-commutative84.2%
associate-*r*84.2%
distribute-rgt1-in84.2%
associate-/l*84.1%
fma-neg84.1%
*-commutative84.1%
fma-define84.1%
*-commutative84.1%
distribute-frac-neg84.1%
remove-double-neg84.1%
Simplified84.1%
Taylor expanded in t around 0 93.2%
Taylor expanded in z around inf 62.5%
Taylor expanded in t around 0 19.2%
(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 2024111
(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))))