
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (- (+ (/ 2.0 t) (+ (/ x y) (/ (/ 2.0 t) z))) 2.0))
double code(double x, double y, double z, double t) {
return ((2.0 / t) + ((x / y) + ((2.0 / t) / z))) - 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 / t) + ((x / y) + ((2.0d0 / t) / z))) - 2.0d0
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 / t) + ((x / y) + ((2.0 / t) / z))) - 2.0;
}
def code(x, y, z, t): return ((2.0 / t) + ((x / y) + ((2.0 / t) / z))) - 2.0
function code(x, y, z, t) return Float64(Float64(Float64(2.0 / t) + Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z))) - 2.0) end
function tmp = code(x, y, z, t) tmp = ((2.0 / t) + ((x / y) + ((2.0 / t) / z))) - 2.0; end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 / t), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{2}{t} + \left(\frac{x}{y} + \frac{\frac{2}{t}}{z}\right)\right) - 2
\end{array}
Initial program 85.4%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around 0 99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -1.55e-75)
t_1
(if (<= z 4.5e-88)
(* 2.0 (/ 1.0 (* t z)))
(if (or (<= z 4.3e+68) (not (<= z 3.3e+162)))
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 <= -1.55e-75) {
tmp = t_1;
} else if (z <= 4.5e-88) {
tmp = 2.0 * (1.0 / (t * z));
} else if ((z <= 4.3e+68) || !(z <= 3.3e+162)) {
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 <= (-1.55d-75)) then
tmp = t_1
else if (z <= 4.5d-88) then
tmp = 2.0d0 * (1.0d0 / (t * z))
else if ((z <= 4.3d+68) .or. (.not. (z <= 3.3d+162))) 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 <= -1.55e-75) {
tmp = t_1;
} else if (z <= 4.5e-88) {
tmp = 2.0 * (1.0 / (t * z));
} else if ((z <= 4.3e+68) || !(z <= 3.3e+162)) {
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 <= -1.55e-75: tmp = t_1 elif z <= 4.5e-88: tmp = 2.0 * (1.0 / (t * z)) elif (z <= 4.3e+68) or not (z <= 3.3e+162): 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 <= -1.55e-75) tmp = t_1; elseif (z <= 4.5e-88) tmp = Float64(2.0 * Float64(1.0 / Float64(t * z))); elseif ((z <= 4.3e+68) || !(z <= 3.3e+162)) 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 <= -1.55e-75) tmp = t_1; elseif (z <= 4.5e-88) tmp = 2.0 * (1.0 / (t * z)); elseif ((z <= 4.3e+68) || ~((z <= 3.3e+162))) 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, -1.55e-75], t$95$1, If[LessEqual[z, 4.5e-88], N[(2.0 * N[(1.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4.3e+68], N[Not[LessEqual[z, 3.3e+162]], $MachinePrecision]], 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 -1.55 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-88}:\\
\;\;\;\;2 \cdot \frac{1}{t \cdot z}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+68} \lor \neg \left(z \leq 3.3 \cdot 10^{+162}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if z < -1.55000000000000003e-75 or 4.49999999999999991e-88 < z < 4.3000000000000001e68 or 3.29999999999999987e162 < z Initial program 75.9%
Taylor expanded in t around inf 71.1%
if -1.55000000000000003e-75 < z < 4.49999999999999991e-88Initial program 99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
unsub-neg99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt1-in99.8%
associate-/l*99.7%
fma-neg99.7%
*-commutative99.7%
fma-define99.7%
*-commutative99.7%
distribute-frac-neg99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in t around 0 73.7%
Taylor expanded in z around 0 73.7%
*-commutative73.7%
Simplified73.7%
if 4.3000000000000001e68 < z < 3.29999999999999987e162Initial program 84.0%
Taylor expanded in t around 0 100.0%
Taylor expanded in z around inf 100.0%
associate-*r/100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 83.0%
sub-neg83.0%
associate-*r/83.0%
metadata-eval83.0%
metadata-eval83.0%
Simplified83.0%
Final simplification73.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -4e+58) (not (<= (/ x y) 100000000000.0))) (+ (/ x y) (/ 2.0 (* t z))) (- (+ (/ 2.0 t) (/ (/ 2.0 t) z)) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4e+58) || !((x / y) <= 100000000000.0)) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = ((2.0 / t) + ((2.0 / t) / z)) - 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) <= (-4d+58)) .or. (.not. ((x / y) <= 100000000000.0d0))) then
tmp = (x / y) + (2.0d0 / (t * z))
else
tmp = ((2.0d0 / t) + ((2.0d0 / t) / z)) - 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) <= -4e+58) || !((x / y) <= 100000000000.0)) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = ((2.0 / t) + ((2.0 / t) / z)) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -4e+58) or not ((x / y) <= 100000000000.0): tmp = (x / y) + (2.0 / (t * z)) else: tmp = ((2.0 / t) + ((2.0 / t) / z)) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -4e+58) || !(Float64(x / y) <= 100000000000.0)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); else tmp = Float64(Float64(Float64(2.0 / t) + Float64(Float64(2.0 / t) / z)) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -4e+58) || ~(((x / y) <= 100000000000.0))) tmp = (x / y) + (2.0 / (t * z)); else tmp = ((2.0 / t) + ((2.0 / t) / z)) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -4e+58], N[Not[LessEqual[N[(x / y), $MachinePrecision], 100000000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / t), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+58} \lor \neg \left(\frac{x}{y} \leq 100000000000\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{t} + \frac{\frac{2}{t}}{z}\right) - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.99999999999999978e58 or 1e11 < (/.f64 x y) Initial program 86.4%
Taylor expanded in z around 0 95.0%
if -3.99999999999999978e58 < (/.f64 x y) < 1e11Initial program 84.6%
Taylor expanded in t around 0 99.9%
Taylor expanded in x around 0 96.7%
associate-*r/96.7%
metadata-eval96.7%
associate-*r/96.7%
metadata-eval96.7%
associate-/r*96.7%
Simplified96.7%
Final simplification96.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.06e+58) (/ x y) (if (<= (/ x y) -3.1e-174) (/ 2.0 t) (if (<= (/ x y) 0.054) -2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.06e+58) {
tmp = x / y;
} else if ((x / y) <= -3.1e-174) {
tmp = 2.0 / t;
} else if ((x / y) <= 0.054) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-1.06d+58)) then
tmp = x / y
else if ((x / y) <= (-3.1d-174)) then
tmp = 2.0d0 / t
else if ((x / y) <= 0.054d0) then
tmp = -2.0d0
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.06e+58) {
tmp = x / y;
} else if ((x / y) <= -3.1e-174) {
tmp = 2.0 / t;
} else if ((x / y) <= 0.054) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.06e+58: tmp = x / y elif (x / y) <= -3.1e-174: tmp = 2.0 / t elif (x / y) <= 0.054: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.06e+58) tmp = Float64(x / y); elseif (Float64(x / y) <= -3.1e-174) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 0.054) tmp = -2.0; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1.06e+58) tmp = x / y; elseif ((x / y) <= -3.1e-174) tmp = 2.0 / t; elseif ((x / y) <= 0.054) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.06e+58], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -3.1e-174], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.054], -2.0, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.06 \cdot 10^{+58}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -3.1 \cdot 10^{-174}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 0.054:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.05999999999999997e58 or 0.0539999999999999994 < (/.f64 x y) Initial program 86.3%
Taylor expanded in x around inf 74.3%
if -1.05999999999999997e58 < (/.f64 x y) < -3.0999999999999999e-174Initial program 94.2%
Taylor expanded in t around 0 100.0%
Taylor expanded in z around inf 59.5%
associate-*r/59.5%
metadata-eval59.5%
+-commutative59.5%
Simplified59.5%
Taylor expanded in t around 0 36.8%
if -3.0999999999999999e-174 < (/.f64 x y) < 0.0539999999999999994Initial program 81.3%
Taylor expanded in t around inf 44.4%
Taylor expanded in x around 0 43.0%
Final simplification56.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -6.5e+57) (not (<= (/ x y) 67000000000.0))) (+ (/ x y) (/ 2.0 (* t z))) (- (/ (+ 2.0 (/ 2.0 z)) t) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -6.5e+57) || !((x / y) <= 67000000000.0)) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = ((2.0 + (2.0 / z)) / t) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-6.5d+57)) .or. (.not. ((x / y) <= 67000000000.0d0))) then
tmp = (x / y) + (2.0d0 / (t * z))
else
tmp = ((2.0d0 + (2.0d0 / z)) / t) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -6.5e+57) || !((x / y) <= 67000000000.0)) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = ((2.0 + (2.0 / z)) / t) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -6.5e+57) or not ((x / y) <= 67000000000.0): tmp = (x / y) + (2.0 / (t * z)) else: tmp = ((2.0 + (2.0 / z)) / t) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -6.5e+57) || !(Float64(x / y) <= 67000000000.0)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -6.5e+57) || ~(((x / y) <= 67000000000.0))) tmp = (x / y) + (2.0 / (t * z)); else tmp = ((2.0 + (2.0 / z)) / t) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -6.5e+57], N[Not[LessEqual[N[(x / y), $MachinePrecision], 67000000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -6.5 \cdot 10^{+57} \lor \neg \left(\frac{x}{y} \leq 67000000000\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -6.4999999999999997e57 or 6.7e10 < (/.f64 x y) Initial program 86.4%
Taylor expanded in z around 0 95.0%
if -6.4999999999999997e57 < (/.f64 x y) < 6.7e10Initial program 84.6%
Taylor expanded in t around 0 99.9%
Taylor expanded in t around 0 96.7%
associate-*r/96.7%
metadata-eval96.7%
Simplified96.7%
Final simplification96.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -4.2e+141) (/ x y) (if (<= (/ x y) 15.0) (- (/ (/ 2.0 t) z) 2.0) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4.2e+141) {
tmp = x / y;
} else if ((x / y) <= 15.0) {
tmp = ((2.0 / t) / z) - 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) <= (-4.2d+141)) then
tmp = x / y
else if ((x / y) <= 15.0d0) then
tmp = ((2.0d0 / t) / z) - 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) <= -4.2e+141) {
tmp = x / y;
} else if ((x / y) <= 15.0) {
tmp = ((2.0 / t) / z) - 2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -4.2e+141: tmp = x / y elif (x / y) <= 15.0: tmp = ((2.0 / t) / z) - 2.0 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -4.2e+141) tmp = Float64(x / y); elseif (Float64(x / y) <= 15.0) tmp = Float64(Float64(Float64(2.0 / t) / z) - 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) <= -4.2e+141) tmp = x / y; elseif ((x / y) <= 15.0) tmp = ((2.0 / t) / z) - 2.0; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -4.2e+141], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 15.0], N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4.2 \cdot 10^{+141}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 15:\\
\;\;\;\;\frac{\frac{2}{t}}{z} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -4.1999999999999997e141Initial program 93.9%
Taylor expanded in x around inf 90.4%
if -4.1999999999999997e141 < (/.f64 x y) < 15Initial program 84.6%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around 0 72.8%
associate-/r*72.8%
Simplified72.8%
if 15 < (/.f64 x y) Initial program 82.9%
Taylor expanded in t around inf 80.8%
Final simplification77.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -6.5e+57) (not (<= (/ x y) 1950000000000.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -6.5e+57) || !((x / y) <= 1950000000000.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) <= (-6.5d+57)) .or. (.not. ((x / y) <= 1950000000000.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) <= -6.5e+57) || !((x / y) <= 1950000000000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -6.5e+57) or not ((x / y) <= 1950000000000.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) <= -6.5e+57) || !(Float64(x / y) <= 1950000000000.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) <= -6.5e+57) || ~(((x / y) <= 1950000000000.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], -6.5e+57], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1950000000000.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 -6.5 \cdot 10^{+57} \lor \neg \left(\frac{x}{y} \leq 1950000000000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -6.4999999999999997e57 or 1.95e12 < (/.f64 x y) Initial program 86.4%
Taylor expanded in x around inf 78.6%
if -6.4999999999999997e57 < (/.f64 x y) < 1.95e12Initial program 84.6%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around inf 62.4%
associate-*r/62.4%
metadata-eval62.4%
+-commutative62.4%
Simplified62.4%
Taylor expanded in x around 0 59.3%
sub-neg59.3%
associate-*r/59.3%
metadata-eval59.3%
metadata-eval59.3%
Simplified59.3%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6e-61) (not (<= z 3.15e-86))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (- (/ (/ 2.0 t) z) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e-61) || !(z <= 3.15e-86)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = ((2.0 / t) / z) - 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 ((z <= (-6d-61)) .or. (.not. (z <= 3.15d-86))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = ((2.0d0 / t) / z) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e-61) || !(z <= 3.15e-86)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = ((2.0 / t) / z) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6e-61) or not (z <= 3.15e-86): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = ((2.0 / t) / z) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6e-61) || !(z <= 3.15e-86)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(Float64(2.0 / t) / z) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6e-61) || ~((z <= 3.15e-86))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = ((2.0 / t) / z) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6e-61], N[Not[LessEqual[z, 3.15e-86]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-61} \lor \neg \left(z \leq 3.15 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t}}{z} - 2\\
\end{array}
\end{array}
if z < -6.00000000000000024e-61 or 3.15e-86 < z Initial program 76.5%
Taylor expanded in z around inf 94.1%
div-sub94.1%
sub-neg94.1%
*-inverses94.1%
metadata-eval94.1%
distribute-lft-in94.1%
associate-*r/94.1%
metadata-eval94.1%
metadata-eval94.1%
Simplified94.1%
if -6.00000000000000024e-61 < z < 3.15e-86Initial program 99.8%
Taylor expanded in t around 0 99.8%
Taylor expanded in z around 0 77.9%
associate-/r*77.9%
Simplified77.9%
Final simplification87.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.9e-5) (not (<= z 4.1e-57))) (+ (/ 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 <= -4.9e-5) || !(z <= 4.1e-57)) {
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 <= (-4.9d-5)) .or. (.not. (z <= 4.1d-57))) 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 <= -4.9e-5) || !(z <= 4.1e-57)) {
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 <= -4.9e-5) or not (z <= 4.1e-57): 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 <= -4.9e-5) || !(z <= 4.1e-57)) 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 <= -4.9e-5) || ~((z <= 4.1e-57))) 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, -4.9e-5], N[Not[LessEqual[z, 4.1e-57]], $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 -4.9 \cdot 10^{-5} \lor \neg \left(z \leq 4.1 \cdot 10^{-57}\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 < -4.9e-5 or 4.1000000000000001e-57 < z Initial program 73.1%
Taylor expanded in z around inf 98.1%
div-sub98.1%
sub-neg98.1%
*-inverses98.1%
metadata-eval98.1%
distribute-lft-in98.1%
associate-*r/98.1%
metadata-eval98.1%
metadata-eval98.1%
Simplified98.1%
if -4.9e-5 < z < 4.1000000000000001e-57Initial program 99.8%
Taylor expanded in z around 0 92.8%
Final simplification95.7%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -6.5e+57) (/ x y) (if (<= (/ x y) 59000000000.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) <= -6.5e+57) {
tmp = x / y;
} else if ((x / y) <= 59000000000.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) <= (-6.5d+57)) then
tmp = x / y
else if ((x / y) <= 59000000000.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) <= -6.5e+57) {
tmp = x / y;
} else if ((x / y) <= 59000000000.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) <= -6.5e+57: tmp = x / y elif (x / y) <= 59000000000.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) <= -6.5e+57) tmp = Float64(x / y); elseif (Float64(x / y) <= 59000000000.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) <= -6.5e+57) tmp = x / y; elseif ((x / y) <= 59000000000.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], -6.5e+57], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 59000000000.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 -6.5 \cdot 10^{+57}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 59000000000:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -6.4999999999999997e57Initial program 90.0%
Taylor expanded in x around inf 70.3%
if -6.4999999999999997e57 < (/.f64 x y) < 5.9e10Initial program 84.6%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around inf 62.4%
associate-*r/62.4%
metadata-eval62.4%
+-commutative62.4%
Simplified62.4%
Taylor expanded in x around 0 59.3%
sub-neg59.3%
associate-*r/59.3%
metadata-eval59.3%
metadata-eval59.3%
Simplified59.3%
if 5.9e10 < (/.f64 x y) Initial program 83.2%
Taylor expanded in t around inf 85.6%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9.2e-20) (not (<= t 8.2))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.2e-20) || !(t <= 8.2)) {
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 <= (-9.2d-20)) .or. (.not. (t <= 8.2d0))) 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 <= -9.2e-20) || !(t <= 8.2)) {
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 <= -9.2e-20) or not (t <= 8.2): 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 <= -9.2e-20) || !(t <= 8.2)) 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 <= -9.2e-20) || ~((t <= 8.2))) 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, -9.2e-20], N[Not[LessEqual[t, 8.2]], $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 -9.2 \cdot 10^{-20} \lor \neg \left(t \leq 8.2\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -9.1999999999999997e-20 or 8.1999999999999993 < t Initial program 72.7%
Taylor expanded in t around inf 83.9%
if -9.1999999999999997e-20 < t < 8.1999999999999993Initial program 99.8%
Taylor expanded in t around 0 81.4%
associate-*r/81.4%
metadata-eval81.4%
Simplified81.4%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1.95e-19) -2.0 (if (<= t 0.95) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.95e-19) {
tmp = -2.0;
} else if (t <= 0.95) {
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.95d-19)) then
tmp = -2.0d0
else if (t <= 0.95d0) 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.95e-19) {
tmp = -2.0;
} else if (t <= 0.95) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.95e-19: tmp = -2.0 elif t <= 0.95: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.95e-19) tmp = -2.0; elseif (t <= 0.95) 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.95e-19) tmp = -2.0; elseif (t <= 0.95) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.95e-19], -2.0, If[LessEqual[t, 0.95], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-19}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 0.95:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.94999999999999998e-19 or 0.94999999999999996 < t Initial program 72.9%
Taylor expanded in t around inf 82.6%
Taylor expanded in x around 0 37.1%
if -1.94999999999999998e-19 < t < 0.94999999999999996Initial program 99.8%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around inf 58.8%
associate-*r/58.8%
metadata-eval58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in t around 0 35.3%
Final simplification36.3%
(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 85.4%
+-commutative85.4%
remove-double-neg85.4%
distribute-frac-neg85.4%
unsub-neg85.4%
*-commutative85.4%
associate-*r*85.4%
distribute-rgt1-in85.4%
associate-/l*85.3%
fma-neg85.3%
*-commutative85.3%
fma-define85.3%
*-commutative85.3%
distribute-frac-neg85.3%
remove-double-neg85.3%
Simplified85.3%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(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 55.9%
Taylor expanded in x around 0 21.1%
Final simplification21.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 2024067
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))