
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (+ (/ x y) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + (((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0);
}
def code(x, y, z, t): return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0)
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0)) end
function tmp = code(x, y, z, t) tmp = (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2 + \frac{2}{z}}{t} + -2\right)
\end{array}
Initial program 86.2%
Simplified0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= (/ x y) -4e+115)
t_1
(if (<= (/ x y) -2e+88)
(/ 2.0 (* t z))
(if (<= (/ x y) -50.0)
t_1
(if (<= (/ x y) 4e-19) (+ (/ (/ 2.0 z) 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) <= -4e+115) {
tmp = t_1;
} else if ((x / y) <= -2e+88) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= -50.0) {
tmp = t_1;
} else if ((x / y) <= 4e-19) {
tmp = ((2.0 / z) / 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) <= (-4d+115)) then
tmp = t_1
else if ((x / y) <= (-2d+88)) then
tmp = 2.0d0 / (t * z)
else if ((x / y) <= (-50.0d0)) then
tmp = t_1
else if ((x / y) <= 4d-19) then
tmp = ((2.0d0 / z) / 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) <= -4e+115) {
tmp = t_1;
} else if ((x / y) <= -2e+88) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= -50.0) {
tmp = t_1;
} else if ((x / y) <= 4e-19) {
tmp = ((2.0 / z) / 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) <= -4e+115: tmp = t_1 elif (x / y) <= -2e+88: tmp = 2.0 / (t * z) elif (x / y) <= -50.0: tmp = t_1 elif (x / y) <= 4e-19: tmp = ((2.0 / z) / 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) <= -4e+115) tmp = t_1; elseif (Float64(x / y) <= -2e+88) tmp = Float64(2.0 / Float64(t * z)); elseif (Float64(x / y) <= -50.0) tmp = t_1; elseif (Float64(x / y) <= 4e-19) tmp = Float64(Float64(Float64(2.0 / z) / 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) <= -4e+115) tmp = t_1; elseif ((x / y) <= -2e+88) tmp = 2.0 / (t * z); elseif ((x / y) <= -50.0) tmp = t_1; elseif ((x / y) <= 4e-19) tmp = ((2.0 / z) / 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], -4e+115], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -2e+88], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -50.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 4e-19], N[(N[(N[(2.0 / z), $MachinePrecision] / 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 -4 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{+88}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;\frac{x}{y} \leq -50:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{2}{z}}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -4.0000000000000001e115 or -1.99999999999999992e88 < (/.f64 x y) < -50 or 3.9999999999999999e-19 < (/.f64 x y) Initial program 85.3%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
if -4.0000000000000001e115 < (/.f64 x y) < -1.99999999999999992e88Initial program 100.0%
Simplified0
Taylor expanded in z around 0 0
Simplified0
if -50 < (/.f64 x y) < 3.9999999999999999e-19Initial program 86.7%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)) (t_2 (+ (/ x y) (/ 2.0 t))))
(if (<= z -6.5e+153)
t_2
(if (<= z -8e-114)
t_1
(if (<= z 9.6e-67)
(/ 2.0 (* t z))
(if (<= z 3.5e+106) t_1 (if (<= z 5e+233) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double t_2 = (x / y) + (2.0 / t);
double tmp;
if (z <= -6.5e+153) {
tmp = t_2;
} else if (z <= -8e-114) {
tmp = t_1;
} else if (z <= 9.6e-67) {
tmp = 2.0 / (t * z);
} else if (z <= 3.5e+106) {
tmp = t_1;
} else if (z <= 5e+233) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
t_2 = (x / y) + (2.0d0 / t)
if (z <= (-6.5d+153)) then
tmp = t_2
else if (z <= (-8d-114)) then
tmp = t_1
else if (z <= 9.6d-67) then
tmp = 2.0d0 / (t * z)
else if (z <= 3.5d+106) then
tmp = t_1
else if (z <= 5d+233) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double t_2 = (x / y) + (2.0 / t);
double tmp;
if (z <= -6.5e+153) {
tmp = t_2;
} else if (z <= -8e-114) {
tmp = t_1;
} else if (z <= 9.6e-67) {
tmp = 2.0 / (t * z);
} else if (z <= 3.5e+106) {
tmp = t_1;
} else if (z <= 5e+233) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 t_2 = (x / y) + (2.0 / t) tmp = 0 if z <= -6.5e+153: tmp = t_2 elif z <= -8e-114: tmp = t_1 elif z <= 9.6e-67: tmp = 2.0 / (t * z) elif z <= 3.5e+106: tmp = t_1 elif z <= 5e+233: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) t_2 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (z <= -6.5e+153) tmp = t_2; elseif (z <= -8e-114) tmp = t_1; elseif (z <= 9.6e-67) tmp = Float64(2.0 / Float64(t * z)); elseif (z <= 3.5e+106) tmp = t_1; elseif (z <= 5e+233) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; t_2 = (x / y) + (2.0 / t); tmp = 0.0; if (z <= -6.5e+153) tmp = t_2; elseif (z <= -8e-114) tmp = t_1; elseif (z <= 9.6e-67) tmp = 2.0 / (t * z); elseif (z <= 3.5e+106) tmp = t_1; elseif (z <= 5e+233) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+153], t$95$2, If[LessEqual[z, -8e-114], t$95$1, If[LessEqual[z, 9.6e-67], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+106], t$95$1, If[LessEqual[z, 5e+233], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
t_2 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+153}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-67}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+233}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.49999999999999972e153 or 3.49999999999999981e106 < z < 5.00000000000000009e233Initial program 70.7%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
if -6.49999999999999972e153 < z < -8.0000000000000004e-114 or 9.6e-67 < z < 3.49999999999999981e106 or 5.00000000000000009e233 < z Initial program 81.8%
Simplified0
Taylor expanded in t around inf 0
Simplified0
if -8.0000000000000004e-114 < z < 9.6e-67Initial program 99.8%
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= t -1.25e-11)
t_1
(if (<= t 9.2e-94)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (<= t 2.35e+20)
(+ (/ x y) (/ 2.0 t))
(if (<= t 1.12e+66) (+ (/ (/ 2.0 z) t) -2.0) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -1.25e-11) {
tmp = t_1;
} else if (t <= 9.2e-94) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 2.35e+20) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 1.12e+66) {
tmp = ((2.0 / z) / 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)
if (t <= (-1.25d-11)) then
tmp = t_1
else if (t <= 9.2d-94) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if (t <= 2.35d+20) then
tmp = (x / y) + (2.0d0 / t)
else if (t <= 1.12d+66) then
tmp = ((2.0d0 / z) / 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;
double tmp;
if (t <= -1.25e-11) {
tmp = t_1;
} else if (t <= 9.2e-94) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 2.35e+20) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 1.12e+66) {
tmp = ((2.0 / z) / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if t <= -1.25e-11: tmp = t_1 elif t <= 9.2e-94: tmp = (2.0 + (2.0 / z)) / t elif t <= 2.35e+20: tmp = (x / y) + (2.0 / t) elif t <= 1.12e+66: tmp = ((2.0 / z) / t) + -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -1.25e-11) tmp = t_1; elseif (t <= 9.2e-94) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (t <= 2.35e+20) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (t <= 1.12e+66) tmp = Float64(Float64(Float64(2.0 / z) / 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; tmp = 0.0; if (t <= -1.25e-11) tmp = t_1; elseif (t <= 9.2e-94) tmp = (2.0 + (2.0 / z)) / t; elseif (t <= 2.35e+20) tmp = (x / y) + (2.0 / t); elseif (t <= 1.12e+66) tmp = ((2.0 / z) / 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] + -2.0), $MachinePrecision]}, If[LessEqual[t, -1.25e-11], t$95$1, If[LessEqual[t, 9.2e-94], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 2.35e+20], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e+66], N[(N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-94}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+66}:\\
\;\;\;\;\frac{\frac{2}{z}}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.25000000000000005e-11 or 1.12e66 < t Initial program 71.9%
Simplified0
Taylor expanded in t around inf 0
Simplified0
if -1.25000000000000005e-11 < t < 9.1999999999999997e-94Initial program 99.8%
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 9.1999999999999997e-94 < t < 2.35e20Initial program 99.9%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 2.35e20 < t < 1.12e66Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2.0) (/ x y) (if (<= (/ x y) 3e-15) -2.0 (if (<= (/ x y) 1.52e+26) (/ 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) <= 3e-15) {
tmp = -2.0;
} else if ((x / y) <= 1.52e+26) {
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) <= 3d-15) then
tmp = -2.0d0
else if ((x / y) <= 1.52d+26) 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) <= 3e-15) {
tmp = -2.0;
} else if ((x / y) <= 1.52e+26) {
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) <= 3e-15: tmp = -2.0 elif (x / y) <= 1.52e+26: 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) <= 3e-15) tmp = -2.0; elseif (Float64(x / y) <= 1.52e+26) 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) <= 3e-15) tmp = -2.0; elseif ((x / y) <= 1.52e+26) 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], 3e-15], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 1.52e+26], 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 3 \cdot 10^{-15}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.52 \cdot 10^{+26}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2 or 1.52e26 < (/.f64 x y) Initial program 85.3%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -2 < (/.f64 x y) < 3e-15Initial program 86.7%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in t around inf 0
Simplified0
if 3e-15 < (/.f64 x y) < 1.52e26Initial program 91.5%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (+ (/ 2.0 t) -2.0))))
(if (<= z -1.7e-62)
t_1
(if (<= z 2.5e-47) (+ (/ x y) (/ 2.0 (* t z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 / t) + -2.0);
double tmp;
if (z <= -1.7e-62) {
tmp = t_1;
} else if (z <= 2.5e-47) {
tmp = (x / y) + (2.0 / (t * z));
} 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) + (-2.0d0))
if (z <= (-1.7d-62)) then
tmp = t_1
else if (z <= 2.5d-47) then
tmp = (x / y) + (2.0d0 / (t * z))
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) + -2.0);
double tmp;
if (z <= -1.7e-62) {
tmp = t_1;
} else if (z <= 2.5e-47) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + ((2.0 / t) + -2.0) tmp = 0 if z <= -1.7e-62: tmp = t_1 elif z <= 2.5e-47: tmp = (x / y) + (2.0 / (t * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)) tmp = 0.0 if (z <= -1.7e-62) tmp = t_1; elseif (z <= 2.5e-47) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + ((2.0 / t) + -2.0); tmp = 0.0; if (z <= -1.7e-62) tmp = t_1; elseif (z <= 2.5e-47) tmp = (x / y) + (2.0 / (t * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e-62], t$95$1, If[LessEqual[z, 2.5e-47], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-47}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.69999999999999994e-62 or 2.50000000000000006e-47 < z Initial program 75.9%
Simplified0
Taylor expanded in z around inf 0
Simplified0
if -1.69999999999999994e-62 < z < 2.50000000000000006e-47Initial program 99.9%
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) (+ (/ 2.0 t) -2.0)))) (if (<= z -2.15e-59) t_1 (if (<= z 2.4e-62) (+ (/ (/ 2.0 z) t) -2.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 / t) + -2.0);
double tmp;
if (z <= -2.15e-59) {
tmp = t_1;
} else if (z <= 2.4e-62) {
tmp = ((2.0 / z) / 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) + (-2.0d0))
if (z <= (-2.15d-59)) then
tmp = t_1
else if (z <= 2.4d-62) then
tmp = ((2.0d0 / z) / 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) + -2.0);
double tmp;
if (z <= -2.15e-59) {
tmp = t_1;
} else if (z <= 2.4e-62) {
tmp = ((2.0 / z) / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + ((2.0 / t) + -2.0) tmp = 0 if z <= -2.15e-59: tmp = t_1 elif z <= 2.4e-62: tmp = ((2.0 / z) / t) + -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)) tmp = 0.0 if (z <= -2.15e-59) tmp = t_1; elseif (z <= 2.4e-62) tmp = Float64(Float64(Float64(2.0 / z) / 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) + -2.0); tmp = 0.0; if (z <= -2.15e-59) tmp = t_1; elseif (z <= 2.4e-62) tmp = ((2.0 / z) / 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[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.15e-59], t$95$1, If[LessEqual[z, 2.4e-62], N[(N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{2}{z}}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.1500000000000001e-59 or 2.39999999999999984e-62 < z Initial program 75.9%
Simplified0
Taylor expanded in z around inf 0
Simplified0
if -2.1500000000000001e-59 < z < 2.39999999999999984e-62Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) -2.0))) (if (<= z -4.9e-112) t_1 (if (<= z 1.6e-65) (/ 2.0 (* t z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (z <= -4.9e-112) {
tmp = t_1;
} else if (z <= 1.6e-65) {
tmp = 2.0 / (t * z);
} 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)
if (z <= (-4.9d-112)) then
tmp = t_1
else if (z <= 1.6d-65) then
tmp = 2.0d0 / (t * z)
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;
double tmp;
if (z <= -4.9e-112) {
tmp = t_1;
} else if (z <= 1.6e-65) {
tmp = 2.0 / (t * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if z <= -4.9e-112: tmp = t_1 elif z <= 1.6e-65: tmp = 2.0 / (t * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (z <= -4.9e-112) tmp = t_1; elseif (z <= 1.6e-65) tmp = Float64(2.0 / Float64(t * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if (z <= -4.9e-112) tmp = t_1; elseif (z <= 1.6e-65) tmp = 2.0 / (t * z); else tmp = t_1; 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, -4.9e-112], t$95$1, If[LessEqual[z, 1.6e-65], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-65}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.8999999999999998e-112 or 1.6e-65 < z Initial program 78.0%
Simplified0
Taylor expanded in t around inf 0
Simplified0
if -4.8999999999999998e-112 < z < 1.6e-65Initial program 99.8%
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) -2.0))) (if (<= t -1.8e-116) t_1 (if (<= t 4.3e-231) (/ 2.0 t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -1.8e-116) {
tmp = t_1;
} else if (t <= 4.3e-231) {
tmp = 2.0 / t;
} 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)
if (t <= (-1.8d-116)) then
tmp = t_1
else if (t <= 4.3d-231) then
tmp = 2.0d0 / t
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;
double tmp;
if (t <= -1.8e-116) {
tmp = t_1;
} else if (t <= 4.3e-231) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if t <= -1.8e-116: tmp = t_1 elif t <= 4.3e-231: tmp = 2.0 / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -1.8e-116) tmp = t_1; elseif (t <= 4.3e-231) tmp = Float64(2.0 / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if (t <= -1.8e-116) tmp = t_1; elseif (t <= 4.3e-231) tmp = 2.0 / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -1.8e-116], t$95$1, If[LessEqual[t, 4.3e-231], N[(2.0 / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{-116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{-231}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.79999999999999988e-116 or 4.29999999999999998e-231 < t Initial program 83.1%
Simplified0
Taylor expanded in t around inf 0
Simplified0
if -1.79999999999999988e-116 < t < 4.29999999999999998e-231Initial program 99.7%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 5.8e+28) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 5.8e+28) {
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.0d0)) then
tmp = -2.0d0
else if (t <= 5.8d+28) 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.0) {
tmp = -2.0;
} else if (t <= 5.8e+28) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 5.8e+28: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 5.8e+28) 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.0) tmp = -2.0; elseif (t <= 5.8e+28) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 5.8e+28], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 5.8000000000000002e28 < t Initial program 73.4%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in t around inf 0
Simplified0
if -1 < t < 5.8000000000000002e28Initial program 99.8%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
(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 86.2%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in t around inf 0
Simplified0
(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 2024110
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))