
(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 (if (or (<= (/ x y) -6.2e+17) (not (<= (/ x y) 1.1e-15))) (+ (/ x y) (/ (fma 2.0 z 2.0) (* t z))) (- -2.0 (/ (- (/ -2.0 z) 2.0) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -6.2e+17) || !((x / y) <= 1.1e-15)) {
tmp = (x / y) + (fma(2.0, z, 2.0) / (t * z));
} else {
tmp = -2.0 - (((-2.0 / z) - 2.0) / t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -6.2e+17) || !(Float64(x / y) <= 1.1e-15)) tmp = Float64(Float64(x / y) + Float64(fma(2.0, z, 2.0) / Float64(t * z))); else tmp = Float64(-2.0 - Float64(Float64(Float64(-2.0 / z) - 2.0) / t)); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -6.2e+17], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.1e-15]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 * z + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 - N[(N[(N[(-2.0 / z), $MachinePrecision] - 2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -6.2 \cdot 10^{+17} \lor \neg \left(\frac{x}{y} \leq 1.1 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{x}{y} + \frac{\mathsf{fma}\left(2, z, 2\right)}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{\frac{-2}{z} - 2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -6.2e17 or 1.09999999999999993e-15 < (/.f64 x y) Initial program 90.0%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
if -6.2e17 < (/.f64 x y) < 1.09999999999999993e-15Initial program 88.7%
Taylor expanded in x around 0
associate-+r+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
associate-/r*N/A
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
associate-*l/N/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites99.9%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.1e+39) (not (<= (/ x y) 6.6e+14))) (fma (pow t -1.0) 2.0 (/ x y)) (- -2.0 (/ (- (/ -2.0 z) 2.0) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.1e+39) || !((x / y) <= 6.6e+14)) {
tmp = fma(pow(t, -1.0), 2.0, (x / y));
} else {
tmp = -2.0 - (((-2.0 / z) - 2.0) / t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.1e+39) || !(Float64(x / y) <= 6.6e+14)) tmp = fma((t ^ -1.0), 2.0, Float64(x / y)); else tmp = Float64(-2.0 - Float64(Float64(Float64(-2.0 / z) - 2.0) / t)); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.1e+39], N[Not[LessEqual[N[(x / y), $MachinePrecision], 6.6e+14]], $MachinePrecision]], N[(N[Power[t, -1.0], $MachinePrecision] * 2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 - N[(N[(N[(-2.0 / z), $MachinePrecision] - 2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.1 \cdot 10^{+39} \lor \neg \left(\frac{x}{y} \leq 6.6 \cdot 10^{+14}\right):\\
\;\;\;\;\mathsf{fma}\left({t}^{-1}, 2, \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{\frac{-2}{z} - 2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.1000000000000001e39 or 6.6e14 < (/.f64 x y) Initial program 89.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6483.8
Applied rewrites83.8%
Taylor expanded in t around 0
Applied rewrites83.8%
if -1.1000000000000001e39 < (/.f64 x y) < 6.6e14Initial program 89.2%
Taylor expanded in x around 0
associate-+r+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
associate-/r*N/A
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
associate-*l/N/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites99.9%
Final simplification92.6%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -6.8e+41)
(+ (/ x y) (/ 2.0 (* t z)))
(if (<= (/ x y) 6.6e+14)
(- -2.0 (/ (- (/ -2.0 z) 2.0) t))
(fma (pow t -1.0) 2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -6.8e+41) {
tmp = (x / y) + (2.0 / (t * z));
} else if ((x / y) <= 6.6e+14) {
tmp = -2.0 - (((-2.0 / z) - 2.0) / t);
} else {
tmp = fma(pow(t, -1.0), 2.0, (x / y));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -6.8e+41) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); elseif (Float64(x / y) <= 6.6e+14) tmp = Float64(-2.0 - Float64(Float64(Float64(-2.0 / z) - 2.0) / t)); else tmp = fma((t ^ -1.0), 2.0, Float64(x / y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -6.8e+41], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 6.6e+14], N[(-2.0 - N[(N[(N[(-2.0 / z), $MachinePrecision] - 2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[Power[t, -1.0], $MachinePrecision] * 2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -6.8 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{elif}\;\frac{x}{y} \leq 6.6 \cdot 10^{+14}:\\
\;\;\;\;-2 - \frac{\frac{-2}{z} - 2}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({t}^{-1}, 2, \frac{x}{y}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -6.79999999999999996e41Initial program 93.6%
Taylor expanded in z around 0
Applied rewrites86.1%
if -6.79999999999999996e41 < (/.f64 x y) < 6.6e14Initial program 89.2%
Taylor expanded in x around 0
associate-+r+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
associate-/r*N/A
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
associate-*l/N/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites99.9%
if 6.6e14 < (/.f64 x y) Initial program 86.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6486.7
Applied rewrites86.7%
Taylor expanded in t around 0
Applied rewrites86.6%
Final simplification93.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
(if (or (<= t_1 -2e+53) (not (or (<= t_1 2e+37) (not (<= t_1 INFINITY)))))
(/ (- (/ 2.0 z) -2.0) t)
(+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + ((z * 2.0) * (1.0 - t))) / (t * z);
double tmp;
if ((t_1 <= -2e+53) || !((t_1 <= 2e+37) || !(t_1 <= ((double) INFINITY)))) {
tmp = ((2.0 / z) - -2.0) / t;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 + ((z * 2.0) * (1.0 - t))) / (t * z);
double tmp;
if ((t_1 <= -2e+53) || !((t_1 <= 2e+37) || !(t_1 <= Double.POSITIVE_INFINITY))) {
tmp = ((2.0 / z) - -2.0) / t;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + ((z * 2.0) * (1.0 - t))) / (t * z) tmp = 0 if (t_1 <= -2e+53) or not ((t_1 <= 2e+37) or not (t_1 <= math.inf)): tmp = ((2.0 / z) - -2.0) / t else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z)) tmp = 0.0 if ((t_1 <= -2e+53) || !((t_1 <= 2e+37) || !(t_1 <= Inf))) tmp = Float64(Float64(Float64(2.0 / z) - -2.0) / t); else tmp = Float64(Float64(x / y) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + ((z * 2.0) * (1.0 - t))) / (t * z); tmp = 0.0; if ((t_1 <= -2e+53) || ~(((t_1 <= 2e+37) || ~((t_1 <= Inf))))) tmp = ((2.0 / z) - -2.0) / t; else tmp = (x / y) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+53], N[Not[Or[LessEqual[t$95$1, 2e+37], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]]], $MachinePrecision]], N[(N[(N[(2.0 / z), $MachinePrecision] - -2.0), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+53} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+37} \lor \neg \left(t\_1 \leq \infty\right)\right):\\
\;\;\;\;\frac{\frac{2}{z} - -2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < -2e53 or 1.99999999999999991e37 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < +inf.0Initial program 99.1%
Taylor expanded in t around 0
lower-/.f64N/A
metadata-evalN/A
*-inversesN/A
associate-/l*N/A
associate-*r/N/A
metadata-evalN/A
div-addN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
div-subN/A
metadata-evalN/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6481.5
Applied rewrites81.5%
if -2e53 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < 1.99999999999999991e37 or +inf.0 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) Initial program 76.3%
Taylor expanded in t around inf
Applied rewrites93.8%
Final simplification86.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
(if (or (<= t_1 -2e+53) (not (or (<= t_1 2e+83) (not (<= t_1 INFINITY)))))
(/ 2.0 (* t z))
(+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + ((z * 2.0) * (1.0 - t))) / (t * z);
double tmp;
if ((t_1 <= -2e+53) || !((t_1 <= 2e+83) || !(t_1 <= ((double) INFINITY)))) {
tmp = 2.0 / (t * z);
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 + ((z * 2.0) * (1.0 - t))) / (t * z);
double tmp;
if ((t_1 <= -2e+53) || !((t_1 <= 2e+83) || !(t_1 <= Double.POSITIVE_INFINITY))) {
tmp = 2.0 / (t * z);
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + ((z * 2.0) * (1.0 - t))) / (t * z) tmp = 0 if (t_1 <= -2e+53) or not ((t_1 <= 2e+83) or not (t_1 <= math.inf)): tmp = 2.0 / (t * z) else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z)) tmp = 0.0 if ((t_1 <= -2e+53) || !((t_1 <= 2e+83) || !(t_1 <= Inf))) tmp = Float64(2.0 / Float64(t * z)); else tmp = Float64(Float64(x / y) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + ((z * 2.0) * (1.0 - t))) / (t * z); tmp = 0.0; if ((t_1 <= -2e+53) || ~(((t_1 <= 2e+83) || ~((t_1 <= Inf))))) tmp = 2.0 / (t * z); else tmp = (x / y) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+53], N[Not[Or[LessEqual[t$95$1, 2e+83], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]]], $MachinePrecision]], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+53} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+83} \lor \neg \left(t\_1 \leq \infty\right)\right):\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < -2e53 or 2.00000000000000006e83 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < +inf.0Initial program 99.0%
Taylor expanded in x around 0
associate-+r+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
associate-/r*N/A
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
associate-*l/N/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
if -2e53 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < 2.00000000000000006e83 or +inf.0 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) Initial program 78.3%
Taylor expanded in t around inf
Applied rewrites88.6%
Final simplification70.3%
(FPCore (x y z t) :precision binary64 (if (<= (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))) INFINITY) (+ (/ x y) (/ (fma (fma -2.0 t 2.0) z 2.0) (* t z))) (+ (/ x y) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))) <= ((double) INFINITY)) {
tmp = (x / y) + (fma(fma(-2.0, t, 2.0), z, 2.0) / (t * z));
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) <= Inf) tmp = Float64(Float64(x / y) + Float64(fma(fma(-2.0, t, 2.0), z, 2.0) / Float64(t * z))); else tmp = Float64(Float64(x / y) + -2.0); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[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], Infinity], N[(N[(x / y), $MachinePrecision] + N[(N[(N[(-2.0 * t + 2.0), $MachinePrecision] * z + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \leq \infty:\\
\;\;\;\;\frac{x}{y} + \frac{\mathsf{fma}\left(\mathsf{fma}\left(-2, t, 2\right), z, 2\right)}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) < +inf.0Initial program 99.8%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) Initial program 0.0%
Taylor expanded in t around inf
Applied rewrites96.3%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -6.8e+41)
(+ (/ x y) (/ 2.0 (* t z)))
(if (<= (/ x y) 6.6e+14)
(- -2.0 (/ (- (/ -2.0 z) 2.0) t))
(fma (/ (- 1.0 t) t) 2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -6.8e+41) {
tmp = (x / y) + (2.0 / (t * z));
} else if ((x / y) <= 6.6e+14) {
tmp = -2.0 - (((-2.0 / z) - 2.0) / t);
} else {
tmp = fma(((1.0 - t) / t), 2.0, (x / y));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -6.8e+41) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); elseif (Float64(x / y) <= 6.6e+14) tmp = Float64(-2.0 - Float64(Float64(Float64(-2.0 / z) - 2.0) / t)); else tmp = fma(Float64(Float64(1.0 - t) / t), 2.0, Float64(x / y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -6.8e+41], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 6.6e+14], N[(-2.0 - N[(N[(N[(-2.0 / z), $MachinePrecision] - 2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - t), $MachinePrecision] / t), $MachinePrecision] * 2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -6.8 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{elif}\;\frac{x}{y} \leq 6.6 \cdot 10^{+14}:\\
\;\;\;\;-2 - \frac{\frac{-2}{z} - 2}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1 - t}{t}, 2, \frac{x}{y}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -6.79999999999999996e41Initial program 93.6%
Taylor expanded in z around 0
Applied rewrites86.1%
if -6.79999999999999996e41 < (/.f64 x y) < 6.6e14Initial program 89.2%
Taylor expanded in x around 0
associate-+r+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
associate-/r*N/A
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
associate-*l/N/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites99.9%
if 6.6e14 < (/.f64 x y) Initial program 86.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6486.7
Applied rewrites86.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3.5e+156) (not (<= (/ x y) 1.15e+64))) (+ (/ x y) -2.0) (- -2.0 (/ (- (/ -2.0 z) 2.0) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3.5e+156) || !((x / y) <= 1.15e+64)) {
tmp = (x / y) + -2.0;
} else {
tmp = -2.0 - (((-2.0 / z) - 2.0) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-3.5d+156)) .or. (.not. ((x / y) <= 1.15d+64))) then
tmp = (x / y) + (-2.0d0)
else
tmp = (-2.0d0) - ((((-2.0d0) / z) - 2.0d0) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3.5e+156) || !((x / y) <= 1.15e+64)) {
tmp = (x / y) + -2.0;
} else {
tmp = -2.0 - (((-2.0 / z) - 2.0) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3.5e+156) or not ((x / y) <= 1.15e+64): tmp = (x / y) + -2.0 else: tmp = -2.0 - (((-2.0 / z) - 2.0) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -3.5e+156) || !(Float64(x / y) <= 1.15e+64)) tmp = Float64(Float64(x / y) + -2.0); else tmp = Float64(-2.0 - Float64(Float64(Float64(-2.0 / z) - 2.0) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -3.5e+156) || ~(((x / y) <= 1.15e+64))) tmp = (x / y) + -2.0; else tmp = -2.0 - (((-2.0 / z) - 2.0) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -3.5e+156], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.15e+64]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(-2.0 - N[(N[(N[(-2.0 / z), $MachinePrecision] - 2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3.5 \cdot 10^{+156} \lor \neg \left(\frac{x}{y} \leq 1.15 \cdot 10^{+64}\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{\frac{-2}{z} - 2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.5000000000000003e156 or 1.15e64 < (/.f64 x y) Initial program 88.6%
Taylor expanded in t around inf
Applied rewrites79.4%
if -3.5000000000000003e156 < (/.f64 x y) < 1.15e64Initial program 89.7%
Taylor expanded in x around 0
associate-+r+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
associate-/r*N/A
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
associate-*l/N/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites93.2%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.1e+39) (not (<= (/ x y) 6.6e+14))) (+ (/ x y) -2.0) (- (/ (/ 2.0 z) t) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.1e+39) || !((x / y) <= 6.6e+14)) {
tmp = (x / y) + -2.0;
} else {
tmp = ((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) <= (-1.1d+39)) .or. (.not. ((x / y) <= 6.6d+14))) then
tmp = (x / y) + (-2.0d0)
else
tmp = ((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) <= -1.1e+39) || !((x / y) <= 6.6e+14)) {
tmp = (x / y) + -2.0;
} else {
tmp = ((2.0 / z) / t) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.1e+39) or not ((x / y) <= 6.6e+14): tmp = (x / y) + -2.0 else: tmp = ((2.0 / z) / t) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.1e+39) || !(Float64(x / y) <= 6.6e+14)) tmp = Float64(Float64(x / y) + -2.0); else tmp = Float64(Float64(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) <= -1.1e+39) || ~(((x / y) <= 6.6e+14))) tmp = (x / y) + -2.0; else tmp = ((2.0 / z) / t) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.1e+39], N[Not[LessEqual[N[(x / y), $MachinePrecision], 6.6e+14]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.1 \cdot 10^{+39} \lor \neg \left(\frac{x}{y} \leq 6.6 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{z}}{t} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.1000000000000001e39 or 6.6e14 < (/.f64 x y) Initial program 89.5%
Taylor expanded in t around inf
Applied rewrites70.8%
if -1.1000000000000001e39 < (/.f64 x y) < 6.6e14Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites43.1%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6464.6
Applied rewrites64.6%
Taylor expanded in x around 0
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
div-addN/A
associate-/l*N/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
associate-+l-N/A
associate-*r/N/A
metadata-evalN/A
Applied rewrites99.9%
Taylor expanded in z around 0
Applied rewrites77.3%
Final simplification74.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -92000000000.0) (not (<= (/ x y) 23000000000.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) <= -92000000000.0) || !((x / y) <= 23000000000.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) <= (-92000000000.0d0)) .or. (.not. ((x / y) <= 23000000000.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) <= -92000000000.0) || !((x / y) <= 23000000000.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) <= -92000000000.0) or not ((x / y) <= 23000000000.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) <= -92000000000.0) || !(Float64(x / y) <= 23000000000.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) <= -92000000000.0) || ~(((x / y) <= 23000000000.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], -92000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 23000000000.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 -92000000000 \lor \neg \left(\frac{x}{y} \leq 23000000000\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.2e10 or 2.3e10 < (/.f64 x y) Initial program 89.8%
Taylor expanded in t around inf
Applied rewrites69.0%
if -9.2e10 < (/.f64 x y) < 2.3e10Initial program 88.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6459.6
Applied rewrites59.6%
Taylor expanded in x around 0
Applied rewrites59.6%
Final simplification63.9%
(FPCore (x y z t) :precision binary64 (fma (/ 2.0 t) (- (/ (+ 1.0 z) z) t) (/ x y)))
double code(double x, double y, double z, double t) {
return fma((2.0 / t), (((1.0 + z) / z) - t), (x / y));
}
function code(x, y, z, t) return fma(Float64(2.0 / t), Float64(Float64(Float64(1.0 + z) / z) - t), Float64(x / y)) end
code[x_, y_, z_, t_] := N[(N[(2.0 / t), $MachinePrecision] * N[(N[(N[(1.0 + z), $MachinePrecision] / z), $MachinePrecision] - t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{2}{t}, \frac{1 + z}{z} - t, \frac{x}{y}\right)
\end{array}
Initial program 89.3%
Taylor expanded in x around 0
associate-+r+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
associate-/r*N/A
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
associate-*l/N/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -58.0) (not (<= t 1.0))) -2.0 (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -58.0) || !(t <= 1.0)) {
tmp = -2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-58.0d0)) .or. (.not. (t <= 1.0d0))) then
tmp = -2.0d0
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -58.0) || !(t <= 1.0)) {
tmp = -2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -58.0) or not (t <= 1.0): tmp = -2.0 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -58.0) || !(t <= 1.0)) tmp = -2.0; else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -58.0) || ~((t <= 1.0))) tmp = -2.0; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -58.0], N[Not[LessEqual[t, 1.0]], $MachinePrecision]], -2.0, N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -58 \lor \neg \left(t \leq 1\right):\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if t < -58 or 1 < t Initial program 79.7%
Taylor expanded in z around 0
Applied rewrites61.4%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6461.4
Applied rewrites61.4%
Taylor expanded in x around 0
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
div-addN/A
associate-/l*N/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
associate-+l-N/A
associate-*r/N/A
metadata-evalN/A
Applied rewrites56.0%
Taylor expanded in t around inf
Applied rewrites39.5%
if -58 < t < 1Initial program 99.0%
Taylor expanded in t around 0
lower-/.f64N/A
metadata-evalN/A
*-inversesN/A
associate-/l*N/A
associate-*r/N/A
metadata-evalN/A
div-addN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
div-subN/A
metadata-evalN/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6482.0
Applied rewrites82.0%
Taylor expanded in z around inf
Applied rewrites36.9%
Final simplification38.2%
(FPCore (x y z t) :precision binary64 (- (/ 2.0 t) 2.0))
double code(double x, double y, double z, double t) {
return (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 = (2.0d0 / t) - 2.0d0
end function
public static double code(double x, double y, double z, double t) {
return (2.0 / t) - 2.0;
}
def code(x, y, z, t): return (2.0 / t) - 2.0
function code(x, y, z, t) return Float64(Float64(2.0 / t) - 2.0) end
function tmp = code(x, y, z, t) tmp = (2.0 / t) - 2.0; end
code[x_, y_, z_, t_] := N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t} - 2
\end{array}
Initial program 89.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
Taylor expanded in x around 0
Applied rewrites38.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 89.3%
Taylor expanded in z around 0
Applied rewrites62.3%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6480.1
Applied rewrites80.1%
Taylor expanded in x around 0
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
div-addN/A
associate-/l*N/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
associate-+l-N/A
associate-*r/N/A
metadata-evalN/A
Applied rewrites68.9%
Taylor expanded in t around inf
Applied rewrites21.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 2024338
(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))))