
(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 85.8%
Taylor expanded in t around inf 98.7%
sub-neg98.7%
metadata-eval98.7%
associate-*r/98.7%
+-commutative98.7%
metadata-eval98.7%
associate-+l+98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2.0)
(/ x y)
(if (<= (/ x y) 0.000118)
-2.0
(if (<= (/ x y) 6.8e+45) (/ 2.0 t) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.0) {
tmp = x / y;
} else if ((x / y) <= 0.000118) {
tmp = -2.0;
} else if ((x / y) <= 6.8e+45) {
tmp = 2.0 / t;
} 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) <= (-2.0d0)) then
tmp = x / y
else if ((x / y) <= 0.000118d0) then
tmp = -2.0d0
else if ((x / y) <= 6.8d+45) then
tmp = 2.0d0 / t
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) <= -2.0) {
tmp = x / y;
} else if ((x / y) <= 0.000118) {
tmp = -2.0;
} else if ((x / y) <= 6.8e+45) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2.0: tmp = x / y elif (x / y) <= 0.000118: tmp = -2.0 elif (x / y) <= 6.8e+45: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 0.000118) tmp = -2.0; elseif (Float64(x / y) <= 6.8e+45) tmp = Float64(2.0 / t); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2.0) tmp = x / y; elseif ((x / y) <= 0.000118) tmp = -2.0; elseif ((x / y) <= 6.8e+45) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.000118], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 6.8e+45], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 0.000118:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 6.8 \cdot 10^{+45}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2 or 6.8e45 < (/.f64 x y) Initial program 79.7%
Taylor expanded in x around inf 69.7%
if -2 < (/.f64 x y) < 1.18e-4Initial program 90.7%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.9%
sub-neg98.9%
*-commutative98.9%
associate-/r*98.8%
associate-*r/98.8%
*-commutative98.8%
associate-/l*98.8%
distribute-lft-in98.8%
associate-*l/98.9%
*-lft-identity98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in t around inf 38.6%
if 1.18e-4 < (/.f64 x y) < 6.8e45Initial program 90.9%
Taylor expanded in t around 0 82.5%
associate-*r/82.5%
metadata-eval82.5%
Simplified82.5%
Taylor expanded in z around inf 55.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -170000.0) (not (<= t 0.16))) (+ (/ x y) (+ -2.0 (/ (/ 2.0 t) z))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -170000.0) || !(t <= 0.16)) {
tmp = (x / y) + (-2.0 + ((2.0 / t) / z));
} else {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (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 ((t <= (-170000.0d0)) .or. (.not. (t <= 0.16d0))) then
tmp = (x / y) + ((-2.0d0) + ((2.0d0 / t) / z))
else
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (t * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -170000.0) || !(t <= 0.16)) {
tmp = (x / y) + (-2.0 + ((2.0 / t) / z));
} else {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -170000.0) or not (t <= 0.16): tmp = (x / y) + (-2.0 + ((2.0 / t) / z)) else: tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -170000.0) || !(t <= 0.16)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 / t) / z))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -170000.0) || ~((t <= 0.16))) tmp = (x / y) + (-2.0 + ((2.0 / t) / z)); else tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -170000.0], N[Not[LessEqual[t, 0.16]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -170000 \lor \neg \left(t \leq 0.16\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{\frac{2}{t}}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{t \cdot z}\\
\end{array}
\end{array}
if t < -1.7e5 or 0.160000000000000003 < t Initial program 71.3%
Taylor expanded in t around inf 71.2%
*-commutative71.2%
*-commutative71.2%
*-commutative71.2%
associate-*r*71.2%
Simplified71.2%
Taylor expanded in x around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
associate-/r*99.8%
Simplified99.8%
if -1.7e5 < t < 0.160000000000000003Initial program 97.6%
Taylor expanded in t around 0 96.6%
Final simplification98.1%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2e-13)
(+ (/ x y) (+ (/ 2.0 t) -2.0))
(if (<= (/ x y) 4e+85)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(+ (/ x y) (/ 2.0 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e-13) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else if ((x / y) <= 4e+85) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + (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) <= (-2d-13)) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else if ((x / y) <= 4d+85) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x / y) + (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) <= -2e-13) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else if ((x / y) <= 4e+85) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e-13: tmp = (x / y) + ((2.0 / t) + -2.0) elif (x / y) <= 4e+85: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e-13) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); elseif (Float64(x / y) <= 4e+85) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x / y) + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e-13) tmp = (x / y) + ((2.0 / t) + -2.0); elseif ((x / y) <= 4e+85) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e-13], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4e+85], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-13}:\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{+85}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.0000000000000001e-13Initial program 79.8%
Taylor expanded in t around inf 97.0%
sub-neg97.0%
metadata-eval97.0%
associate-*r/97.0%
+-commutative97.0%
metadata-eval97.0%
associate-+l+97.0%
associate-*r/97.0%
metadata-eval97.0%
associate-*r/97.0%
metadata-eval97.0%
Simplified97.0%
Taylor expanded in z around inf 78.2%
sub-neg78.2%
associate-*r/78.2%
metadata-eval78.2%
metadata-eval78.2%
Simplified78.2%
if -2.0000000000000001e-13 < (/.f64 x y) < 4.0000000000000001e85Initial program 90.8%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 97.5%
sub-neg97.5%
*-commutative97.5%
associate-/r*97.5%
associate-*r/97.5%
*-commutative97.5%
associate-/l*97.4%
distribute-lft-in97.4%
associate-*l/97.5%
*-lft-identity97.5%
metadata-eval97.5%
Simplified97.5%
if 4.0000000000000001e85 < (/.f64 x y) Initial program 78.5%
Taylor expanded in t around 0 97.5%
Taylor expanded in z around inf 90.9%
associate-*r/90.9%
metadata-eval90.9%
+-commutative90.9%
Simplified90.9%
Final simplification91.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= z -3.6e-25)
t_1
(if (<= z 68000000000.0)
(+ -2.0 (/ (/ 2.0 z) t))
(if (<= z 9.5e+101) (- (/ x y) 2.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -3.6e-25) {
tmp = t_1;
} else if (z <= 68000000000.0) {
tmp = -2.0 + ((2.0 / z) / t);
} else if (z <= 9.5e+101) {
tmp = (x / y) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (2.0d0 / t)
if (z <= (-3.6d-25)) then
tmp = t_1
else if (z <= 68000000000.0d0) then
tmp = (-2.0d0) + ((2.0d0 / z) / t)
else if (z <= 9.5d+101) then
tmp = (x / y) - 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -3.6e-25) {
tmp = t_1;
} else if (z <= 68000000000.0) {
tmp = -2.0 + ((2.0 / z) / t);
} else if (z <= 9.5e+101) {
tmp = (x / y) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if z <= -3.6e-25: tmp = t_1 elif z <= 68000000000.0: tmp = -2.0 + ((2.0 / z) / t) elif z <= 9.5e+101: tmp = (x / y) - 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (z <= -3.6e-25) tmp = t_1; elseif (z <= 68000000000.0) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); elseif (z <= 9.5e+101) tmp = Float64(Float64(x / y) - 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if (z <= -3.6e-25) tmp = t_1; elseif (z <= 68000000000.0) tmp = -2.0 + ((2.0 / z) / t); elseif (z <= 9.5e+101) tmp = (x / y) - 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-25], t$95$1, If[LessEqual[z, 68000000000.0], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+101], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 68000000000:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+101}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5999999999999999e-25 or 9.49999999999999947e101 < z Initial program 73.7%
Taylor expanded in t around 0 86.2%
Taylor expanded in z around inf 83.7%
associate-*r/83.7%
metadata-eval83.7%
+-commutative83.7%
Simplified83.7%
if -3.5999999999999999e-25 < z < 6.8e10Initial program 97.5%
Taylor expanded in t around inf 97.5%
sub-neg97.5%
metadata-eval97.5%
associate-*r/97.5%
+-commutative97.5%
metadata-eval97.5%
associate-+l+97.5%
associate-*r/97.5%
metadata-eval97.5%
associate-*r/97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in x around 0 80.4%
sub-neg80.4%
*-commutative80.4%
associate-/r*80.4%
associate-*r/80.4%
*-commutative80.4%
associate-/l*80.3%
distribute-lft-in80.3%
associate-*l/80.5%
*-lft-identity80.5%
metadata-eval80.5%
Simplified80.5%
Taylor expanded in z around 0 78.6%
if 6.8e10 < z < 9.49999999999999947e101Initial program 77.3%
Taylor expanded in t around inf 81.7%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= z -3.9e-25)
t_1
(if (<= z 68000000000.0)
(+ -2.0 (/ (/ 2.0 t) z))
(if (<= z 7.8e+102) (- (/ x y) 2.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -3.9e-25) {
tmp = t_1;
} else if (z <= 68000000000.0) {
tmp = -2.0 + ((2.0 / t) / z);
} else if (z <= 7.8e+102) {
tmp = (x / y) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (2.0d0 / t)
if (z <= (-3.9d-25)) then
tmp = t_1
else if (z <= 68000000000.0d0) then
tmp = (-2.0d0) + ((2.0d0 / t) / z)
else if (z <= 7.8d+102) then
tmp = (x / y) - 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -3.9e-25) {
tmp = t_1;
} else if (z <= 68000000000.0) {
tmp = -2.0 + ((2.0 / t) / z);
} else if (z <= 7.8e+102) {
tmp = (x / y) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if z <= -3.9e-25: tmp = t_1 elif z <= 68000000000.0: tmp = -2.0 + ((2.0 / t) / z) elif z <= 7.8e+102: tmp = (x / y) - 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (z <= -3.9e-25) tmp = t_1; elseif (z <= 68000000000.0) tmp = Float64(-2.0 + Float64(Float64(2.0 / t) / z)); elseif (z <= 7.8e+102) tmp = Float64(Float64(x / y) - 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if (z <= -3.9e-25) tmp = t_1; elseif (z <= 68000000000.0) tmp = -2.0 + ((2.0 / t) / z); elseif (z <= 7.8e+102) tmp = (x / y) - 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9e-25], t$95$1, If[LessEqual[z, 68000000000.0], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+102], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 68000000000:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+102}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.9e-25 or 7.7999999999999997e102 < z Initial program 73.7%
Taylor expanded in t around 0 86.2%
Taylor expanded in z around inf 83.7%
associate-*r/83.7%
metadata-eval83.7%
+-commutative83.7%
Simplified83.7%
if -3.9e-25 < z < 6.8e10Initial program 97.5%
Taylor expanded in t around inf 95.6%
*-commutative95.6%
*-commutative95.6%
*-commutative95.6%
associate-*r*95.6%
Simplified95.6%
Taylor expanded in x around 0 78.6%
sub-neg78.6%
associate-*r/78.6%
metadata-eval78.6%
associate-/r*78.6%
metadata-eval78.6%
Simplified78.6%
if 6.8e10 < z < 7.7999999999999997e102Initial program 77.3%
Taylor expanded in t around inf 81.7%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= z -1.15e-25)
t_1
(if (<= z 2.3e-171)
(/ (/ 2.0 z) t)
(if (<= z 1.5e+103) (- (/ x y) 2.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -1.15e-25) {
tmp = t_1;
} else if (z <= 2.3e-171) {
tmp = (2.0 / z) / t;
} else if (z <= 1.5e+103) {
tmp = (x / y) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (2.0d0 / t)
if (z <= (-1.15d-25)) then
tmp = t_1
else if (z <= 2.3d-171) then
tmp = (2.0d0 / z) / t
else if (z <= 1.5d+103) then
tmp = (x / y) - 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -1.15e-25) {
tmp = t_1;
} else if (z <= 2.3e-171) {
tmp = (2.0 / z) / t;
} else if (z <= 1.5e+103) {
tmp = (x / y) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if z <= -1.15e-25: tmp = t_1 elif z <= 2.3e-171: tmp = (2.0 / z) / t elif z <= 1.5e+103: tmp = (x / y) - 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (z <= -1.15e-25) tmp = t_1; elseif (z <= 2.3e-171) tmp = Float64(Float64(2.0 / z) / t); elseif (z <= 1.5e+103) tmp = Float64(Float64(x / y) - 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if (z <= -1.15e-25) tmp = t_1; elseif (z <= 2.3e-171) tmp = (2.0 / z) / t; elseif (z <= 1.5e+103) tmp = (x / y) - 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-25], t$95$1, If[LessEqual[z, 2.3e-171], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.5e+103], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-171}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+103}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.15e-25 or 1.5e103 < z Initial program 73.7%
Taylor expanded in t around 0 86.2%
Taylor expanded in z around inf 83.7%
associate-*r/83.7%
metadata-eval83.7%
+-commutative83.7%
Simplified83.7%
if -1.15e-25 < z < 2.29999999999999978e-171Initial program 97.6%
Taylor expanded in t around 0 71.2%
associate-*r/71.2%
metadata-eval71.2%
Simplified71.2%
Taylor expanded in z around 0 71.2%
if 2.29999999999999978e-171 < z < 1.5e103Initial program 90.0%
Taylor expanded in t around inf 71.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.8) (not (<= z 4.3e-5))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (+ -2.0 (/ (/ 2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8) || !(z <= 4.3e-5)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (-2.0 + ((2.0 / t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-5.8d0)) .or. (.not. (z <= 4.3d-5))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + ((-2.0d0) + ((2.0d0 / t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8) || !(z <= 4.3e-5)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (-2.0 + ((2.0 / t) / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.8) or not (z <= 4.3e-5): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + (-2.0 + ((2.0 / t) / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.8) || !(z <= 4.3e-5)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 / t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.8) || ~((z <= 4.3e-5))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + (-2.0 + ((2.0 / t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.8], N[Not[LessEqual[z, 4.3e-5]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \lor \neg \left(z \leq 4.3 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{\frac{2}{t}}{z}\right)\\
\end{array}
\end{array}
if z < -5.79999999999999982 or 4.3000000000000002e-5 < z Initial program 73.7%
Taylor expanded in t around inf 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
metadata-eval100.0%
associate-+l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 98.7%
sub-neg98.7%
associate-*r/98.7%
metadata-eval98.7%
metadata-eval98.7%
Simplified98.7%
if -5.79999999999999982 < z < 4.3000000000000002e-5Initial program 97.5%
Taylor expanded in t around inf 96.3%
*-commutative96.3%
*-commutative96.3%
*-commutative96.3%
associate-*r*96.3%
Simplified96.3%
Taylor expanded in x around 0 96.3%
associate-*r/96.3%
metadata-eval96.3%
+-commutative96.3%
associate--l+96.3%
sub-neg96.3%
metadata-eval96.3%
associate-/r*96.3%
Simplified96.3%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -7.2e-70)
t_1
(if (<= z 2.6e-171)
(/ (/ 2.0 z) t)
(if (<= z 1.2e+160) t_1 (+ (/ 2.0 t) -2.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -7.2e-70) {
tmp = t_1;
} else if (z <= 2.6e-171) {
tmp = (2.0 / z) / t;
} else if (z <= 1.2e+160) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-7.2d-70)) then
tmp = t_1
else if (z <= 2.6d-171) then
tmp = (2.0d0 / z) / t
else if (z <= 1.2d+160) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (z <= -7.2e-70) {
tmp = t_1;
} else if (z <= 2.6e-171) {
tmp = (2.0 / z) / t;
} else if (z <= 1.2e+160) {
tmp = t_1;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -7.2e-70: tmp = t_1 elif z <= 2.6e-171: tmp = (2.0 / z) / t elif z <= 1.2e+160: tmp = t_1 else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -7.2e-70) tmp = t_1; elseif (z <= 2.6e-171) tmp = Float64(Float64(2.0 / z) / t); elseif (z <= 1.2e+160) tmp = t_1; else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -7.2e-70) tmp = t_1; elseif (z <= 2.6e-171) tmp = (2.0 / z) / t; elseif (z <= 1.2e+160) tmp = t_1; else tmp = (2.0 / t) + -2.0; 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, -7.2e-70], t$95$1, If[LessEqual[z, 2.6e-171], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.2e+160], t$95$1, N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-171}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if z < -7.2000000000000004e-70 or 2.60000000000000005e-171 < z < 1.2000000000000001e160Initial program 83.8%
Taylor expanded in t around inf 66.6%
if -7.2000000000000004e-70 < z < 2.60000000000000005e-171Initial program 97.4%
Taylor expanded in t around 0 72.8%
associate-*r/72.8%
metadata-eval72.8%
Simplified72.8%
Taylor expanded in z around 0 72.8%
if 1.2000000000000001e160 < z Initial program 66.5%
Taylor expanded in t around inf 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
metadata-eval100.0%
associate-+l+100.0%
associate-*r/100.0%
metadata-eval100.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%
Taylor expanded in x around 0 63.9%
sub-neg63.9%
metadata-eval63.9%
associate-*r/63.9%
metadata-eval63.9%
+-commutative63.9%
Simplified63.9%
Final simplification68.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -2.4e-69)
t_1
(if (<= z 2.1e-171)
(/ 2.0 (* t z))
(if (<= z 1.25e+160) t_1 (+ (/ 2.0 t) -2.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -2.4e-69) {
tmp = t_1;
} else if (z <= 2.1e-171) {
tmp = 2.0 / (t * z);
} else if (z <= 1.25e+160) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-2.4d-69)) then
tmp = t_1
else if (z <= 2.1d-171) then
tmp = 2.0d0 / (t * z)
else if (z <= 1.25d+160) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (z <= -2.4e-69) {
tmp = t_1;
} else if (z <= 2.1e-171) {
tmp = 2.0 / (t * z);
} else if (z <= 1.25e+160) {
tmp = t_1;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -2.4e-69: tmp = t_1 elif z <= 2.1e-171: tmp = 2.0 / (t * z) elif z <= 1.25e+160: tmp = t_1 else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -2.4e-69) tmp = t_1; elseif (z <= 2.1e-171) tmp = Float64(2.0 / Float64(t * z)); elseif (z <= 1.25e+160) tmp = t_1; else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -2.4e-69) tmp = t_1; elseif (z <= 2.1e-171) tmp = 2.0 / (t * z); elseif (z <= 1.25e+160) tmp = t_1; else tmp = (2.0 / t) + -2.0; 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, -2.4e-69], t$95$1, If[LessEqual[z, 2.1e-171], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+160], t$95$1, N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-171}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if z < -2.4000000000000001e-69 or 2.1e-171 < z < 1.25e160Initial program 83.8%
Taylor expanded in t around inf 66.6%
if -2.4000000000000001e-69 < z < 2.1e-171Initial program 97.4%
Taylor expanded in z around 0 72.8%
if 1.25e160 < z Initial program 66.5%
Taylor expanded in t around inf 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
metadata-eval100.0%
associate-+l+100.0%
associate-*r/100.0%
metadata-eval100.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%
Taylor expanded in x around 0 63.9%
sub-neg63.9%
metadata-eval63.9%
associate-*r/63.9%
metadata-eval63.9%
+-commutative63.9%
Simplified63.9%
Final simplification68.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.9e-25) (not (<= z 1.1e-8))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.9e-25) || !(z <= 1.1e-8)) {
tmp = (x / y) + ((2.0 / t) + -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.9d-25)) .or. (.not. (z <= 1.1d-8))) then
tmp = (x / y) + ((2.0d0 / t) + (-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.9e-25) || !(z <= 1.1e-8)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.9e-25) or not (z <= 1.1e-8): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = -2.0 + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.9e-25) || !(z <= 1.1e-8)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -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.9e-25) || ~((z <= 1.1e-8))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = -2.0 + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.9e-25], N[Not[LessEqual[z, 1.1e-8]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-25} \lor \neg \left(z \leq 1.1 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -1.8999999999999999e-25 or 1.0999999999999999e-8 < z Initial program 75.2%
Taylor expanded in t around inf 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
metadata-eval100.0%
associate-+l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 97.3%
sub-neg97.3%
associate-*r/97.3%
metadata-eval97.3%
metadata-eval97.3%
Simplified97.3%
if -1.8999999999999999e-25 < z < 1.0999999999999999e-8Initial program 97.4%
Taylor expanded in t around inf 97.3%
sub-neg97.3%
metadata-eval97.3%
associate-*r/97.3%
+-commutative97.3%
metadata-eval97.3%
associate-+l+97.3%
associate-*r/97.3%
metadata-eval97.3%
associate-*r/97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in x around 0 79.6%
sub-neg79.6%
*-commutative79.6%
associate-/r*79.6%
associate-*r/79.6%
*-commutative79.6%
associate-/l*79.5%
distribute-lft-in79.5%
associate-*l/79.7%
*-lft-identity79.7%
metadata-eval79.7%
Simplified79.7%
Taylor expanded in z around 0 79.2%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.2e+96) (not (<= (/ x y) 8e+45))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.2e+96) || !((x / y) <= 8e+45)) {
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.2d+96)) .or. (.not. ((x / y) <= 8d+45))) 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.2e+96) || !((x / y) <= 8e+45)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.2e+96) or not ((x / y) <= 8e+45): 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.2e+96) || !(Float64(x / y) <= 8e+45)) 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.2e+96) || ~(((x / y) <= 8e+45))) 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.2e+96], N[Not[LessEqual[N[(x / y), $MachinePrecision], 8e+45]], $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.2 \cdot 10^{+96} \lor \neg \left(\frac{x}{y} \leq 8 \cdot 10^{+45}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.19999999999999996e96 or 7.9999999999999994e45 < (/.f64 x y) Initial program 79.7%
Taylor expanded in x around inf 76.3%
if -1.19999999999999996e96 < (/.f64 x y) < 7.9999999999999994e45Initial program 89.3%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.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 65.0%
sub-neg65.0%
associate-*r/65.0%
metadata-eval65.0%
metadata-eval65.0%
Simplified65.0%
Taylor expanded in x around 0 58.5%
sub-neg58.5%
metadata-eval58.5%
associate-*r/58.5%
metadata-eval58.5%
+-commutative58.5%
Simplified58.5%
Final simplification65.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -0.00115) (- (/ x y) 2.0) (if (<= (/ x y) 5.6e+45) (+ (/ 2.0 t) -2.0) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -0.00115) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 5.6e+45) {
tmp = (2.0 / 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) <= (-0.00115d0)) then
tmp = (x / y) - 2.0d0
else if ((x / y) <= 5.6d+45) then
tmp = (2.0d0 / 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) <= -0.00115) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 5.6e+45) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -0.00115: tmp = (x / y) - 2.0 elif (x / y) <= 5.6e+45: tmp = (2.0 / t) + -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -0.00115) tmp = Float64(Float64(x / y) - 2.0); elseif (Float64(x / y) <= 5.6e+45) tmp = Float64(Float64(2.0 / 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) <= -0.00115) tmp = (x / y) - 2.0; elseif ((x / y) <= 5.6e+45) tmp = (2.0 / t) + -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -0.00115], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5.6e+45], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.00115:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 5.6 \cdot 10^{+45}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.00115Initial program 79.2%
Taylor expanded in t around inf 65.9%
if -0.00115 < (/.f64 x y) < 5.5999999999999999e45Initial program 90.6%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.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 63.2%
sub-neg63.2%
associate-*r/63.2%
metadata-eval63.2%
metadata-eval63.2%
Simplified63.2%
Taylor expanded in x around 0 61.3%
sub-neg61.3%
metadata-eval61.3%
associate-*r/61.3%
metadata-eval61.3%
+-commutative61.3%
Simplified61.3%
if 5.5999999999999999e45 < (/.f64 x y) Initial program 80.8%
Taylor expanded in x around inf 77.5%
Final simplification65.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.0019) (not (<= t 2.2e-10))) (- (/ 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.0019) || !(t <= 2.2e-10)) {
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.0019d0)) .or. (.not. (t <= 2.2d-10))) 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.0019) || !(t <= 2.2e-10)) {
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.0019) or not (t <= 2.2e-10): 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.0019) || !(t <= 2.2e-10)) 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.0019) || ~((t <= 2.2e-10))) 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.0019], N[Not[LessEqual[t, 2.2e-10]], $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.0019 \lor \neg \left(t \leq 2.2 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -0.0019 or 2.1999999999999999e-10 < t Initial program 72.0%
Taylor expanded in t around inf 87.6%
if -0.0019 < t < 2.1999999999999999e-10Initial program 97.6%
Taylor expanded in t around 0 80.7%
associate-*r/80.7%
metadata-eval80.7%
Simplified80.7%
Final simplification83.9%
(FPCore (x y z t) :precision binary64 (if (<= t -11000.0) -2.0 (if (<= t 6.5e+30) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -11000.0) {
tmp = -2.0;
} else if (t <= 6.5e+30) {
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 <= (-11000.0d0)) then
tmp = -2.0d0
else if (t <= 6.5d+30) 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 <= -11000.0) {
tmp = -2.0;
} else if (t <= 6.5e+30) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -11000.0: tmp = -2.0 elif t <= 6.5e+30: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -11000.0) tmp = -2.0; elseif (t <= 6.5e+30) 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 <= -11000.0) tmp = -2.0; elseif (t <= 6.5e+30) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -11000.0], -2.0, If[LessEqual[t, 6.5e+30], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -11000:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -11000 or 6.5e30 < t Initial program 70.6%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 58.8%
sub-neg58.8%
*-commutative58.8%
associate-/r*58.8%
associate-*r/58.8%
*-commutative58.8%
associate-/l*58.8%
distribute-lft-in58.8%
associate-*l/58.8%
*-lft-identity58.8%
metadata-eval58.8%
Simplified58.8%
Taylor expanded in t around inf 46.4%
if -11000 < t < 6.5e30Initial program 97.0%
Taylor expanded in t around 0 76.1%
associate-*r/76.1%
metadata-eval76.1%
Simplified76.1%
Taylor expanded in z around inf 33.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 85.8%
Taylor expanded in t around inf 98.7%
sub-neg98.7%
metadata-eval98.7%
associate-*r/98.7%
+-commutative98.7%
metadata-eval98.7%
associate-+l+98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in x around 0 69.2%
sub-neg69.2%
*-commutative69.2%
associate-/r*69.2%
associate-*r/69.2%
*-commutative69.2%
associate-/l*69.2%
distribute-lft-in69.2%
associate-*l/69.3%
*-lft-identity69.3%
metadata-eval69.3%
Simplified69.3%
Taylor expanded in t around inf 21.1%
(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 2024163
(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))))