
(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 16 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 (* t z)) (- (/ 2.0 t) 2.0))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / (t * z)) + ((2.0 / 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 / (t * z)) + ((2.0d0 / t) - 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 2.0));
}
def code(x, y, z, t): return (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 2.0))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 / Float64(t * z)) + Float64(Float64(2.0 / t) - 2.0))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 2.0)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2}{t \cdot z} + \left(\frac{2}{t} - 2\right)\right)
\end{array}
Initial program 82.6%
Taylor expanded in t around 0 98.7%
associate--l+98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -29000000000000.0)
(/ x y)
(if (<= (/ x y) -3.2e-55)
(/ 2.0 t)
(if (<= (/ x y) 0.0)
-2.0
(if (<= (/ x y) 3.8e-25)
(/ 2.0 t)
(if (<= (/ x y) 2.0) -2.0 (/ x y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -29000000000000.0) {
tmp = x / y;
} else if ((x / y) <= -3.2e-55) {
tmp = 2.0 / t;
} else if ((x / y) <= 0.0) {
tmp = -2.0;
} else if ((x / y) <= 3.8e-25) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-29000000000000.0d0)) then
tmp = x / y
else if ((x / y) <= (-3.2d-55)) then
tmp = 2.0d0 / t
else if ((x / y) <= 0.0d0) then
tmp = -2.0d0
else if ((x / y) <= 3.8d-25) then
tmp = 2.0d0 / t
else if ((x / y) <= 2.0d0) then
tmp = -2.0d0
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -29000000000000.0) {
tmp = x / y;
} else if ((x / y) <= -3.2e-55) {
tmp = 2.0 / t;
} else if ((x / y) <= 0.0) {
tmp = -2.0;
} else if ((x / y) <= 3.8e-25) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -29000000000000.0: tmp = x / y elif (x / y) <= -3.2e-55: tmp = 2.0 / t elif (x / y) <= 0.0: tmp = -2.0 elif (x / y) <= 3.8e-25: tmp = 2.0 / t elif (x / y) <= 2.0: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -29000000000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= -3.2e-55) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 0.0) tmp = -2.0; elseif (Float64(x / y) <= 3.8e-25) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2.0) tmp = -2.0; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -29000000000000.0) tmp = x / y; elseif ((x / y) <= -3.2e-55) tmp = 2.0 / t; elseif ((x / y) <= 0.0) tmp = -2.0; elseif ((x / y) <= 3.8e-25) tmp = 2.0 / t; elseif ((x / y) <= 2.0) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -29000000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -3.2e-55], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.0], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 3.8e-25], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.0], -2.0, N[(x / y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -29000000000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -3.2 \cdot 10^{-55}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 0:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 3.8 \cdot 10^{-25}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.9e13 or 2 < (/.f64 x y) Initial program 77.1%
Taylor expanded in x around inf 71.3%
if -2.9e13 < (/.f64 x y) < -3.2000000000000001e-55 or -0.0 < (/.f64 x y) < 3.7999999999999998e-25Initial program 94.9%
Taylor expanded in t around 0 79.4%
associate-*r/79.4%
metadata-eval79.4%
Simplified79.4%
Taylor expanded in z around inf 39.2%
if -3.2000000000000001e-55 < (/.f64 x y) < -0.0 or 3.7999999999999998e-25 < (/.f64 x y) < 2Initial program 81.1%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.8%
associate--l+98.8%
associate-*r/98.8%
metadata-eval98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in t around inf 47.0%
Final simplification55.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z))))
(if (or (<= (/ x y) -5e+20) (not (<= (/ x y) 2e-6)))
(+ (/ x y) t_1)
(+ (/ 2.0 t) (- t_1 2.0)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (t * z);
double tmp;
if (((x / y) <= -5e+20) || !((x / y) <= 2e-6)) {
tmp = (x / y) + t_1;
} else {
tmp = (2.0 / t) + (t_1 - 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 / (t * z)
if (((x / y) <= (-5d+20)) .or. (.not. ((x / y) <= 2d-6))) then
tmp = (x / y) + t_1
else
tmp = (2.0d0 / t) + (t_1 - 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 / (t * z);
double tmp;
if (((x / y) <= -5e+20) || !((x / y) <= 2e-6)) {
tmp = (x / y) + t_1;
} else {
tmp = (2.0 / t) + (t_1 - 2.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (t * z) tmp = 0 if ((x / y) <= -5e+20) or not ((x / y) <= 2e-6): tmp = (x / y) + t_1 else: tmp = (2.0 / t) + (t_1 - 2.0) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(t * z)) tmp = 0.0 if ((Float64(x / y) <= -5e+20) || !(Float64(x / y) <= 2e-6)) tmp = Float64(Float64(x / y) + t_1); else tmp = Float64(Float64(2.0 / t) + Float64(t_1 - 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (t * z); tmp = 0.0; if (((x / y) <= -5e+20) || ~(((x / y) <= 2e-6))) tmp = (x / y) + t_1; else tmp = (2.0 / t) + (t_1 - 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e+20], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-6]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + N[(t$95$1 - 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t \cdot z}\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+20} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{x}{y} + t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + \left(t_1 - 2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -5e20 or 1.99999999999999991e-6 < (/.f64 x y) Initial program 77.5%
Taylor expanded in z around 0 88.6%
if -5e20 < (/.f64 x y) < 1.99999999999999991e-6Initial program 86.9%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.2%
associate--l+99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification94.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+40) (not (<= (/ x y) 1.0))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+40) || !((x / y) <= 1.0)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} 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) <= (-5d+40)) .or. (.not. ((x / y) <= 1.0d0))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
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) <= -5e+40) || !((x / y) <= 1.0)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+40) or not ((x / y) <= 1.0): tmp = (x / y) + ((2.0 / t) + -2.0) 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) <= -5e+40) || !(Float64(x / y) <= 1.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); 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) <= -5e+40) || ~(((x / y) <= 1.0))) tmp = (x / y) + ((2.0 / t) + -2.0); 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], -5e+40], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $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 -5 \cdot 10^{+40} \lor \neg \left(\frac{x}{y} \leq 1\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -5.00000000000000003e40 or 1 < (/.f64 x y) Initial program 76.7%
Taylor expanded in t around 0 97.2%
associate--l+97.2%
associate-*r/97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in z around inf 80.7%
sub-neg80.7%
associate-*r/80.7%
metadata-eval80.7%
metadata-eval80.7%
Simplified80.7%
if -5.00000000000000003e40 < (/.f64 x y) < 1Initial program 87.3%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.6%
associate--l+98.6%
associate-*r/98.6%
metadata-eval98.6%
sub-neg98.6%
metadata-eval98.6%
associate-+l+98.6%
+-commutative98.6%
metadata-eval98.6%
associate-*r/98.6%
*-commutative98.6%
*-commutative98.6%
associate-/r/98.6%
associate-/l*98.6%
associate-/r/98.6%
distribute-lft-in98.6%
associate-*l/98.6%
*-lft-identity98.6%
Simplified98.6%
Final simplification90.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+20) (not (<= (/ x y) 2e-6))) (+ (/ x y) (/ 2.0 (* t z))) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+20) || !((x / y) <= 2e-6)) {
tmp = (x / y) + (2.0 / (t * z));
} 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) <= (-5d+20)) .or. (.not. ((x / y) <= 2d-6))) then
tmp = (x / y) + (2.0d0 / (t * z))
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) <= -5e+20) || !((x / y) <= 2e-6)) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+20) or not ((x / y) <= 2e-6): tmp = (x / y) + (2.0 / (t * z)) 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) <= -5e+20) || !(Float64(x / y) <= 2e-6)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); 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) <= -5e+20) || ~(((x / y) <= 2e-6))) tmp = (x / y) + (2.0 / (t * z)); 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], -5e+20], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-6]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $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 -5 \cdot 10^{+20} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -5e20 or 1.99999999999999991e-6 < (/.f64 x y) Initial program 77.5%
Taylor expanded in z around 0 88.6%
if -5e20 < (/.f64 x y) < 1.99999999999999991e-6Initial program 86.9%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.2%
associate--l+99.2%
associate-*r/99.2%
metadata-eval99.2%
sub-neg99.2%
metadata-eval99.2%
associate-+l+99.2%
+-commutative99.2%
metadata-eval99.2%
associate-*r/99.2%
*-commutative99.2%
*-commutative99.2%
associate-/r/99.2%
associate-/l*99.2%
associate-/r/99.2%
distribute-lft-in99.2%
associate-*l/99.2%
*-lft-identity99.2%
Simplified99.2%
Final simplification94.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1e+188) (/ x y) (if (<= (/ x y) 1.0) (+ (/ (+ 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) <= -1e+188) {
tmp = x / y;
} else if ((x / y) <= 1.0) {
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) <= (-1d+188)) then
tmp = x / y
else if ((x / y) <= 1.0d0) 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) <= -1e+188) {
tmp = x / y;
} else if ((x / y) <= 1.0) {
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) <= -1e+188: tmp = x / y elif (x / y) <= 1.0: 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) <= -1e+188) tmp = Float64(x / y); elseif (Float64(x / y) <= 1.0) 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) <= -1e+188) tmp = x / y; elseif ((x / y) <= 1.0) 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], -1e+188], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.0], 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 -1 \cdot 10^{+188}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 1:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e188 or 1 < (/.f64 x y) Initial program 74.4%
Taylor expanded in x around inf 80.3%
if -1e188 < (/.f64 x y) < 1Initial program 86.6%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 91.1%
associate--l+91.1%
associate-*r/91.1%
metadata-eval91.1%
sub-neg91.1%
metadata-eval91.1%
associate-+l+91.1%
+-commutative91.1%
metadata-eval91.1%
associate-*r/91.1%
*-commutative91.1%
*-commutative91.1%
associate-/r/91.1%
associate-/l*91.0%
associate-/r/91.0%
distribute-lft-in91.0%
associate-*l/91.0%
*-lft-identity91.0%
Simplified91.0%
Final simplification87.6%
(FPCore (x y z t)
:precision binary64
(if (<= z -8.6e+255)
(+ (/ 2.0 t) -2.0)
(if (or (<= z -1.7e-33)
(not
(or (<= z 8.5e-151) (and (not (<= z 1.5e-107)) (<= z 1.35e-48)))))
(- (/ x y) 2.0)
(/ 2.0 (* t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.6e+255) {
tmp = (2.0 / t) + -2.0;
} else if ((z <= -1.7e-33) || !((z <= 8.5e-151) || (!(z <= 1.5e-107) && (z <= 1.35e-48)))) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / (t * z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-8.6d+255)) then
tmp = (2.0d0 / t) + (-2.0d0)
else if ((z <= (-1.7d-33)) .or. (.not. (z <= 8.5d-151) .or. (.not. (z <= 1.5d-107)) .and. (z <= 1.35d-48))) then
tmp = (x / y) - 2.0d0
else
tmp = 2.0d0 / (t * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.6e+255) {
tmp = (2.0 / t) + -2.0;
} else if ((z <= -1.7e-33) || !((z <= 8.5e-151) || (!(z <= 1.5e-107) && (z <= 1.35e-48)))) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / (t * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.6e+255: tmp = (2.0 / t) + -2.0 elif (z <= -1.7e-33) or not ((z <= 8.5e-151) or (not (z <= 1.5e-107) and (z <= 1.35e-48))): tmp = (x / y) - 2.0 else: tmp = 2.0 / (t * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.6e+255) tmp = Float64(Float64(2.0 / t) + -2.0); elseif ((z <= -1.7e-33) || !((z <= 8.5e-151) || (!(z <= 1.5e-107) && (z <= 1.35e-48)))) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(2.0 / Float64(t * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.6e+255) tmp = (2.0 / t) + -2.0; elseif ((z <= -1.7e-33) || ~(((z <= 8.5e-151) || (~((z <= 1.5e-107)) && (z <= 1.35e-48))))) tmp = (x / y) - 2.0; else tmp = 2.0 / (t * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.6e+255], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], If[Or[LessEqual[z, -1.7e-33], N[Not[Or[LessEqual[z, 8.5e-151], And[N[Not[LessEqual[z, 1.5e-107]], $MachinePrecision], LessEqual[z, 1.35e-48]]]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+255}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-33} \lor \neg \left(z \leq 8.5 \cdot 10^{-151} \lor \neg \left(z \leq 1.5 \cdot 10^{-107}\right) \land z \leq 1.35 \cdot 10^{-48}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\end{array}
\end{array}
if z < -8.5999999999999992e255Initial program 57.9%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 83.5%
associate--l+83.5%
associate-*r/83.5%
metadata-eval83.5%
associate-*r/83.5%
metadata-eval83.5%
Simplified83.5%
Taylor expanded in z around inf 83.5%
sub-neg83.5%
associate-*r/83.5%
metadata-eval83.5%
metadata-eval83.5%
+-commutative83.5%
Simplified83.5%
if -8.5999999999999992e255 < z < -1.7e-33 or 8.49999999999999999e-151 < z < 1.4999999999999999e-107 or 1.35000000000000006e-48 < z Initial program 73.5%
Taylor expanded in t around inf 68.4%
if -1.7e-33 < z < 8.49999999999999999e-151 or 1.4999999999999999e-107 < z < 1.35000000000000006e-48Initial program 97.9%
Taylor expanded in t around 0 97.9%
associate--l+97.9%
associate-*r/97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in z around 0 71.1%
Final simplification70.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -1.28e+256)
(+ (/ 2.0 t) -2.0)
(if (<= z -2.15e-33)
t_1
(if (<= z 1.18e-150)
(/ (/ 2.0 z) t)
(if (or (<= z 2.9e-102) (not (<= z 2.2e-44)))
t_1
(/ 2.0 (* t z))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -1.28e+256) {
tmp = (2.0 / t) + -2.0;
} else if (z <= -2.15e-33) {
tmp = t_1;
} else if (z <= 1.18e-150) {
tmp = (2.0 / z) / t;
} else if ((z <= 2.9e-102) || !(z <= 2.2e-44)) {
tmp = t_1;
} else {
tmp = 2.0 / (t * z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-1.28d+256)) then
tmp = (2.0d0 / t) + (-2.0d0)
else if (z <= (-2.15d-33)) then
tmp = t_1
else if (z <= 1.18d-150) then
tmp = (2.0d0 / z) / t
else if ((z <= 2.9d-102) .or. (.not. (z <= 2.2d-44))) then
tmp = t_1
else
tmp = 2.0d0 / (t * z)
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 <= -1.28e+256) {
tmp = (2.0 / t) + -2.0;
} else if (z <= -2.15e-33) {
tmp = t_1;
} else if (z <= 1.18e-150) {
tmp = (2.0 / z) / t;
} else if ((z <= 2.9e-102) || !(z <= 2.2e-44)) {
tmp = t_1;
} else {
tmp = 2.0 / (t * z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -1.28e+256: tmp = (2.0 / t) + -2.0 elif z <= -2.15e-33: tmp = t_1 elif z <= 1.18e-150: tmp = (2.0 / z) / t elif (z <= 2.9e-102) or not (z <= 2.2e-44): tmp = t_1 else: tmp = 2.0 / (t * z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -1.28e+256) tmp = Float64(Float64(2.0 / t) + -2.0); elseif (z <= -2.15e-33) tmp = t_1; elseif (z <= 1.18e-150) tmp = Float64(Float64(2.0 / z) / t); elseif ((z <= 2.9e-102) || !(z <= 2.2e-44)) tmp = t_1; else tmp = Float64(2.0 / Float64(t * z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -1.28e+256) tmp = (2.0 / t) + -2.0; elseif (z <= -2.15e-33) tmp = t_1; elseif (z <= 1.18e-150) tmp = (2.0 / z) / t; elseif ((z <= 2.9e-102) || ~((z <= 2.2e-44))) tmp = t_1; else tmp = 2.0 / (t * z); 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, -1.28e+256], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], If[LessEqual[z, -2.15e-33], t$95$1, If[LessEqual[z, 1.18e-150], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, 2.9e-102], N[Not[LessEqual[z, 2.2e-44]], $MachinePrecision]], t$95$1, N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -1.28 \cdot 10^{+256}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-150}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-102} \lor \neg \left(z \leq 2.2 \cdot 10^{-44}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\end{array}
\end{array}
if z < -1.2799999999999999e256Initial program 57.9%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 83.5%
associate--l+83.5%
associate-*r/83.5%
metadata-eval83.5%
associate-*r/83.5%
metadata-eval83.5%
Simplified83.5%
Taylor expanded in z around inf 83.5%
sub-neg83.5%
associate-*r/83.5%
metadata-eval83.5%
metadata-eval83.5%
+-commutative83.5%
Simplified83.5%
if -1.2799999999999999e256 < z < -2.15000000000000015e-33 or 1.18e-150 < z < 2.89999999999999986e-102 or 2.20000000000000012e-44 < z Initial program 73.5%
Taylor expanded in t around inf 68.4%
if -2.15000000000000015e-33 < z < 1.18e-150Initial program 97.6%
Taylor expanded in t around 0 69.7%
associate-*r/69.7%
metadata-eval69.7%
Simplified69.7%
Taylor expanded in z around 0 69.7%
if 2.89999999999999986e-102 < z < 2.20000000000000012e-44Initial program 100.0%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 84.0%
Final simplification70.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -5.2e+60)
t_1
(if (<= t -6.8e+16)
(+ -2.0 (/ (/ 2.0 z) t))
(if (or (<= t -250.0) (not (<= t 2.15e-16)))
t_1
(/ (+ 2.0 (/ 2.0 z)) t))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -5.2e+60) {
tmp = t_1;
} else if (t <= -6.8e+16) {
tmp = -2.0 + ((2.0 / z) / t);
} else if ((t <= -250.0) || !(t <= 2.15e-16)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (t <= (-5.2d+60)) then
tmp = t_1
else if (t <= (-6.8d+16)) then
tmp = (-2.0d0) + ((2.0d0 / z) / t)
else if ((t <= (-250.0d0)) .or. (.not. (t <= 2.15d-16))) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (t <= -5.2e+60) {
tmp = t_1;
} else if (t <= -6.8e+16) {
tmp = -2.0 + ((2.0 / z) / t);
} else if ((t <= -250.0) || !(t <= 2.15e-16)) {
tmp = t_1;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -5.2e+60: tmp = t_1 elif t <= -6.8e+16: tmp = -2.0 + ((2.0 / z) / t) elif (t <= -250.0) or not (t <= 2.15e-16): tmp = t_1 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -5.2e+60) tmp = t_1; elseif (t <= -6.8e+16) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); elseif ((t <= -250.0) || !(t <= 2.15e-16)) tmp = t_1; else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -5.2e+60) tmp = t_1; elseif (t <= -6.8e+16) tmp = -2.0 + ((2.0 / z) / t); elseif ((t <= -250.0) || ~((t <= 2.15e-16))) tmp = t_1; else tmp = (2.0 + (2.0 / z)) / 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[t, -5.2e+60], t$95$1, If[LessEqual[t, -6.8e+16], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -250.0], N[Not[LessEqual[t, 2.15e-16]], $MachinePrecision]], t$95$1, N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.8 \cdot 10^{+16}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq -250 \lor \neg \left(t \leq 2.15 \cdot 10^{-16}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -5.20000000000000016e60 or -6.8e16 < t < -250 or 2.1499999999999999e-16 < t Initial program 67.4%
Taylor expanded in t around inf 83.6%
if -5.20000000000000016e60 < t < -6.8e16Initial program 91.3%
Taylor expanded in t around 0 99.6%
associate--l+99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 81.3%
associate--l+81.3%
associate-*r/81.3%
metadata-eval81.3%
sub-neg81.3%
metadata-eval81.3%
associate-+l+81.3%
+-commutative81.3%
metadata-eval81.3%
associate-*r/81.3%
*-commutative81.3%
*-commutative81.3%
associate-/r/81.3%
associate-/l*81.3%
associate-/r/81.3%
distribute-lft-in81.3%
associate-*l/81.4%
*-lft-identity81.4%
Simplified81.4%
Taylor expanded in z around 0 81.4%
if -250 < t < 2.1499999999999999e-16Initial program 97.3%
Taylor expanded in t around 0 82.3%
associate-*r/82.3%
metadata-eval82.3%
Simplified82.3%
Final simplification82.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -190000000.0) (not (<= z 2.6e-32))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (+ (/ x y) -2.0) (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -190000000.0) || !(z <= 2.6e-32)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = ((x / y) + -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 ((z <= (-190000000.0d0)) .or. (.not. (z <= 2.6d-32))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = ((x / y) + (-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 ((z <= -190000000.0) || !(z <= 2.6e-32)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = ((x / y) + -2.0) + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -190000000.0) or not (z <= 2.6e-32): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = ((x / y) + -2.0) + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -190000000.0) || !(z <= 2.6e-32)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(Float64(x / y) + -2.0) + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -190000000.0) || ~((z <= 2.6e-32))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = ((x / y) + -2.0) + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -190000000.0], N[Not[LessEqual[z, 2.6e-32]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -190000000 \lor \neg \left(z \leq 2.6 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{x}{y} + -2\right) + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -1.9e8 or 2.5999999999999997e-32 < z Initial program 69.0%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
if -1.9e8 < z < 2.5999999999999997e-32Initial program 97.4%
Taylor expanded in t around 0 97.4%
associate--l+97.4%
associate-*r/97.4%
metadata-eval97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
associate--l+97.4%
associate-*r/97.4%
metadata-eval97.4%
sub-neg97.4%
metadata-eval97.4%
associate-+l+97.4%
associate-+r+97.4%
associate-+l+97.4%
Simplified97.3%
Taylor expanded in z around 0 97.0%
Final simplification98.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.22e+256)
(+ (/ 2.0 t) -2.0)
(if (or (<= z -1.16e-7) (not (<= z 2.6e-32)))
(- (/ x y) 2.0)
(+ -2.0 (/ (/ 2.0 z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.22e+256) {
tmp = (2.0 / t) + -2.0;
} else if ((z <= -1.16e-7) || !(z <= 2.6e-32)) {
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 (z <= (-1.22d+256)) then
tmp = (2.0d0 / t) + (-2.0d0)
else if ((z <= (-1.16d-7)) .or. (.not. (z <= 2.6d-32))) 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 (z <= -1.22e+256) {
tmp = (2.0 / t) + -2.0;
} else if ((z <= -1.16e-7) || !(z <= 2.6e-32)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.22e+256: tmp = (2.0 / t) + -2.0 elif (z <= -1.16e-7) or not (z <= 2.6e-32): 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 (z <= -1.22e+256) tmp = Float64(Float64(2.0 / t) + -2.0); elseif ((z <= -1.16e-7) || !(z <= 2.6e-32)) 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 (z <= -1.22e+256) tmp = (2.0 / t) + -2.0; elseif ((z <= -1.16e-7) || ~((z <= 2.6e-32))) tmp = (x / y) - 2.0; else tmp = -2.0 + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.22e+256], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], If[Or[LessEqual[z, -1.16e-7], N[Not[LessEqual[z, 2.6e-32]], $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}\;z \leq -1.22 \cdot 10^{+256}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-7} \lor \neg \left(z \leq 2.6 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -1.21999999999999999e256Initial program 57.9%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 83.5%
associate--l+83.5%
associate-*r/83.5%
metadata-eval83.5%
associate-*r/83.5%
metadata-eval83.5%
Simplified83.5%
Taylor expanded in z around inf 83.5%
sub-neg83.5%
associate-*r/83.5%
metadata-eval83.5%
metadata-eval83.5%
+-commutative83.5%
Simplified83.5%
if -1.21999999999999999e256 < z < -1.1600000000000001e-7 or 2.5999999999999997e-32 < z Initial program 70.6%
Taylor expanded in t around inf 68.0%
if -1.1600000000000001e-7 < z < 2.5999999999999997e-32Initial program 97.3%
Taylor expanded in t around 0 97.3%
associate--l+97.3%
associate-*r/97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in x around 0 78.7%
associate--l+78.7%
associate-*r/78.7%
metadata-eval78.7%
sub-neg78.7%
metadata-eval78.7%
associate-+l+78.7%
+-commutative78.7%
metadata-eval78.7%
associate-*r/78.7%
*-commutative78.7%
*-commutative78.7%
associate-/r/78.7%
associate-/l*78.7%
associate-/r/78.7%
distribute-lft-in78.7%
associate-*l/78.7%
*-lft-identity78.7%
Simplified78.7%
Taylor expanded in z around 0 78.4%
Final simplification73.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.72e+16) (not (<= (/ x y) 7200000000.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.72e+16) || !((x / y) <= 7200000000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1.72d+16)) .or. (.not. ((x / y) <= 7200000000.0d0))) then
tmp = x / y
else
tmp = (2.0d0 / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.72e+16) || !((x / y) <= 7200000000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.72e+16) or not ((x / y) <= 7200000000.0): tmp = x / y else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.72e+16) || !(Float64(x / y) <= 7200000000.0)) tmp = Float64(x / y); else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1.72e+16) || ~(((x / y) <= 7200000000.0))) tmp = x / y; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.72e+16], N[Not[LessEqual[N[(x / y), $MachinePrecision], 7200000000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.72 \cdot 10^{+16} \lor \neg \left(\frac{x}{y} \leq 7200000000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.72e16 or 7.2e9 < (/.f64 x y) Initial program 77.1%
Taylor expanded in x around inf 71.3%
if -1.72e16 < (/.f64 x y) < 7.2e9Initial program 87.1%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.2%
associate--l+99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in z around inf 60.1%
sub-neg60.1%
associate-*r/60.1%
metadata-eval60.1%
metadata-eval60.1%
+-commutative60.1%
Simplified60.1%
Final simplification65.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2.05e+17) (/ x y) (if (<= (/ x y) 8.2e-19) (+ (/ 2.0 t) -2.0) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.05e+17) {
tmp = x / y;
} else if ((x / y) <= 8.2e-19) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-2.05d+17)) then
tmp = x / y
else if ((x / y) <= 8.2d-19) then
tmp = (2.0d0 / t) + (-2.0d0)
else
tmp = (x / y) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.05e+17) {
tmp = x / y;
} else if ((x / y) <= 8.2e-19) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2.05e+17: tmp = x / y elif (x / y) <= 8.2e-19: tmp = (2.0 / t) + -2.0 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2.05e+17) tmp = Float64(x / y); elseif (Float64(x / y) <= 8.2e-19) tmp = Float64(Float64(2.0 / t) + -2.0); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2.05e+17) tmp = x / y; elseif ((x / y) <= 8.2e-19) tmp = (2.0 / t) + -2.0; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2.05e+17], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 8.2e-19], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.05 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 8.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -2.05e17Initial program 77.4%
Taylor expanded in x around inf 64.8%
if -2.05e17 < (/.f64 x y) < 8.1999999999999997e-19Initial program 87.9%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 60.9%
sub-neg60.9%
associate-*r/60.9%
metadata-eval60.9%
metadata-eval60.9%
+-commutative60.9%
Simplified60.9%
if 8.1999999999999997e-19 < (/.f64 x y) Initial program 76.1%
Taylor expanded in t around inf 75.9%
Final simplification65.4%
(FPCore (x y z t) :precision binary64 (+ (/ (+ 2.0 (/ 2.0 z)) t) (+ (/ x y) -2.0)))
double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / t) + ((x / y) + -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 + (2.0d0 / z)) / t) + ((x / y) + (-2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / t) + ((x / y) + -2.0);
}
def code(x, y, z, t): return ((2.0 + (2.0 / z)) / t) + ((x / y) + -2.0)
function code(x, y, z, t) return Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + Float64(Float64(x / y) + -2.0)) end
function tmp = code(x, y, z, t) tmp = ((2.0 + (2.0 / z)) / t) + ((x / y) + -2.0); end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 + \frac{2}{z}}{t} + \left(\frac{x}{y} + -2\right)
\end{array}
Initial program 82.6%
Taylor expanded in t around 0 98.7%
associate--l+98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in x around 0 98.7%
associate--l+98.7%
associate-*r/98.7%
metadata-eval98.7%
sub-neg98.7%
metadata-eval98.7%
associate-+l+98.7%
associate-+r+98.7%
associate-+l+98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (<= t -5.5e-9) -2.0 (if (<= t 1.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.5e-9) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5.5d-9)) then
tmp = -2.0d0
else if (t <= 1.0d0) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.5e-9) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.5e-9: tmp = -2.0 elif t <= 1.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.5e-9) tmp = -2.0; elseif (t <= 1.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.5e-9) tmp = -2.0; elseif (t <= 1.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.5e-9], -2.0, If[LessEqual[t, 1.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-9}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -5.4999999999999996e-9 or 1 < t Initial program 69.3%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 59.1%
associate--l+59.1%
associate-*r/59.1%
metadata-eval59.1%
associate-*r/59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in t around inf 36.9%
if -5.4999999999999996e-9 < t < 1Initial program 97.3%
Taylor expanded in t around 0 80.1%
associate-*r/80.1%
metadata-eval80.1%
Simplified80.1%
Taylor expanded in z around inf 37.9%
Final simplification37.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%
Taylor expanded in t around 0 98.7%
associate--l+98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in x around 0 69.2%
associate--l+69.2%
associate-*r/69.2%
metadata-eval69.2%
associate-*r/69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in t around inf 20.5%
Final simplification20.5%
(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 2023271
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))