
(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 12 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 (/ (+ 1.0 z) (* z t))) (/ x y)) -2.0))
double code(double x, double y, double z, double t) {
return ((2.0 * ((1.0 + z) / (z * t))) + (x / y)) + -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 * ((1.0d0 + z) / (z * t))) + (x / y)) + (-2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 * ((1.0 + z) / (z * t))) + (x / y)) + -2.0;
}
def code(x, y, z, t): return ((2.0 * ((1.0 + z) / (z * t))) + (x / y)) + -2.0
function code(x, y, z, t) return Float64(Float64(Float64(2.0 * Float64(Float64(1.0 + z) / Float64(z * t))) + Float64(x / y)) + -2.0) end
function tmp = code(x, y, z, t) tmp = ((2.0 * ((1.0 + z) / (z * t))) + (x / y)) + -2.0; end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 * N[(N[(1.0 + z), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot \frac{1 + z}{z \cdot t} + \frac{x}{y}\right) + -2
\end{array}
Initial program 83.9%
+-commutative83.9%
remove-double-neg83.9%
distribute-frac-neg83.9%
unsub-neg83.9%
*-commutative83.9%
associate-*r*83.9%
distribute-rgt1-in83.9%
associate-*r/83.8%
/-rgt-identity83.8%
fma-neg83.8%
/-rgt-identity83.8%
*-commutative83.8%
fma-def83.8%
*-commutative83.8%
distribute-frac-neg83.8%
remove-double-neg83.8%
Simplified83.8%
Taylor expanded in t around 0 99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)) (t_2 (+ (/ 2.0 (* z t)) -2.0)))
(if (<= (/ x y) -2.4e-8)
t_1
(if (<= (/ x y) -3.2e-129)
t_2
(if (<= (/ x y) -1.95e-263)
(+ (/ 2.0 t) -2.0)
(if (<= (/ x y) 6e+120) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double t_2 = (2.0 / (z * t)) + -2.0;
double tmp;
if ((x / y) <= -2.4e-8) {
tmp = t_1;
} else if ((x / y) <= -3.2e-129) {
tmp = t_2;
} else if ((x / y) <= -1.95e-263) {
tmp = (2.0 / t) + -2.0;
} else if ((x / y) <= 6e+120) {
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 = (2.0d0 / (z * t)) + (-2.0d0)
if ((x / y) <= (-2.4d-8)) then
tmp = t_1
else if ((x / y) <= (-3.2d-129)) then
tmp = t_2
else if ((x / y) <= (-1.95d-263)) then
tmp = (2.0d0 / t) + (-2.0d0)
else if ((x / y) <= 6d+120) 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 = (2.0 / (z * t)) + -2.0;
double tmp;
if ((x / y) <= -2.4e-8) {
tmp = t_1;
} else if ((x / y) <= -3.2e-129) {
tmp = t_2;
} else if ((x / y) <= -1.95e-263) {
tmp = (2.0 / t) + -2.0;
} else if ((x / y) <= 6e+120) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 t_2 = (2.0 / (z * t)) + -2.0 tmp = 0 if (x / y) <= -2.4e-8: tmp = t_1 elif (x / y) <= -3.2e-129: tmp = t_2 elif (x / y) <= -1.95e-263: tmp = (2.0 / t) + -2.0 elif (x / y) <= 6e+120: 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(2.0 / Float64(z * t)) + -2.0) tmp = 0.0 if (Float64(x / y) <= -2.4e-8) tmp = t_1; elseif (Float64(x / y) <= -3.2e-129) tmp = t_2; elseif (Float64(x / y) <= -1.95e-263) tmp = Float64(Float64(2.0 / t) + -2.0); elseif (Float64(x / y) <= 6e+120) 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 = (2.0 / (z * t)) + -2.0; tmp = 0.0; if ((x / y) <= -2.4e-8) tmp = t_1; elseif ((x / y) <= -3.2e-129) tmp = t_2; elseif ((x / y) <= -1.95e-263) tmp = (2.0 / t) + -2.0; elseif ((x / y) <= 6e+120) 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[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2.4e-8], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -3.2e-129], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -1.95e-263], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 6e+120], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
t_2 := \frac{2}{z \cdot t} + -2\\
\mathbf{if}\;\frac{x}{y} \leq -2.4 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq -3.2 \cdot 10^{-129}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{x}{y} \leq -1.95 \cdot 10^{-263}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{elif}\;\frac{x}{y} \leq 6 \cdot 10^{+120}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 x y) < -2.39999999999999998e-8 or 6e120 < (/.f64 x y) Initial program 81.6%
Taylor expanded in t around inf 74.1%
if -2.39999999999999998e-8 < (/.f64 x y) < -3.2000000000000003e-129 or -1.94999999999999985e-263 < (/.f64 x y) < 6e120Initial program 85.5%
+-commutative85.5%
remove-double-neg85.5%
distribute-frac-neg85.5%
unsub-neg85.5%
*-commutative85.5%
associate-*r*85.5%
distribute-rgt1-in85.5%
associate-*r/85.4%
/-rgt-identity85.4%
fma-neg85.4%
/-rgt-identity85.4%
*-commutative85.4%
fma-def85.4%
*-commutative85.4%
distribute-frac-neg85.4%
remove-double-neg85.4%
Simplified85.4%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around 0 75.6%
if -3.2000000000000003e-129 < (/.f64 x y) < -1.94999999999999985e-263Initial program 84.9%
+-commutative84.9%
remove-double-neg84.9%
distribute-frac-neg84.9%
unsub-neg84.9%
*-commutative84.9%
associate-*r*84.9%
distribute-rgt1-in84.9%
associate-*r/84.6%
/-rgt-identity84.6%
fma-neg84.6%
/-rgt-identity84.6%
*-commutative84.6%
fma-def84.5%
*-commutative84.5%
distribute-frac-neg84.5%
remove-double-neg84.5%
Simplified84.5%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around inf 90.0%
associate-*r/90.0%
metadata-eval90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in x around 0 90.0%
Final simplification76.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= (/ x y) -2.45e-8)
t_1
(if (<= (/ x y) -3e-124)
(+ (/ (/ 2.0 t) z) -2.0)
(if (<= (/ x y) -1.6e-263)
(+ (/ 2.0 t) -2.0)
(if (<= (/ x y) 1.02e+121) (+ (/ 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 ((x / y) <= -2.45e-8) {
tmp = t_1;
} else if ((x / y) <= -3e-124) {
tmp = ((2.0 / t) / z) + -2.0;
} else if ((x / y) <= -1.6e-263) {
tmp = (2.0 / t) + -2.0;
} else if ((x / y) <= 1.02e+121) {
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 ((x / y) <= (-2.45d-8)) then
tmp = t_1
else if ((x / y) <= (-3d-124)) then
tmp = ((2.0d0 / t) / z) + (-2.0d0)
else if ((x / y) <= (-1.6d-263)) then
tmp = (2.0d0 / t) + (-2.0d0)
else if ((x / y) <= 1.02d+121) 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 ((x / y) <= -2.45e-8) {
tmp = t_1;
} else if ((x / y) <= -3e-124) {
tmp = ((2.0 / t) / z) + -2.0;
} else if ((x / y) <= -1.6e-263) {
tmp = (2.0 / t) + -2.0;
} else if ((x / y) <= 1.02e+121) {
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 (x / y) <= -2.45e-8: tmp = t_1 elif (x / y) <= -3e-124: tmp = ((2.0 / t) / z) + -2.0 elif (x / y) <= -1.6e-263: tmp = (2.0 / t) + -2.0 elif (x / y) <= 1.02e+121: 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 (Float64(x / y) <= -2.45e-8) tmp = t_1; elseif (Float64(x / y) <= -3e-124) tmp = Float64(Float64(Float64(2.0 / t) / z) + -2.0); elseif (Float64(x / y) <= -1.6e-263) tmp = Float64(Float64(2.0 / t) + -2.0); elseif (Float64(x / y) <= 1.02e+121) tmp = Float64(Float64(2.0 / Float64(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 ((x / y) <= -2.45e-8) tmp = t_1; elseif ((x / y) <= -3e-124) tmp = ((2.0 / t) / z) + -2.0; elseif ((x / y) <= -1.6e-263) tmp = (2.0 / t) + -2.0; elseif ((x / y) <= 1.02e+121) 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[N[(x / y), $MachinePrecision], -2.45e-8], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -3e-124], N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] + -2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1.6e-263], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.02e+121], N[(N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;\frac{x}{y} \leq -2.45 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq -3 \cdot 10^{-124}:\\
\;\;\;\;\frac{\frac{2}{t}}{z} + -2\\
\mathbf{elif}\;\frac{x}{y} \leq -1.6 \cdot 10^{-263}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.02 \cdot 10^{+121}:\\
\;\;\;\;\frac{2}{z \cdot t} + -2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 x y) < -2.4500000000000001e-8 or 1.02000000000000005e121 < (/.f64 x y) Initial program 81.6%
Taylor expanded in t around inf 74.1%
if -2.4500000000000001e-8 < (/.f64 x y) < -3e-124Initial program 88.1%
+-commutative88.1%
remove-double-neg88.1%
distribute-frac-neg88.1%
unsub-neg88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt1-in88.1%
associate-*r/88.1%
/-rgt-identity88.1%
fma-neg88.1%
/-rgt-identity88.1%
*-commutative88.1%
fma-def88.1%
*-commutative88.1%
distribute-frac-neg88.1%
remove-double-neg88.1%
Simplified88.1%
Taylor expanded in t around 0 99.8%
Taylor expanded in z around 0 85.2%
associate-/r*85.3%
Simplified85.3%
if -3e-124 < (/.f64 x y) < -1.6e-263Initial program 84.9%
+-commutative84.9%
remove-double-neg84.9%
distribute-frac-neg84.9%
unsub-neg84.9%
*-commutative84.9%
associate-*r*84.9%
distribute-rgt1-in84.9%
associate-*r/84.6%
/-rgt-identity84.6%
fma-neg84.6%
/-rgt-identity84.6%
*-commutative84.6%
fma-def84.5%
*-commutative84.5%
distribute-frac-neg84.5%
remove-double-neg84.5%
Simplified84.5%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around inf 90.0%
associate-*r/90.0%
metadata-eval90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in x around 0 90.0%
if -1.6e-263 < (/.f64 x y) < 1.02000000000000005e121Initial program 85.1%
+-commutative85.1%
remove-double-neg85.1%
distribute-frac-neg85.1%
unsub-neg85.1%
*-commutative85.1%
associate-*r*85.1%
distribute-rgt1-in85.1%
associate-*r/85.0%
/-rgt-identity85.0%
fma-neg85.0%
/-rgt-identity85.0%
*-commutative85.0%
fma-def85.0%
*-commutative85.0%
distribute-frac-neg85.0%
remove-double-neg85.0%
Simplified85.0%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around 0 74.1%
Final simplification76.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= t -2.2e+71)
t_1
(if (<= t 5.5e-65)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (<= t 1.05e+79) (+ (/ 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;
double tmp;
if (t <= -2.2e+71) {
tmp = t_1;
} else if (t <= 5.5e-65) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 1.05e+79) {
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)
if (t <= (-2.2d+71)) then
tmp = t_1
else if (t <= 5.5d-65) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if (t <= 1.05d+79) 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;
double tmp;
if (t <= -2.2e+71) {
tmp = t_1;
} else if (t <= 5.5e-65) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 1.05e+79) {
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 tmp = 0 if t <= -2.2e+71: tmp = t_1 elif t <= 5.5e-65: tmp = (2.0 + (2.0 / z)) / t elif t <= 1.05e+79: 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) + -2.0) tmp = 0.0 if (t <= -2.2e+71) tmp = t_1; elseif (t <= 5.5e-65) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (t <= 1.05e+79) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / 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 (t <= -2.2e+71) tmp = t_1; elseif (t <= 5.5e-65) tmp = (2.0 + (2.0 / z)) / t; elseif (t <= 1.05e+79) 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] + -2.0), $MachinePrecision]}, If[LessEqual[t, -2.2e+71], t$95$1, If[LessEqual[t, 5.5e-65], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.05e+79], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-65}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.19999999999999995e71 or 1.05000000000000004e79 < t Initial program 63.2%
Taylor expanded in t around inf 91.1%
if -2.19999999999999995e71 < t < 5.4999999999999999e-65Initial program 98.2%
Taylor expanded in t around 0 80.5%
associate-*r/80.5%
metadata-eval80.5%
Simplified80.5%
if 5.4999999999999999e-65 < t < 1.05000000000000004e79Initial program 91.2%
Taylor expanded in z around 0 84.6%
associate-/r*84.6%
Simplified84.6%
Final simplification85.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -57000.0) (not (<= (/ x y) 850.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -57000.0) || !((x / y) <= 850.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) <= (-57000.0d0)) .or. (.not. ((x / y) <= 850.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) <= -57000.0) || !((x / y) <= 850.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -57000.0) or not ((x / y) <= 850.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) <= -57000.0) || !(Float64(x / y) <= 850.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) <= -57000.0) || ~(((x / y) <= 850.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], -57000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 850.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 -57000 \lor \neg \left(\frac{x}{y} \leq 850\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -57000 or 850 < (/.f64 x y) Initial program 83.2%
Taylor expanded in x around inf 66.3%
if -57000 < (/.f64 x y) < 850Initial program 84.4%
+-commutative84.4%
remove-double-neg84.4%
distribute-frac-neg84.4%
unsub-neg84.4%
*-commutative84.4%
associate-*r*84.4%
distribute-rgt1-in84.4%
associate-*r/84.4%
/-rgt-identity84.4%
fma-neg84.4%
/-rgt-identity84.4%
*-commutative84.4%
fma-def84.4%
*-commutative84.4%
distribute-frac-neg84.4%
remove-double-neg84.4%
Simplified84.4%
Taylor expanded in t around 0 99.8%
Taylor expanded in z around inf 62.6%
associate-*r/62.6%
metadata-eval62.6%
+-commutative62.6%
Simplified62.6%
Taylor expanded in x around 0 61.5%
Final simplification63.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.0021) (not (<= (/ x y) 1300.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) <= -0.0021) || !((x / y) <= 1300.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) <= (-0.0021d0)) .or. (.not. ((x / y) <= 1300.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) <= -0.0021) || !((x / y) <= 1300.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) <= -0.0021) or not ((x / y) <= 1300.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) <= -0.0021) || !(Float64(x / y) <= 1300.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) <= -0.0021) || ~(((x / y) <= 1300.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], -0.0021], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1300.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 -0.0021 \lor \neg \left(\frac{x}{y} \leq 1300\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -0.00209999999999999987 or 1300 < (/.f64 x y) Initial program 83.5%
Taylor expanded in t around inf 66.6%
if -0.00209999999999999987 < (/.f64 x y) < 1300Initial program 84.2%
+-commutative84.2%
remove-double-neg84.2%
distribute-frac-neg84.2%
unsub-neg84.2%
*-commutative84.2%
associate-*r*84.2%
distribute-rgt1-in84.2%
associate-*r/84.1%
/-rgt-identity84.1%
fma-neg84.1%
/-rgt-identity84.1%
*-commutative84.1%
fma-def84.1%
*-commutative84.1%
distribute-frac-neg84.1%
remove-double-neg84.1%
Simplified84.1%
Taylor expanded in t around 0 99.8%
Taylor expanded in z around inf 62.7%
associate-*r/62.7%
metadata-eval62.7%
+-commutative62.7%
Simplified62.7%
Taylor expanded in x around 0 62.3%
Final simplification64.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7e-68) (not (<= z 4e-16))) (+ (+ (/ 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 <= -7e-68) || !(z <= 4e-16)) {
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 <= (-7d-68)) .or. (.not. (z <= 4d-16))) 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 <= -7e-68) || !(z <= 4e-16)) {
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 <= -7e-68) or not (z <= 4e-16): 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 <= -7e-68) || !(z <= 4e-16)) tmp = Float64(Float64(Float64(x / y) + Float64(2.0 / t)) + -2.0); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7e-68) || ~((z <= 4e-16))) 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, -7e-68], N[Not[LessEqual[z, 4e-16]], $MachinePrecision]], N[(N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-68} \lor \neg \left(z \leq 4 \cdot 10^{-16}\right):\\
\;\;\;\;\left(\frac{x}{y} + \frac{2}{t}\right) + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -7.00000000000000026e-68 or 3.9999999999999999e-16 < z Initial program 71.1%
+-commutative71.1%
remove-double-neg71.1%
distribute-frac-neg71.1%
unsub-neg71.1%
*-commutative71.1%
associate-*r*71.1%
distribute-rgt1-in71.1%
associate-*r/71.0%
/-rgt-identity71.0%
fma-neg71.0%
/-rgt-identity71.0%
*-commutative71.0%
fma-def71.0%
*-commutative71.0%
distribute-frac-neg71.0%
remove-double-neg71.0%
Simplified71.0%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around inf 98.6%
associate-*r/98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
if -7.00000000000000026e-68 < z < 3.9999999999999999e-16Initial program 99.0%
Taylor expanded in z around 0 91.2%
associate-/r*91.2%
Simplified91.2%
Final simplification95.2%
(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(Float64(x / y) + 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[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{x}{y} + \frac{2 + \frac{2}{z}}{t}\right) + -2
\end{array}
Initial program 83.9%
+-commutative83.9%
remove-double-neg83.9%
distribute-frac-neg83.9%
unsub-neg83.9%
*-commutative83.9%
associate-*r*83.9%
distribute-rgt1-in83.9%
associate-*r/83.8%
/-rgt-identity83.8%
fma-neg83.8%
/-rgt-identity83.8%
*-commutative83.8%
fma-def83.8%
*-commutative83.8%
distribute-frac-neg83.8%
remove-double-neg83.8%
Simplified83.8%
Taylor expanded in t around 0 99.5%
Taylor expanded in z around 0 99.5%
associate-+r+99.5%
+-commutative99.5%
distribute-lft-out99.5%
associate-/l/99.2%
*-lft-identity99.2%
associate-*l/99.1%
distribute-lft-out99.1%
*-commutative99.1%
associate-*r*99.1%
associate-*r/99.1%
metadata-eval99.1%
distribute-rgt-in99.1%
associate-*l/99.2%
*-lft-identity99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.0) (not (<= (/ x y) 3900000000.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.0) || !((x / y) <= 3900000000.0)) {
tmp = x / y;
} 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 (((x / y) <= (-2.0d0)) .or. (.not. ((x / y) <= 3900000000.0d0))) then
tmp = x / y
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 (((x / y) <= -2.0) || !((x / y) <= 3900000000.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2.0) or not ((x / y) <= 3900000000.0): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2.0) || !(Float64(x / y) <= 3900000000.0)) tmp = Float64(x / y); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2.0) || ~(((x / y) <= 3900000000.0))) tmp = x / y; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3900000000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \lor \neg \left(\frac{x}{y} \leq 3900000000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -2 or 3.9e9 < (/.f64 x y) Initial program 83.0%
Taylor expanded in x around inf 67.4%
if -2 < (/.f64 x y) < 3.9e9Initial program 84.7%
+-commutative84.7%
remove-double-neg84.7%
distribute-frac-neg84.7%
unsub-neg84.7%
*-commutative84.7%
associate-*r*84.7%
distribute-rgt1-in84.7%
associate-*r/84.6%
/-rgt-identity84.6%
fma-neg84.6%
/-rgt-identity84.6%
*-commutative84.6%
fma-def84.6%
*-commutative84.6%
distribute-frac-neg84.6%
remove-double-neg84.6%
Simplified84.6%
Taylor expanded in x around 0 84.0%
Taylor expanded in t around inf 38.2%
Final simplification52.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.2e+71) (not (<= t 4.2e-24))) (+ (/ x y) -2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.2e+71) || !(t <= 4.2e-24)) {
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 <= (-2.2d+71)) .or. (.not. (t <= 4.2d-24))) 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 <= -2.2e+71) || !(t <= 4.2e-24)) {
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 <= -2.2e+71) or not (t <= 4.2e-24): 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 <= -2.2e+71) || !(t <= 4.2e-24)) 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 <= -2.2e+71) || ~((t <= 4.2e-24))) 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, -2.2e+71], N[Not[LessEqual[t, 4.2e-24]], $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 -2.2 \cdot 10^{+71} \lor \neg \left(t \leq 4.2 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -2.19999999999999995e71 or 4.1999999999999999e-24 < t Initial program 68.5%
Taylor expanded in t around inf 84.0%
if -2.19999999999999995e71 < t < 4.1999999999999999e-24Initial program 98.3%
Taylor expanded in t around 0 81.0%
associate-*r/81.0%
metadata-eval81.0%
Simplified81.0%
Final simplification82.5%
(FPCore (x y z t) :precision binary64 (if (<= t -1.35e-13) -2.0 (if (<= t 1.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.35e-13) {
tmp = -2.0;
} else if (t <= 1.0) {
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.35d-13)) then
tmp = -2.0d0
else if (t <= 1.0d0) 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.35e-13) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.35e-13: tmp = -2.0 elif t <= 1.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.35e-13) tmp = -2.0; elseif (t <= 1.0) 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.35e-13) tmp = -2.0; elseif (t <= 1.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.35e-13], -2.0, If[LessEqual[t, 1.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-13}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.35000000000000005e-13 or 1 < t Initial program 70.1%
+-commutative70.1%
remove-double-neg70.1%
distribute-frac-neg70.1%
unsub-neg70.1%
*-commutative70.1%
associate-*r*70.1%
distribute-rgt1-in70.1%
associate-*r/70.0%
/-rgt-identity70.0%
fma-neg70.0%
/-rgt-identity70.0%
*-commutative70.0%
fma-def70.0%
*-commutative70.0%
distribute-frac-neg70.0%
remove-double-neg70.0%
Simplified70.0%
Taylor expanded in x around 0 41.3%
Taylor expanded in t around inf 37.7%
if -1.35000000000000005e-13 < t < 1Initial program 99.0%
Taylor expanded in t around 0 81.9%
associate-*r/81.9%
metadata-eval81.9%
Simplified81.9%
Taylor expanded in z around inf 35.0%
Final simplification36.4%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 83.9%
+-commutative83.9%
remove-double-neg83.9%
distribute-frac-neg83.9%
unsub-neg83.9%
*-commutative83.9%
associate-*r*83.9%
distribute-rgt1-in83.9%
associate-*r/83.8%
/-rgt-identity83.8%
fma-neg83.8%
/-rgt-identity83.8%
*-commutative83.8%
fma-def83.8%
*-commutative83.8%
distribute-frac-neg83.8%
remove-double-neg83.8%
Simplified83.8%
Taylor expanded in x around 0 60.9%
Taylor expanded in t around inf 20.9%
Final simplification20.9%
(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 2023334
(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))))