
(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 14 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 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) + -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 = (x / y) + (((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0);
}
def code(x, y, z, t): return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0)
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0)) end
function tmp = code(x, y, z, t) tmp = (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2 + \frac{2}{z}}{t} + -2\right)
\end{array}
Initial program 82.6%
+-commutative82.6%
remove-double-neg82.6%
distribute-frac-neg82.6%
unsub-neg82.6%
*-commutative82.6%
associate-*r*82.6%
distribute-rgt1-in82.6%
associate-/l*82.6%
fma-neg82.6%
*-commutative82.6%
fma-define82.6%
*-commutative82.6%
distribute-frac-neg82.6%
remove-double-neg82.6%
Simplified82.6%
Taylor expanded in t around inf 99.2%
sub-neg99.2%
+-commutative99.2%
metadata-eval99.2%
associate-+l+99.2%
associate-*r/99.2%
distribute-lft-in99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
Simplified99.2%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -50000.0)
(+ (/ x y) (/ 2.0 (* z t)))
(if (<= (/ x y) 5e-7)
(+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)
(/ (+ x (* 2.0 (/ y (* z t)))) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -50000.0) {
tmp = (x / y) + (2.0 / (z * t));
} else if ((x / y) <= 5e-7) {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
} else {
tmp = (x + (2.0 * (y / (z * t)))) / 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) <= (-50000.0d0)) then
tmp = (x / y) + (2.0d0 / (z * t))
else if ((x / y) <= 5d-7) then
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
else
tmp = (x + (2.0d0 * (y / (z * t)))) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -50000.0) {
tmp = (x / y) + (2.0 / (z * t));
} else if ((x / y) <= 5e-7) {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
} else {
tmp = (x + (2.0 * (y / (z * t)))) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -50000.0: tmp = (x / y) + (2.0 / (z * t)) elif (x / y) <= 5e-7: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 else: tmp = (x + (2.0 * (y / (z * t)))) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -50000.0) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); elseif (Float64(x / y) <= 5e-7) tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); else tmp = Float64(Float64(x + Float64(2.0 * Float64(y / Float64(z * t)))) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -50000.0) tmp = (x / y) + (2.0 / (z * t)); elseif ((x / y) <= 5e-7) tmp = ((2.0 + (2.0 / z)) / t) + -2.0; else tmp = (x + (2.0 * (y / (z * t)))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -50000.0], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-7], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(x + N[(2.0 * N[(y / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -50000:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 2 \cdot \frac{y}{z \cdot t}}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -5e4Initial program 78.3%
Taylor expanded in z around 0 91.2%
if -5e4 < (/.f64 x y) < 4.99999999999999977e-7Initial program 86.3%
+-commutative86.3%
remove-double-neg86.3%
distribute-frac-neg86.3%
unsub-neg86.3%
*-commutative86.3%
associate-*r*86.3%
distribute-rgt1-in86.3%
associate-/l*86.2%
fma-neg86.2%
*-commutative86.2%
fma-define86.2%
*-commutative86.2%
distribute-frac-neg86.2%
remove-double-neg86.2%
Simplified86.2%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.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 99.0%
associate--l+99.0%
associate-*r/99.0%
metadata-eval99.0%
sub-neg99.0%
associate-/r*99.0%
associate-*r/99.0%
associate-*l/99.0%
metadata-eval99.0%
associate-+l+99.0%
metadata-eval99.0%
associate-*r/99.0%
distribute-rgt-in99.0%
associate-*l/99.0%
*-lft-identity99.0%
+-commutative99.0%
Simplified99.0%
if 4.99999999999999977e-7 < (/.f64 x y) Initial program 79.6%
+-commutative79.6%
remove-double-neg79.6%
distribute-frac-neg79.6%
unsub-neg79.6%
*-commutative79.6%
associate-*r*79.6%
distribute-rgt1-in79.6%
associate-/l*79.6%
fma-neg79.6%
*-commutative79.6%
fma-define79.6%
*-commutative79.6%
distribute-frac-neg79.6%
remove-double-neg79.6%
Simplified79.6%
Taylor expanded in y around 0 78.5%
Taylor expanded in z around 0 89.7%
*-commutative89.7%
Simplified89.7%
Final simplification94.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -46000.0) (not (<= (/ x y) 19.0))) (+ (/ x y) (/ 2.0 (* z t))) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -46000.0) || !((x / y) <= 19.0)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-46000.0d0)) .or. (.not. ((x / y) <= 19.0d0))) then
tmp = (x / y) + (2.0d0 / (z * t))
else
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -46000.0) || !((x / y) <= 19.0)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -46000.0) or not ((x / y) <= 19.0): tmp = (x / y) + (2.0 / (z * t)) else: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -46000.0) || !(Float64(x / y) <= 19.0)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -46000.0) || ~(((x / y) <= 19.0))) tmp = (x / y) + (2.0 / (z * t)); else tmp = ((2.0 + (2.0 / z)) / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -46000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 19.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -46000 \lor \neg \left(\frac{x}{y} \leq 19\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -46000 or 19 < (/.f64 x y) Initial program 79.1%
Taylor expanded in z around 0 90.2%
if -46000 < (/.f64 x y) < 19Initial program 86.3%
+-commutative86.3%
remove-double-neg86.3%
distribute-frac-neg86.3%
unsub-neg86.3%
*-commutative86.3%
associate-*r*86.3%
distribute-rgt1-in86.3%
associate-/l*86.2%
fma-neg86.2%
*-commutative86.2%
fma-define86.2%
*-commutative86.2%
distribute-frac-neg86.2%
remove-double-neg86.2%
Simplified86.2%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.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 99.0%
associate--l+99.0%
associate-*r/99.0%
metadata-eval99.0%
sub-neg99.0%
associate-/r*99.0%
associate-*r/99.0%
associate-*l/99.0%
metadata-eval99.0%
associate-+l+99.0%
metadata-eval99.0%
associate-*r/99.0%
distribute-rgt-in99.0%
associate-*l/99.0%
*-lft-identity99.0%
+-commutative99.0%
Simplified99.0%
Final simplification94.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.26e-9) (not (<= (/ x y) 280.0))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.26e-9) || !((x / y) <= 280.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1.26d-9)) .or. (.not. ((x / y) <= 280.0d0))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.26e-9) || !((x / y) <= 280.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.26e-9) or not ((x / y) <= 280.0): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.26e-9) || !(Float64(x / y) <= 280.0)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1.26e-9) || ~(((x / y) <= 280.0))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = ((2.0 + (2.0 / z)) / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.26e-9], N[Not[LessEqual[N[(x / y), $MachinePrecision], 280.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.26 \cdot 10^{-9} \lor \neg \left(\frac{x}{y} \leq 280\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.25999999999999999e-9 or 280 < (/.f64 x y) Initial program 79.4%
Taylor expanded in z around inf 83.0%
div-sub83.0%
sub-neg83.0%
*-inverses83.0%
metadata-eval83.0%
distribute-lft-in83.0%
associate-*r/83.0%
metadata-eval83.0%
metadata-eval83.0%
Simplified83.0%
if -1.25999999999999999e-9 < (/.f64 x y) < 280Initial program 86.1%
+-commutative86.1%
remove-double-neg86.1%
distribute-frac-neg86.1%
unsub-neg86.1%
*-commutative86.1%
associate-*r*86.1%
distribute-rgt1-in86.1%
associate-/l*86.0%
fma-neg86.0%
*-commutative86.0%
fma-define86.0%
*-commutative86.0%
distribute-frac-neg86.0%
remove-double-neg86.0%
Simplified86.0%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.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 99.3%
associate--l+99.3%
associate-*r/99.3%
metadata-eval99.3%
sub-neg99.3%
associate-/r*99.3%
associate-*r/99.3%
associate-*l/99.3%
metadata-eval99.3%
associate-+l+99.3%
metadata-eval99.3%
associate-*r/99.3%
distribute-rgt-in99.3%
associate-*l/99.3%
*-lft-identity99.3%
+-commutative99.3%
Simplified99.3%
Final simplification90.9%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -4.2e+14) (- (/ x y) 2.0) (if (<= (/ x y) 9.5e+102) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4.2e+14) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 9.5e+102) {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-4.2d+14)) then
tmp = (x / y) - 2.0d0
else if ((x / y) <= 9.5d+102) then
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4.2e+14) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 9.5e+102) {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -4.2e+14: tmp = (x / y) - 2.0 elif (x / y) <= 9.5e+102: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -4.2e+14) tmp = Float64(Float64(x / y) - 2.0); elseif (Float64(x / y) <= 9.5e+102) tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -4.2e+14) tmp = (x / y) - 2.0; elseif ((x / y) <= 9.5e+102) tmp = ((2.0 + (2.0 / z)) / t) + -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -4.2e+14], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 9.5e+102], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 9.5 \cdot 10^{+102}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.2e14Initial program 77.4%
Taylor expanded in t around inf 72.2%
if -4.2e14 < (/.f64 x y) < 9.4999999999999992e102Initial program 85.1%
+-commutative85.1%
remove-double-neg85.1%
distribute-frac-neg85.1%
unsub-neg85.1%
*-commutative85.1%
associate-*r*85.1%
distribute-rgt1-in85.1%
associate-/l*85.0%
fma-neg85.0%
*-commutative85.0%
fma-define85.0%
*-commutative85.0%
distribute-frac-neg85.0%
remove-double-neg85.0%
Simplified85.0%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.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.3%
associate--l+92.3%
associate-*r/92.3%
metadata-eval92.3%
sub-neg92.3%
associate-/r*92.3%
associate-*r/92.3%
associate-*l/92.3%
metadata-eval92.3%
associate-+l+92.3%
metadata-eval92.3%
associate-*r/92.3%
distribute-rgt-in92.3%
associate-*l/92.3%
*-lft-identity92.3%
+-commutative92.3%
Simplified92.3%
if 9.4999999999999992e102 < (/.f64 x y) Initial program 80.7%
Taylor expanded in x around inf 90.4%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.95e-9) (not (<= (/ x y) 38.0))) (- (/ x y) 2.0) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.95e-9) || !((x / y) <= 38.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 (((x / y) <= (-2.95d-9)) .or. (.not. ((x / y) <= 38.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 (((x / y) <= -2.95e-9) || !((x / y) <= 38.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 ((x / y) <= -2.95e-9) or not ((x / y) <= 38.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 ((Float64(x / y) <= -2.95e-9) || !(Float64(x / y) <= 38.0)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2.95e-9) || ~(((x / y) <= 38.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[N[(x / y), $MachinePrecision], -2.95e-9], N[Not[LessEqual[N[(x / y), $MachinePrecision], 38.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.95 \cdot 10^{-9} \lor \neg \left(\frac{x}{y} \leq 38\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.9499999999999999e-9 or 38 < (/.f64 x y) Initial program 79.4%
Taylor expanded in t around inf 74.4%
if -2.9499999999999999e-9 < (/.f64 x y) < 38Initial program 86.1%
+-commutative86.1%
remove-double-neg86.1%
distribute-frac-neg86.1%
unsub-neg86.1%
*-commutative86.1%
associate-*r*86.1%
distribute-rgt1-in86.1%
associate-/l*86.0%
fma-neg86.0%
*-commutative86.0%
fma-define86.0%
*-commutative86.0%
distribute-frac-neg86.0%
remove-double-neg86.0%
Simplified86.0%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.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 99.3%
associate--l+99.3%
associate-*r/99.3%
metadata-eval99.3%
sub-neg99.3%
associate-/r*99.3%
associate-*r/99.3%
associate-*l/99.3%
metadata-eval99.3%
associate-+l+99.3%
metadata-eval99.3%
associate-*r/99.3%
distribute-rgt-in99.3%
associate-*l/99.3%
*-lft-identity99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in z around 0 75.4%
Final simplification74.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.006) (not (<= (/ x y) 1.95e-8))) (- (/ x y) 2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.006) || !((x / y) <= 1.95e-8)) {
tmp = (x / y) - 2.0;
} 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) <= (-0.006d0)) .or. (.not. ((x / y) <= 1.95d-8))) then
tmp = (x / y) - 2.0d0
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) <= -0.006) || !((x / y) <= 1.95e-8)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -0.006) or not ((x / y) <= 1.95e-8): tmp = (x / y) - 2.0 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -0.006) || !(Float64(x / y) <= 1.95e-8)) tmp = Float64(Float64(x / y) - 2.0); 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) <= -0.006) || ~(((x / y) <= 1.95e-8))) tmp = (x / y) - 2.0; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -0.006], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.95e-8]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.006 \lor \neg \left(\frac{x}{y} \leq 1.95 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.0060000000000000001 or 1.94999999999999992e-8 < (/.f64 x y) Initial program 78.5%
Taylor expanded in t around inf 74.9%
if -0.0060000000000000001 < (/.f64 x y) < 1.94999999999999992e-8Initial program 87.0%
+-commutative87.0%
remove-double-neg87.0%
distribute-frac-neg87.0%
unsub-neg87.0%
*-commutative87.0%
associate-*r*87.0%
distribute-rgt1-in87.0%
associate-/l*86.9%
fma-neg86.9%
*-commutative86.9%
fma-define86.9%
*-commutative86.9%
distribute-frac-neg86.9%
remove-double-neg86.9%
Simplified86.9%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.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 99.4%
associate--l+99.4%
associate-*r/99.4%
metadata-eval99.4%
sub-neg99.4%
associate-/r*99.4%
associate-*r/99.4%
associate-*l/99.4%
metadata-eval99.4%
associate-+l+99.4%
metadata-eval99.4%
associate-*r/99.4%
distribute-rgt-in99.4%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 64.8%
sub-neg64.8%
associate-*r/64.8%
metadata-eval64.8%
metadata-eval64.8%
Simplified64.8%
Final simplification70.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -72000.0) (not (<= (/ x y) 2.5))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -72000.0) || !((x / y) <= 2.5)) {
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) <= (-72000.0d0)) .or. (.not. ((x / y) <= 2.5d0))) 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) <= -72000.0) || !((x / y) <= 2.5)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -72000.0) or not ((x / y) <= 2.5): 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) <= -72000.0) || !(Float64(x / y) <= 2.5)) 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) <= -72000.0) || ~(((x / y) <= 2.5))) 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], -72000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.5]], $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 -72000 \lor \neg \left(\frac{x}{y} \leq 2.5\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -72000 or 2.5 < (/.f64 x y) Initial program 79.1%
Taylor expanded in x around inf 73.3%
if -72000 < (/.f64 x y) < 2.5Initial program 86.3%
+-commutative86.3%
remove-double-neg86.3%
distribute-frac-neg86.3%
unsub-neg86.3%
*-commutative86.3%
associate-*r*86.3%
distribute-rgt1-in86.3%
associate-/l*86.2%
fma-neg86.2%
*-commutative86.2%
fma-define86.2%
*-commutative86.2%
distribute-frac-neg86.2%
remove-double-neg86.2%
Simplified86.2%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.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 99.0%
associate--l+99.0%
associate-*r/99.0%
metadata-eval99.0%
sub-neg99.0%
associate-/r*99.0%
associate-*r/99.0%
associate-*l/99.0%
metadata-eval99.0%
associate-+l+99.0%
metadata-eval99.0%
associate-*r/99.0%
distribute-rgt-in99.0%
associate-*l/99.0%
*-lft-identity99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in z around inf 64.7%
sub-neg64.7%
associate-*r/64.7%
metadata-eval64.7%
metadata-eval64.7%
Simplified64.7%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.48) (not (<= t 3.1e-53))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.48) || !(t <= 3.1e-53)) {
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 <= (-0.48d0)) .or. (.not. (t <= 3.1d-53))) 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 <= -0.48) || !(t <= 3.1e-53)) {
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 <= -0.48) or not (t <= 3.1e-53): 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 <= -0.48) || !(t <= 3.1e-53)) 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 <= -0.48) || ~((t <= 3.1e-53))) 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, -0.48], N[Not[LessEqual[t, 3.1e-53]], $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 -0.48 \lor \neg \left(t \leq 3.1 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -0.47999999999999998 or 3.10000000000000015e-53 < t Initial program 72.3%
Taylor expanded in t around inf 86.7%
if -0.47999999999999998 < t < 3.10000000000000015e-53Initial program 97.7%
Taylor expanded in t around 0 84.9%
associate-*r/84.9%
metadata-eval84.9%
Simplified84.9%
Final simplification85.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.0) (not (<= (/ x y) 2.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.0) || !((x / y) <= 2.0)) {
tmp = x / y;
} 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 (((x / y) <= (-2.0d0)) .or. (.not. ((x / y) <= 2.0d0))) then
tmp = x / y
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 (((x / y) <= -2.0) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2.0) or not ((x / y) <= 2.0): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2.0) || !(Float64(x / y) <= 2.0)) tmp = Float64(x / y); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2.0) || ~(((x / y) <= 2.0))) tmp = x / y; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -2 or 2 < (/.f64 x y) Initial program 79.1%
Taylor expanded in x around inf 73.3%
if -2 < (/.f64 x y) < 2Initial program 86.3%
+-commutative86.3%
remove-double-neg86.3%
distribute-frac-neg86.3%
unsub-neg86.3%
*-commutative86.3%
associate-*r*86.3%
distribute-rgt1-in86.3%
associate-/l*86.2%
fma-neg86.2%
*-commutative86.2%
fma-define86.2%
*-commutative86.2%
distribute-frac-neg86.2%
remove-double-neg86.2%
Simplified86.2%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.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 99.0%
associate--l+99.0%
associate-*r/99.0%
metadata-eval99.0%
sub-neg99.0%
associate-/r*99.0%
associate-*r/99.0%
associate-*l/99.0%
metadata-eval99.0%
associate-+l+99.0%
metadata-eval99.0%
associate-*r/99.0%
distribute-rgt-in99.0%
associate-*l/99.0%
*-lft-identity99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in t around inf 41.9%
Final simplification57.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.0255) (not (<= t 8.2e-61))) (- (/ x y) 2.0) (/ (/ 2.0 z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.0255) || !(t <= 8.2e-61)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / z) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-0.0255d0)) .or. (.not. (t <= 8.2d-61))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 / z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.0255) || !(t <= 8.2e-61)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / z) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -0.0255) or not (t <= 8.2e-61): tmp = (x / y) - 2.0 else: tmp = (2.0 / z) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -0.0255) || !(t <= 8.2e-61)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 / z) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -0.0255) || ~((t <= 8.2e-61))) tmp = (x / y) - 2.0; else tmp = (2.0 / z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -0.0255], N[Not[LessEqual[t, 8.2e-61]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0255 \lor \neg \left(t \leq 8.2 \cdot 10^{-61}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -0.0254999999999999984 or 8.19999999999999998e-61 < t Initial program 72.5%
Taylor expanded in t around inf 86.2%
if -0.0254999999999999984 < t < 8.19999999999999998e-61Initial program 97.7%
Taylor expanded in t around 0 85.5%
associate-*r/85.5%
metadata-eval85.5%
Simplified85.5%
Taylor expanded in z around 0 50.7%
Final simplification71.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.031) (not (<= t 2.2e-53))) (- (/ x y) 2.0) (/ 2.0 (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.031) || !(t <= 2.2e-53)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-0.031d0)) .or. (.not. (t <= 2.2d-53))) then
tmp = (x / y) - 2.0d0
else
tmp = 2.0d0 / (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.031) || !(t <= 2.2e-53)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -0.031) or not (t <= 2.2e-53): tmp = (x / y) - 2.0 else: tmp = 2.0 / (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -0.031) || !(t <= 2.2e-53)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(2.0 / Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -0.031) || ~((t <= 2.2e-53))) tmp = (x / y) - 2.0; else tmp = 2.0 / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -0.031], N[Not[LessEqual[t, 2.2e-53]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.031 \lor \neg \left(t \leq 2.2 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\end{array}
\end{array}
if t < -0.031 or 2.20000000000000018e-53 < t Initial program 72.5%
Taylor expanded in t around inf 86.2%
if -0.031 < t < 2.20000000000000018e-53Initial 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.7%
fma-neg97.7%
*-commutative97.7%
fma-define97.7%
*-commutative97.7%
distribute-frac-neg97.7%
remove-double-neg97.7%
Simplified97.7%
Taylor expanded in t around inf 98.0%
sub-neg98.0%
+-commutative98.0%
metadata-eval98.0%
associate-+l+98.0%
associate-*r/98.0%
distribute-lft-in98.0%
metadata-eval98.0%
associate-*r/98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in z around 0 50.6%
Final simplification71.9%
(FPCore (x y z t) :precision binary64 (if (<= t -3.9) -2.0 (if (<= t 3e+17) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.9) {
tmp = -2.0;
} else if (t <= 3e+17) {
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 <= (-3.9d0)) then
tmp = -2.0d0
else if (t <= 3d+17) 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 <= -3.9) {
tmp = -2.0;
} else if (t <= 3e+17) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.9: tmp = -2.0 elif t <= 3e+17: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.9) tmp = -2.0; elseif (t <= 3e+17) 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 <= -3.9) tmp = -2.0; elseif (t <= 3e+17) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.9], -2.0, If[LessEqual[t, 3e+17], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+17}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -3.89999999999999991 or 3e17 < t Initial program 68.6%
+-commutative68.6%
remove-double-neg68.6%
distribute-frac-neg68.6%
unsub-neg68.6%
*-commutative68.6%
associate-*r*68.6%
distribute-rgt1-in68.6%
associate-/l*68.6%
fma-neg68.6%
*-commutative68.6%
fma-define68.6%
*-commutative68.6%
distribute-frac-neg68.6%
remove-double-neg68.6%
Simplified68.6%
Taylor expanded in t around inf 100.0%
sub-neg100.0%
+-commutative100.0%
metadata-eval100.0%
associate-+l+100.0%
associate-*r/100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 49.2%
associate--l+49.2%
associate-*r/49.2%
metadata-eval49.2%
sub-neg49.2%
associate-/r*49.2%
associate-*r/49.2%
associate-*l/49.2%
metadata-eval49.2%
associate-+l+49.2%
metadata-eval49.2%
associate-*r/49.2%
distribute-rgt-in49.2%
associate-*l/49.3%
*-lft-identity49.3%
+-commutative49.3%
Simplified49.3%
Taylor expanded in t around inf 39.3%
if -3.89999999999999991 < t < 3e17Initial program 98.1%
Taylor expanded in t around 0 77.8%
associate-*r/77.8%
metadata-eval77.8%
Simplified77.8%
Taylor expanded in z around inf 32.4%
(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 82.6%
+-commutative82.6%
remove-double-neg82.6%
distribute-frac-neg82.6%
unsub-neg82.6%
*-commutative82.6%
associate-*r*82.6%
distribute-rgt1-in82.6%
associate-/l*82.6%
fma-neg82.6%
*-commutative82.6%
fma-define82.6%
*-commutative82.6%
distribute-frac-neg82.6%
remove-double-neg82.6%
Simplified82.6%
Taylor expanded in t around inf 99.2%
sub-neg99.2%
+-commutative99.2%
metadata-eval99.2%
associate-+l+99.2%
associate-*r/99.2%
distribute-lft-in99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 63.2%
associate--l+63.2%
associate-*r/63.2%
metadata-eval63.2%
sub-neg63.2%
associate-/r*63.3%
associate-*r/63.3%
associate-*l/63.3%
metadata-eval63.3%
associate-+l+63.3%
metadata-eval63.3%
associate-*r/63.3%
distribute-rgt-in63.3%
associate-*l/63.3%
*-lft-identity63.3%
+-commutative63.3%
Simplified63.3%
Taylor expanded in t around inf 21.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 2024135
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (/ 2 z) 2) t) (- 2 (/ x y))))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))