
(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 15 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.4%
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
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= (/ x y) -2e+35)
t_1
(if (<= (/ x y) -0.001)
(/ 2.0 (* t z))
(if (<= (/ x y) 2e-6) (+ (/ 2.0 t) -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 ((x / y) <= -2e+35) {
tmp = t_1;
} else if ((x / y) <= -0.001) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= 2e-6) {
tmp = (2.0 / t) + -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 ((x / y) <= (-2d+35)) then
tmp = t_1
else if ((x / y) <= (-0.001d0)) then
tmp = 2.0d0 / (t * z)
else if ((x / y) <= 2d-6) then
tmp = (2.0d0 / t) + (-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 ((x / y) <= -2e+35) {
tmp = t_1;
} else if ((x / y) <= -0.001) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= 2e-6) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if (x / y) <= -2e+35: tmp = t_1 elif (x / y) <= -0.001: tmp = 2.0 / (t * z) elif (x / y) <= 2e-6: tmp = (2.0 / t) + -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 (Float64(x / y) <= -2e+35) tmp = t_1; elseif (Float64(x / y) <= -0.001) tmp = Float64(2.0 / Float64(t * z)); elseif (Float64(x / y) <= 2e-6) tmp = Float64(Float64(2.0 / t) + -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 ((x / y) <= -2e+35) tmp = t_1; elseif ((x / y) <= -0.001) tmp = 2.0 / (t * z); elseif ((x / y) <= 2e-6) tmp = (2.0 / t) + -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[N[(x / y), $MachinePrecision], -2e+35], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -0.001], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-6], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -0.001:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -1.9999999999999999e35 or 1.99999999999999991e-6 < (/.f64 x y) Initial program 83.0%
Taylor expanded in t around 0 97.3%
Taylor expanded in z around inf 80.1%
associate-*r/80.1%
metadata-eval80.1%
+-commutative80.1%
Simplified80.1%
if -1.9999999999999999e35 < (/.f64 x y) < -1e-3Initial program 88.9%
Taylor expanded in z around 0 80.5%
if -1e-3 < (/.f64 x y) < 1.99999999999999991e-6Initial program 87.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 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
metadata-eval99.9%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
distribute-rgt1-in99.9%
Simplified99.9%
Taylor expanded in z around inf 67.5%
sub-neg67.5%
associate-*r/67.5%
metadata-eval67.5%
metadata-eval67.5%
Simplified67.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5000000.0) (not (<= (/ x y) 1e-26))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* t z))) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5000000.0) || !((x / y) <= 1e-26)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-5000000.0d0)) .or. (.not. ((x / y) <= 1d-26))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (t * z))
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5000000.0) || !((x / y) <= 1e-26)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5000000.0) or not ((x / y) <= 1e-26): tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5000000.0) || !(Float64(x / y) <= 1e-26)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(t * z))); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5000000.0) || ~(((x / y) <= 1e-26))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e-26]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5000000 \lor \neg \left(\frac{x}{y} \leq 10^{-26}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -5e6 or 1e-26 < (/.f64 x y) Initial program 83.6%
Taylor expanded in t around 0 97.2%
if -5e6 < (/.f64 x y) < 1e-26Initial program 87.4%
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 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
metadata-eval99.9%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
distribute-rgt1-in99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-commutative99.9%
metadata-eval99.9%
sub-neg99.9%
associate-/r*99.9%
*-rgt-identity99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-+l+99.9%
metadata-eval99.9%
associate-*r/99.9%
distribute-rgt-in99.9%
associate-*l/99.9%
*-lft-identity99.9%
Simplified99.9%
Final simplification98.5%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2e+35)
(/ x y)
(if (<= (/ x y) -0.001)
(/ 2.0 (* t z))
(if (<= (/ x y) 1000000.0) (+ (/ 2.0 t) -2.0) (- (/ x y) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+35) {
tmp = x / y;
} else if ((x / y) <= -0.001) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= 1000000.0) {
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) <= (-2d+35)) then
tmp = x / y
else if ((x / y) <= (-0.001d0)) then
tmp = 2.0d0 / (t * z)
else if ((x / y) <= 1000000.0d0) 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) <= -2e+35) {
tmp = x / y;
} else if ((x / y) <= -0.001) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= 1000000.0) {
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) <= -2e+35: tmp = x / y elif (x / y) <= -0.001: tmp = 2.0 / (t * z) elif (x / y) <= 1000000.0: 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) <= -2e+35) tmp = Float64(x / y); elseif (Float64(x / y) <= -0.001) tmp = Float64(2.0 / Float64(t * z)); elseif (Float64(x / y) <= 1000000.0) 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) <= -2e+35) tmp = x / y; elseif ((x / y) <= -0.001) tmp = 2.0 / (t * z); elseif ((x / y) <= 1000000.0) 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], -2e+35], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -0.001], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1000000.0], 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 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -0.001:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;\frac{x}{y} \leq 1000000:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.9999999999999999e35Initial program 85.0%
Taylor expanded in x around inf 65.8%
if -1.9999999999999999e35 < (/.f64 x y) < -1e-3Initial program 88.9%
Taylor expanded in z around 0 80.5%
if -1e-3 < (/.f64 x y) < 1e6Initial program 87.9%
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 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
metadata-eval99.9%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
distribute-rgt1-in99.9%
Simplified99.9%
Taylor expanded in z around inf 68.0%
sub-neg68.0%
associate-*r/68.0%
metadata-eval68.0%
metadata-eval68.0%
Simplified68.0%
if 1e6 < (/.f64 x y) Initial program 80.5%
Taylor expanded in t around inf 72.1%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2e+35)
(+ (/ x y) (/ 2.0 t))
(if (<= (/ x y) 1000000.0)
(+ -2.0 (* (/ 2.0 t) (+ 1.0 (/ 1.0 z))))
(+ (/ x y) (/ 2.0 (* t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+35) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1000000.0) {
tmp = -2.0 + ((2.0 / t) * (1.0 + (1.0 / z)));
} else {
tmp = (x / y) + (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 ((x / y) <= (-2d+35)) then
tmp = (x / y) + (2.0d0 / t)
else if ((x / y) <= 1000000.0d0) then
tmp = (-2.0d0) + ((2.0d0 / t) * (1.0d0 + (1.0d0 / z)))
else
tmp = (x / y) + (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 ((x / y) <= -2e+35) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1000000.0) {
tmp = -2.0 + ((2.0 / t) * (1.0 + (1.0 / z)));
} else {
tmp = (x / y) + (2.0 / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+35: tmp = (x / y) + (2.0 / t) elif (x / y) <= 1000000.0: tmp = -2.0 + ((2.0 / t) * (1.0 + (1.0 / z))) else: tmp = (x / y) + (2.0 / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+35) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (Float64(x / y) <= 1000000.0) tmp = Float64(-2.0 + Float64(Float64(2.0 / t) * Float64(1.0 + Float64(1.0 / z)))); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e+35) tmp = (x / y) + (2.0 / t); elseif ((x / y) <= 1000000.0) tmp = -2.0 + ((2.0 / t) * (1.0 + (1.0 / z))); else tmp = (x / y) + (2.0 / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+35], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1000000.0], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] * N[(1.0 + N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1000000:\\
\;\;\;\;-2 + \frac{2}{t} \cdot \left(1 + \frac{1}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.9999999999999999e35Initial program 85.0%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around inf 84.0%
associate-*r/84.0%
metadata-eval84.0%
+-commutative84.0%
Simplified84.0%
if -1.9999999999999999e35 < (/.f64 x y) < 1e6Initial program 87.9%
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 99.2%
sub-neg99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/l/99.2%
+-commutative99.2%
metadata-eval99.2%
associate-+r+99.2%
+-commutative99.2%
+-commutative99.2%
associate-+l+99.2%
metadata-eval99.2%
associate-*r/99.2%
associate-*l/99.2%
*-commutative99.2%
distribute-rgt1-in99.2%
Simplified99.2%
if 1e6 < (/.f64 x y) Initial program 80.5%
Taylor expanded in z around 0 90.3%
Final simplification93.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -5e-5)
(/ x y)
(if (<= (/ x y) 5e-197)
-2.0
(if (<= (/ x y) 1000000.0) (/ 2.0 t) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-5) {
tmp = x / y;
} else if ((x / y) <= 5e-197) {
tmp = -2.0;
} else if ((x / y) <= 1000000.0) {
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) <= (-5d-5)) then
tmp = x / y
else if ((x / y) <= 5d-197) then
tmp = -2.0d0
else if ((x / y) <= 1000000.0d0) 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) <= -5e-5) {
tmp = x / y;
} else if ((x / y) <= 5e-197) {
tmp = -2.0;
} else if ((x / y) <= 1000000.0) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e-5: tmp = x / y elif (x / y) <= 5e-197: tmp = -2.0 elif (x / y) <= 1000000.0: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e-5) tmp = Float64(x / y); elseif (Float64(x / y) <= 5e-197) tmp = -2.0; elseif (Float64(x / y) <= 1000000.0) 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) <= -5e-5) tmp = x / y; elseif ((x / y) <= 5e-197) tmp = -2.0; elseif ((x / y) <= 1000000.0) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e-5], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-197], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 1000000.0], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-197}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 1000000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -5.00000000000000024e-5 or 1e6 < (/.f64 x y) Initial program 83.1%
Taylor expanded in x around inf 64.4%
if -5.00000000000000024e-5 < (/.f64 x y) < 5.0000000000000002e-197Initial program 85.0%
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 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
metadata-eval99.9%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
distribute-rgt1-in99.9%
Simplified99.9%
Taylor expanded in t around inf 48.0%
if 5.0000000000000002e-197 < (/.f64 x y) < 1e6Initial program 94.4%
Taylor expanded in t around 0 78.6%
associate-*r/78.6%
metadata-eval78.6%
Simplified78.6%
Taylor expanded in z around inf 41.5%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2e+35)
(+ (/ x y) (/ 2.0 t))
(if (<= (/ x y) 1000000.0)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(+ (/ x y) (/ 2.0 (* t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+35) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1000000.0) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + (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 ((x / y) <= (-2d+35)) then
tmp = (x / y) + (2.0d0 / t)
else if ((x / y) <= 1000000.0d0) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x / y) + (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 ((x / y) <= -2e+35) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1000000.0) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + (2.0 / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+35: tmp = (x / y) + (2.0 / t) elif (x / y) <= 1000000.0: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) + (2.0 / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+35) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (Float64(x / y) <= 1000000.0) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e+35) tmp = (x / y) + (2.0 / t); elseif ((x / y) <= 1000000.0) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) + (2.0 / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+35], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1000000.0], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1000000:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.9999999999999999e35Initial program 85.0%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around inf 84.0%
associate-*r/84.0%
metadata-eval84.0%
+-commutative84.0%
Simplified84.0%
if -1.9999999999999999e35 < (/.f64 x y) < 1e6Initial program 87.9%
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 99.2%
sub-neg99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/l/99.2%
+-commutative99.2%
metadata-eval99.2%
associate-+r+99.2%
+-commutative99.2%
+-commutative99.2%
associate-+l+99.2%
metadata-eval99.2%
associate-*r/99.2%
associate-*l/99.2%
*-commutative99.2%
distribute-rgt1-in99.2%
Simplified99.2%
Taylor expanded in z around inf 99.2%
associate--l+99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-*r/99.2%
*-commutative99.2%
metadata-eval99.2%
sub-neg99.2%
associate-/r*99.2%
*-rgt-identity99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-+l+99.2%
metadata-eval99.2%
associate-*r/99.2%
distribute-rgt-in99.2%
associate-*l/99.2%
*-lft-identity99.2%
Simplified99.2%
if 1e6 < (/.f64 x y) Initial program 80.5%
Taylor expanded in z around 0 90.3%
Final simplification93.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+35) (not (<= (/ x y) 1e-33))) (+ (/ x y) (/ 2.0 t)) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+35) || !((x / y) <= 1e-33)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-2d+35)) .or. (.not. ((x / y) <= 1d-33))) then
tmp = (x / y) + (2.0d0 / t)
else
tmp = (-2.0d0) + ((2.0d0 / z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+35) || !((x / y) <= 1e-33)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+35) or not ((x / y) <= 1e-33): tmp = (x / y) + (2.0 / t) else: tmp = -2.0 + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+35) || !(Float64(x / y) <= 1e-33)) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); else tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e+35) || ~(((x / y) <= 1e-33))) tmp = (x / y) + (2.0 / t); else tmp = -2.0 + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+35], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e-33]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+35} \lor \neg \left(\frac{x}{y} \leq 10^{-33}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.9999999999999999e35 or 1.0000000000000001e-33 < (/.f64 x y) Initial program 83.7%
Taylor expanded in t around 0 97.4%
Taylor expanded in z around inf 78.9%
associate-*r/78.9%
metadata-eval78.9%
+-commutative78.9%
Simplified78.9%
if -1.9999999999999999e35 < (/.f64 x y) < 1.0000000000000001e-33Initial program 87.1%
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 99.2%
sub-neg99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/l/99.2%
+-commutative99.2%
metadata-eval99.2%
associate-+r+99.2%
+-commutative99.2%
+-commutative99.2%
associate-+l+99.2%
metadata-eval99.2%
associate-*r/99.2%
associate-*l/99.2%
*-commutative99.2%
distribute-rgt1-in99.2%
Simplified99.2%
Taylor expanded in z around inf 99.2%
associate--l+99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-*r/99.2%
*-commutative99.2%
metadata-eval99.2%
sub-neg99.2%
associate-/r*99.2%
*-rgt-identity99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-+l+99.2%
metadata-eval99.2%
associate-*r/99.2%
distribute-rgt-in99.2%
associate-*l/99.2%
*-lft-identity99.2%
Simplified99.2%
Taylor expanded in z around 0 74.9%
Final simplification76.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.25e-7) (not (<= z 2.65e-86))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (/ 2.0 (* t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e-7) || !(z <= 2.65e-86)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (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 <= (-1.25d-7)) .or. (.not. (z <= 2.65d-86))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + (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 <= -1.25e-7) || !(z <= 2.65e-86)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (2.0 / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.25e-7) or not (z <= 2.65e-86): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + (2.0 / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.25e-7) || !(z <= 2.65e-86)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.25e-7) || ~((z <= 2.65e-86))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + (2.0 / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.25e-7], N[Not[LessEqual[z, 2.65e-86]], $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[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-7} \lor \neg \left(z \leq 2.65 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\end{array}
\end{array}
if z < -1.24999999999999994e-7 or 2.6499999999999998e-86 < z Initial program 78.2%
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 94.5%
sub-neg94.5%
associate-*r/94.5%
metadata-eval94.5%
+-commutative94.5%
metadata-eval94.5%
associate-+l+94.5%
+-commutative94.5%
Simplified94.5%
if -1.24999999999999994e-7 < z < 2.6499999999999998e-86Initial program 96.8%
Taylor expanded in z around 0 85.6%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.5e-49) (not (<= z 5.5e-68))) (+ (/ 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 <= -3.5e-49) || !(z <= 5.5e-68)) {
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 <= (-3.5d-49)) .or. (.not. (z <= 5.5d-68))) 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 <= -3.5e-49) || !(z <= 5.5e-68)) {
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 <= -3.5e-49) or not (z <= 5.5e-68): 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 <= -3.5e-49) || !(z <= 5.5e-68)) 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 <= -3.5e-49) || ~((z <= 5.5e-68))) 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, -3.5e-49], N[Not[LessEqual[z, 5.5e-68]], $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 -3.5 \cdot 10^{-49} \lor \neg \left(z \leq 5.5 \cdot 10^{-68}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -3.50000000000000006e-49 or 5.5000000000000003e-68 < z Initial program 78.5%
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 93.5%
sub-neg93.5%
associate-*r/93.5%
metadata-eval93.5%
+-commutative93.5%
metadata-eval93.5%
associate-+l+93.5%
+-commutative93.5%
Simplified93.5%
if -3.50000000000000006e-49 < z < 5.5000000000000003e-68Initial program 96.7%
Taylor expanded in t around inf 96.7%
sub-neg96.7%
metadata-eval96.7%
associate-*r/96.7%
+-commutative96.7%
metadata-eval96.7%
associate-+l+96.7%
associate-*r/96.7%
metadata-eval96.7%
associate-*r/96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in x around 0 79.3%
sub-neg79.3%
associate-*r/79.3%
metadata-eval79.3%
associate-*r/79.3%
metadata-eval79.3%
associate-/l/79.3%
+-commutative79.3%
metadata-eval79.3%
associate-+r+79.3%
+-commutative79.3%
+-commutative79.3%
associate-+l+79.3%
metadata-eval79.3%
associate-*r/79.3%
associate-*l/79.3%
*-commutative79.3%
distribute-rgt1-in79.3%
Simplified79.3%
Taylor expanded in z around inf 79.3%
associate--l+79.3%
associate-*r/79.3%
metadata-eval79.3%
associate-*r/79.3%
*-commutative79.3%
metadata-eval79.3%
sub-neg79.3%
associate-/r*79.3%
*-rgt-identity79.3%
associate-*r/79.3%
metadata-eval79.3%
associate-+l+79.3%
metadata-eval79.3%
associate-*r/79.3%
distribute-rgt-in79.3%
associate-*l/79.3%
*-lft-identity79.3%
Simplified79.3%
Taylor expanded in z around 0 79.3%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -50000000.0) (not (<= (/ x y) 1000000.0))) (- (/ x y) 2.0) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -50000000.0) || !((x / y) <= 1000000.0)) {
tmp = (x / y) - 2.0;
} 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) <= (-50000000.0d0)) .or. (.not. ((x / y) <= 1000000.0d0))) then
tmp = (x / y) - 2.0d0
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) <= -50000000.0) || !((x / y) <= 1000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -50000000.0) or not ((x / y) <= 1000000.0): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -50000000.0) || !(Float64(x / y) <= 1000000.0)) tmp = Float64(Float64(x / y) - 2.0); 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) <= -50000000.0) || ~(((x / y) <= 1000000.0))) tmp = (x / y) - 2.0; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -50000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -50000000 \lor \neg \left(\frac{x}{y} \leq 1000000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -5e7 or 1e6 < (/.f64 x y) Initial program 82.6%
Taylor expanded in t around inf 66.9%
if -5e7 < (/.f64 x y) < 1e6Initial program 88.2%
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 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
metadata-eval99.9%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
distribute-rgt1-in99.9%
Simplified99.9%
Taylor expanded in z around inf 66.5%
sub-neg66.5%
associate-*r/66.5%
metadata-eval66.5%
metadata-eval66.5%
Simplified66.5%
Final simplification66.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -50000000.0) (not (<= (/ x y) 1000000.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -50000000.0) || !((x / y) <= 1000000.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) <= (-50000000.0d0)) .or. (.not. ((x / y) <= 1000000.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) <= -50000000.0) || !((x / y) <= 1000000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -50000000.0) or not ((x / y) <= 1000000.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) <= -50000000.0) || !(Float64(x / y) <= 1000000.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) <= -50000000.0) || ~(((x / y) <= 1000000.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], -50000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1000000.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 -50000000 \lor \neg \left(\frac{x}{y} \leq 1000000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -5e7 or 1e6 < (/.f64 x y) Initial program 82.6%
Taylor expanded in x around inf 66.4%
if -5e7 < (/.f64 x y) < 1e6Initial program 88.2%
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 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
metadata-eval99.9%
associate-*r/99.9%
associate-*l/99.9%
*-commutative99.9%
distribute-rgt1-in99.9%
Simplified99.9%
Taylor expanded in z around inf 66.5%
sub-neg66.5%
associate-*r/66.5%
metadata-eval66.5%
metadata-eval66.5%
Simplified66.5%
Final simplification66.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.15e-43) (not (<= t 7.5e+32))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.15e-43) || !(t <= 7.5e+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 ((t <= (-1.15d-43)) .or. (.not. (t <= 7.5d+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 ((t <= -1.15e-43) || !(t <= 7.5e+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 (t <= -1.15e-43) or not (t <= 7.5e+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 ((t <= -1.15e-43) || !(t <= 7.5e+32)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.15e-43) || ~((t <= 7.5e+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[Or[LessEqual[t, -1.15e-43], N[Not[LessEqual[t, 7.5e+32]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{-43} \lor \neg \left(t \leq 7.5 \cdot 10^{+32}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.1499999999999999e-43 or 7.49999999999999959e32 < t Initial program 73.4%
Taylor expanded in t around inf 84.1%
if -1.1499999999999999e-43 < t < 7.49999999999999959e32Initial program 97.4%
Taylor expanded in t around 0 79.7%
associate-*r/79.7%
metadata-eval79.7%
Simplified79.7%
Final simplification81.9%
(FPCore (x y z t) :precision binary64 (if (<= t -1.7) -2.0 (if (<= t 9.5e-10) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.7) {
tmp = -2.0;
} else if (t <= 9.5e-10) {
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 <= (-1.7d0)) then
tmp = -2.0d0
else if (t <= 9.5d-10) 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 <= -1.7) {
tmp = -2.0;
} else if (t <= 9.5e-10) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.7: tmp = -2.0 elif t <= 9.5e-10: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.7) tmp = -2.0; elseif (t <= 9.5e-10) 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 <= -1.7) tmp = -2.0; elseif (t <= 9.5e-10) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.7], -2.0, If[LessEqual[t, 9.5e-10], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-10}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.69999999999999996 or 9.50000000000000028e-10 < t Initial program 73.1%
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 56.4%
sub-neg56.4%
associate-*r/56.4%
metadata-eval56.4%
associate-*r/56.4%
metadata-eval56.4%
associate-/l/56.5%
+-commutative56.5%
metadata-eval56.5%
associate-+r+56.5%
+-commutative56.5%
+-commutative56.5%
associate-+l+56.5%
metadata-eval56.5%
associate-*r/56.5%
associate-*l/56.5%
*-commutative56.5%
distribute-rgt1-in56.5%
Simplified56.5%
Taylor expanded in t around inf 40.1%
if -1.69999999999999996 < t < 9.50000000000000028e-10Initial program 97.4%
Taylor expanded in t around 0 78.3%
associate-*r/78.3%
metadata-eval78.3%
Simplified78.3%
Taylor expanded in z around inf 37.7%
(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.4%
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 67.6%
sub-neg67.6%
associate-*r/67.6%
metadata-eval67.6%
associate-*r/67.6%
metadata-eval67.6%
associate-/l/67.6%
+-commutative67.6%
metadata-eval67.6%
associate-+r+67.6%
+-commutative67.6%
+-commutative67.6%
associate-+l+67.6%
metadata-eval67.6%
associate-*r/67.6%
associate-*l/67.6%
*-commutative67.6%
distribute-rgt1-in67.6%
Simplified67.6%
Taylor expanded in t around inf 21.0%
(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 2024167
(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))))