
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (+ (+ -2.0 (/ x y)) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t);
}
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) + (x / y)) + ((2.0d0 + (2.0d0 / z)) / t)
end function
public static double code(double x, double y, double z, double t) {
return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t);
}
def code(x, y, z, t): return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t)
function code(x, y, z, t) return Float64(Float64(-2.0 + Float64(x / y)) + Float64(Float64(2.0 + Float64(2.0 / z)) / t)) end
function tmp = code(x, y, z, t) tmp = (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t); end
code[x_, y_, z_, t_] := N[(N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-2 + \frac{x}{y}\right) + \frac{2 + \frac{2}{z}}{t}
\end{array}
Initial 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-/l*88.4%
fma-neg88.4%
*-commutative88.4%
fma-define88.4%
*-commutative88.4%
distribute-frac-neg88.4%
remove-double-neg88.4%
Simplified88.4%
Taylor expanded in t around inf 99.5%
associate--l+99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
associate-*r/99.5%
distribute-lft-in99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2.4e+38)
(/ x y)
(if (<= (/ x y) -7e-7)
(/ 2.0 t)
(if (<= (/ x y) 6.8e-153)
-2.0
(if (<= (/ x y) 6.8e-60)
(/ 2.0 t)
(if (<= (/ x y) 1.9)
-2.0
(if (<= (/ x y) 1.1e+99) (/ 2.0 t) (/ x y))))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.4e+38) {
tmp = x / y;
} else if ((x / y) <= -7e-7) {
tmp = 2.0 / t;
} else if ((x / y) <= 6.8e-153) {
tmp = -2.0;
} else if ((x / y) <= 6.8e-60) {
tmp = 2.0 / t;
} else if ((x / y) <= 1.9) {
tmp = -2.0;
} else if ((x / y) <= 1.1e+99) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-2.4d+38)) then
tmp = x / y
else if ((x / y) <= (-7d-7)) then
tmp = 2.0d0 / t
else if ((x / y) <= 6.8d-153) then
tmp = -2.0d0
else if ((x / y) <= 6.8d-60) then
tmp = 2.0d0 / t
else if ((x / y) <= 1.9d0) then
tmp = -2.0d0
else if ((x / y) <= 1.1d+99) then
tmp = 2.0d0 / t
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.4e+38) {
tmp = x / y;
} else if ((x / y) <= -7e-7) {
tmp = 2.0 / t;
} else if ((x / y) <= 6.8e-153) {
tmp = -2.0;
} else if ((x / y) <= 6.8e-60) {
tmp = 2.0 / t;
} else if ((x / y) <= 1.9) {
tmp = -2.0;
} else if ((x / y) <= 1.1e+99) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2.4e+38: tmp = x / y elif (x / y) <= -7e-7: tmp = 2.0 / t elif (x / y) <= 6.8e-153: tmp = -2.0 elif (x / y) <= 6.8e-60: tmp = 2.0 / t elif (x / y) <= 1.9: tmp = -2.0 elif (x / y) <= 1.1e+99: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2.4e+38) tmp = Float64(x / y); elseif (Float64(x / y) <= -7e-7) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 6.8e-153) tmp = -2.0; elseif (Float64(x / y) <= 6.8e-60) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 1.9) tmp = -2.0; elseif (Float64(x / y) <= 1.1e+99) tmp = Float64(2.0 / t); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2.4e+38) tmp = x / y; elseif ((x / y) <= -7e-7) tmp = 2.0 / t; elseif ((x / y) <= 6.8e-153) tmp = -2.0; elseif ((x / y) <= 6.8e-60) tmp = 2.0 / t; elseif ((x / y) <= 1.9) tmp = -2.0; elseif ((x / y) <= 1.1e+99) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2.4e+38], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -7e-7], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 6.8e-153], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 6.8e-60], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.9], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 1.1e+99], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.4 \cdot 10^{+38}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -7 \cdot 10^{-7}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 6.8 \cdot 10^{-153}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 6.8 \cdot 10^{-60}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.9:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.1 \cdot 10^{+99}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.40000000000000017e38 or 1.09999999999999989e99 < (/.f64 x y) Initial program 84.4%
Taylor expanded in x around inf 84.3%
if -2.40000000000000017e38 < (/.f64 x y) < -6.99999999999999968e-7 or 6.7999999999999997e-153 < (/.f64 x y) < 6.80000000000000013e-60 or 1.8999999999999999 < (/.f64 x y) < 1.09999999999999989e99Initial program 94.8%
Taylor expanded in t around 0 87.8%
associate-*r/87.8%
metadata-eval87.8%
Simplified87.8%
Taylor expanded in z around inf 63.3%
if -6.99999999999999968e-7 < (/.f64 x y) < 6.7999999999999997e-153 or 6.80000000000000013e-60 < (/.f64 x y) < 1.8999999999999999Initial program 89.1%
Taylor expanded in t around inf 48.6%
Taylor expanded in x around 0 47.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))))
(if (<= (/ x y) -3.3e+38)
(/ x y)
(if (<= (/ x y) -2.85e-257)
t_1
(if (<= (/ x y) 1.25e-157)
(+ -2.0 (/ (/ 2.0 z) t))
(if (<= (/ x y) 1.1e+99) t_1 (/ x y)))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double tmp;
if ((x / y) <= -3.3e+38) {
tmp = x / y;
} else if ((x / y) <= -2.85e-257) {
tmp = t_1;
} else if ((x / y) <= 1.25e-157) {
tmp = -2.0 + ((2.0 / z) / t);
} else if ((x / y) <= 1.1e+99) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / t)
if ((x / y) <= (-3.3d+38)) then
tmp = x / y
else if ((x / y) <= (-2.85d-257)) then
tmp = t_1
else if ((x / y) <= 1.25d-157) then
tmp = (-2.0d0) + ((2.0d0 / z) / t)
else if ((x / y) <= 1.1d+99) then
tmp = t_1
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double tmp;
if ((x / y) <= -3.3e+38) {
tmp = x / y;
} else if ((x / y) <= -2.85e-257) {
tmp = t_1;
} else if ((x / y) <= 1.25e-157) {
tmp = -2.0 + ((2.0 / z) / t);
} else if ((x / y) <= 1.1e+99) {
tmp = t_1;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) tmp = 0 if (x / y) <= -3.3e+38: tmp = x / y elif (x / y) <= -2.85e-257: tmp = t_1 elif (x / y) <= 1.25e-157: tmp = -2.0 + ((2.0 / z) / t) elif (x / y) <= 1.1e+99: tmp = t_1 else: tmp = x / y return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -3.3e+38) tmp = Float64(x / y); elseif (Float64(x / y) <= -2.85e-257) tmp = t_1; elseif (Float64(x / y) <= 1.25e-157) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); elseif (Float64(x / y) <= 1.1e+99) tmp = t_1; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / t); tmp = 0.0; if ((x / y) <= -3.3e+38) tmp = x / y; elseif ((x / y) <= -2.85e-257) tmp = t_1; elseif ((x / y) <= 1.25e-157) tmp = -2.0 + ((2.0 / z) / t); elseif ((x / y) <= 1.1e+99) tmp = t_1; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -3.3e+38], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2.85e-257], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 1.25e-157], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.1e+99], t$95$1, N[(x / y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -3.3 \cdot 10^{+38}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -2.85 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 1.25 \cdot 10^{-157}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.1 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.2999999999999999e38 or 1.09999999999999989e99 < (/.f64 x y) Initial program 84.4%
Taylor expanded in x around inf 84.3%
if -3.2999999999999999e38 < (/.f64 x y) < -2.8499999999999999e-257 or 1.25000000000000005e-157 < (/.f64 x y) < 1.09999999999999989e99Initial program 91.0%
Taylor expanded in z around inf 76.5%
div-sub76.5%
sub-neg76.5%
*-inverses76.5%
metadata-eval76.5%
distribute-lft-in76.5%
associate-*r/76.5%
metadata-eval76.5%
metadata-eval76.5%
Simplified76.5%
Taylor expanded in x around 0 71.6%
sub-neg71.6%
associate-*r/71.6%
metadata-eval71.6%
metadata-eval71.6%
Simplified71.6%
if -2.8499999999999999e-257 < (/.f64 x y) < 1.25000000000000005e-157Initial program 90.0%
+-commutative90.0%
remove-double-neg90.0%
distribute-frac-neg90.0%
unsub-neg90.0%
*-commutative90.0%
associate-*r*90.0%
distribute-rgt1-in90.0%
associate-/l*90.0%
fma-neg90.0%
*-commutative90.0%
fma-define90.0%
*-commutative90.0%
distribute-frac-neg90.0%
remove-double-neg90.0%
Simplified90.0%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in z around 0 81.7%
Final simplification79.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)))
(if (<= t -0.22)
(/ (+ x (* -2.0 y)) y)
(if (<= t 1.1e-90)
t_1
(if (<= t 2.8e-70)
(/ x y)
(if (<= t 70000000000.0) t_1 (- (/ x y) 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double tmp;
if (t <= -0.22) {
tmp = (x + (-2.0 * y)) / y;
} else if (t <= 1.1e-90) {
tmp = t_1;
} else if (t <= 2.8e-70) {
tmp = x / y;
} else if (t <= 70000000000.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (2.0d0 + (2.0d0 / z)) / t
if (t <= (-0.22d0)) then
tmp = (x + ((-2.0d0) * y)) / y
else if (t <= 1.1d-90) then
tmp = t_1
else if (t <= 2.8d-70) then
tmp = x / y
else if (t <= 70000000000.0d0) then
tmp = t_1
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 t_1 = (2.0 + (2.0 / z)) / t;
double tmp;
if (t <= -0.22) {
tmp = (x + (-2.0 * y)) / y;
} else if (t <= 1.1e-90) {
tmp = t_1;
} else if (t <= 2.8e-70) {
tmp = x / y;
} else if (t <= 70000000000.0) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) / t tmp = 0 if t <= -0.22: tmp = (x + (-2.0 * y)) / y elif t <= 1.1e-90: tmp = t_1 elif t <= 2.8e-70: tmp = x / y elif t <= 70000000000.0: tmp = t_1 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) / t) tmp = 0.0 if (t <= -0.22) tmp = Float64(Float64(x + Float64(-2.0 * y)) / y); elseif (t <= 1.1e-90) tmp = t_1; elseif (t <= 2.8e-70) tmp = Float64(x / y); elseif (t <= 70000000000.0) tmp = t_1; else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + (2.0 / z)) / t; tmp = 0.0; if (t <= -0.22) tmp = (x + (-2.0 * y)) / y; elseif (t <= 1.1e-90) tmp = t_1; elseif (t <= 2.8e-70) tmp = x / y; elseif (t <= 70000000000.0) tmp = t_1; 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[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -0.22], N[(N[(x + N[(-2.0 * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 1.1e-90], t$95$1, If[LessEqual[t, 2.8e-70], N[(x / y), $MachinePrecision], If[LessEqual[t, 70000000000.0], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
\mathbf{if}\;t \leq -0.22:\\
\;\;\;\;\frac{x + -2 \cdot y}{y}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-70}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;t \leq 70000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if t < -0.220000000000000001Initial program 74.2%
Taylor expanded in t around inf 86.3%
Taylor expanded in y around 0 86.3%
if -0.220000000000000001 < t < 1.09999999999999993e-90 or 2.7999999999999999e-70 < t < 7e10Initial program 98.8%
Taylor expanded in t around 0 82.9%
associate-*r/82.9%
metadata-eval82.9%
Simplified82.9%
if 1.09999999999999993e-90 < t < 2.7999999999999999e-70Initial program 100.0%
Taylor expanded in x around inf 100.0%
if 7e10 < t Initial program 83.8%
Taylor expanded in t around inf 86.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)) (t_2 (- (/ x y) 2.0)))
(if (<= t -0.013)
t_2
(if (<= t 1.1e-90)
t_1
(if (<= t 2.8e-70) (/ x y) (if (<= t 20000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -0.013) {
tmp = t_2;
} else if (t <= 1.1e-90) {
tmp = t_1;
} else if (t <= 2.8e-70) {
tmp = x / y;
} else if (t <= 20000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = (2.0d0 + (2.0d0 / z)) / t
t_2 = (x / y) - 2.0d0
if (t <= (-0.013d0)) then
tmp = t_2
else if (t <= 1.1d-90) then
tmp = t_1
else if (t <= 2.8d-70) then
tmp = x / y
else if (t <= 20000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -0.013) {
tmp = t_2;
} else if (t <= 1.1e-90) {
tmp = t_1;
} else if (t <= 2.8e-70) {
tmp = x / y;
} else if (t <= 20000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) / t t_2 = (x / y) - 2.0 tmp = 0 if t <= -0.013: tmp = t_2 elif t <= 1.1e-90: tmp = t_1 elif t <= 2.8e-70: tmp = x / y elif t <= 20000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) / t) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -0.013) tmp = t_2; elseif (t <= 1.1e-90) tmp = t_1; elseif (t <= 2.8e-70) tmp = Float64(x / y); elseif (t <= 20000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + (2.0 / z)) / t; t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -0.013) tmp = t_2; elseif (t <= 1.1e-90) tmp = t_1; elseif (t <= 2.8e-70) tmp = x / y; elseif (t <= 20000000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -0.013], t$95$2, If[LessEqual[t, 1.1e-90], t$95$1, If[LessEqual[t, 2.8e-70], N[(x / y), $MachinePrecision], If[LessEqual[t, 20000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -0.013:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-70}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;t \leq 20000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -0.0129999999999999994 or 2e10 < t Initial program 78.9%
Taylor expanded in t around inf 86.2%
if -0.0129999999999999994 < t < 1.09999999999999993e-90 or 2.7999999999999999e-70 < t < 2e10Initial program 98.8%
Taylor expanded in t around 0 82.9%
associate-*r/82.9%
metadata-eval82.9%
Simplified82.9%
if 1.09999999999999993e-90 < t < 2.7999999999999999e-70Initial program 100.0%
Taylor expanded in x around inf 100.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+52) (not (<= (/ x y) 4e+113))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+52) || !((x / y) <= 4e+113)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1d+52)) .or. (.not. ((x / y) <= 4d+113))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+52) || !((x / y) <= 4e+113)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+52) or not ((x / y) <= 4e+113): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+52) || !(Float64(x / y) <= 4e+113)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+52) || ~(((x / y) <= 4e+113))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+52], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e+113]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+52} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+113}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.9999999999999999e51 or 4e113 < (/.f64 x y) Initial program 85.5%
Taylor expanded in z around inf 91.5%
div-sub91.5%
sub-neg91.5%
*-inverses91.5%
metadata-eval91.5%
distribute-lft-in91.5%
associate-*r/91.5%
metadata-eval91.5%
metadata-eval91.5%
Simplified91.5%
if -9.9999999999999999e51 < (/.f64 x y) < 4e113Initial program 89.7%
+-commutative89.7%
remove-double-neg89.7%
distribute-frac-neg89.7%
unsub-neg89.7%
*-commutative89.7%
associate-*r*89.7%
distribute-rgt1-in89.7%
associate-/l*89.6%
fma-neg89.6%
*-commutative89.6%
fma-define89.6%
*-commutative89.6%
distribute-frac-neg89.6%
remove-double-neg89.6%
Simplified89.6%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 95.2%
Final simplification93.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+92) (not (<= (/ x y) 4e+113))) (/ x y) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+92) || !((x / y) <= 4e+113)) {
tmp = x / y;
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-2d+92)) .or. (.not. ((x / y) <= 4d+113))) then
tmp = x / y
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+92) || !((x / y) <= 4e+113)) {
tmp = x / y;
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+92) or not ((x / y) <= 4e+113): tmp = x / y else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+92) || !(Float64(x / y) <= 4e+113)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e+92) || ~(((x / y) <= 4e+113))) tmp = x / y; else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+92], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e+113]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+92} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+113}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.0000000000000001e92 or 4e113 < (/.f64 x y) Initial program 85.4%
Taylor expanded in x around inf 89.4%
if -2.0000000000000001e92 < (/.f64 x y) < 4e113Initial program 89.6%
+-commutative89.6%
remove-double-neg89.6%
distribute-frac-neg89.6%
unsub-neg89.6%
*-commutative89.6%
associate-*r*89.6%
distribute-rgt1-in89.6%
associate-/l*89.5%
fma-neg89.5%
*-commutative89.5%
fma-define89.5%
*-commutative89.5%
distribute-frac-neg89.5%
remove-double-neg89.5%
Simplified89.5%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 93.2%
Final simplification91.9%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -1e+52)
(+ (/ x y) (+ -2.0 (/ 2.0 t)))
(if (<= (/ x y) 2e+99)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(+ (/ x y) (/ (/ 2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1e+52) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else if ((x / y) <= 2e+99) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-1d+52)) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else if ((x / y) <= 2d+99) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1e+52) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else if ((x / y) <= 2e+99) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1e+52: tmp = (x / y) + (-2.0 + (2.0 / t)) elif (x / y) <= 2e+99: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1e+52) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); elseif (Float64(x / y) <= 2e+99) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); 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 ((x / y) <= -1e+52) tmp = (x / y) + (-2.0 + (2.0 / t)); elseif ((x / y) <= 2e+99) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1e+52], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e+99], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+99}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.9999999999999999e51Initial program 89.0%
Taylor expanded in z around inf 95.7%
div-sub95.7%
sub-neg95.7%
*-inverses95.7%
metadata-eval95.7%
distribute-lft-in95.7%
associate-*r/95.7%
metadata-eval95.7%
metadata-eval95.7%
Simplified95.7%
if -9.9999999999999999e51 < (/.f64 x y) < 1.9999999999999999e99Initial program 90.1%
+-commutative90.1%
remove-double-neg90.1%
distribute-frac-neg90.1%
unsub-neg90.1%
*-commutative90.1%
associate-*r*90.1%
distribute-rgt1-in90.1%
associate-/l*90.0%
fma-neg90.0%
*-commutative90.0%
fma-define90.0%
*-commutative90.0%
distribute-frac-neg90.0%
remove-double-neg90.0%
Simplified90.0%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 96.4%
if 1.9999999999999999e99 < (/.f64 x y) Initial program 81.8%
Taylor expanded in z around 0 100.0%
associate-/r*100.0%
Simplified100.0%
Final simplification97.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3.8e+39) (not (<= (/ x y) 1.1e+99))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3.8e+39) || !((x / y) <= 1.1e+99)) {
tmp = x / y;
} else {
tmp = -2.0 + (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.8d+39)) .or. (.not. ((x / y) <= 1.1d+99))) then
tmp = x / y
else
tmp = (-2.0d0) + (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.8e+39) || !((x / y) <= 1.1e+99)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3.8e+39) or not ((x / y) <= 1.1e+99): tmp = x / y else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -3.8e+39) || !(Float64(x / y) <= 1.1e+99)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -3.8e+39) || ~(((x / y) <= 1.1e+99))) tmp = x / y; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -3.8e+39], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.1e+99]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3.8 \cdot 10^{+39} \lor \neg \left(\frac{x}{y} \leq 1.1 \cdot 10^{+99}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.7999999999999998e39 or 1.09999999999999989e99 < (/.f64 x y) Initial program 84.4%
Taylor expanded in x around inf 84.3%
if -3.7999999999999998e39 < (/.f64 x y) < 1.09999999999999989e99Initial program 90.6%
Taylor expanded in z around inf 68.9%
div-sub68.9%
sub-neg68.9%
*-inverses68.9%
metadata-eval68.9%
distribute-lft-in68.9%
associate-*r/68.9%
metadata-eval68.9%
metadata-eval68.9%
Simplified68.9%
Taylor expanded in x around 0 66.0%
sub-neg66.0%
associate-*r/66.0%
metadata-eval66.0%
metadata-eval66.0%
Simplified66.0%
Final simplification73.4%
(FPCore (x y z t) :precision binary64 (if (<= t -300.0) -2.0 (if (<= t 19000000000.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -300.0) {
tmp = -2.0;
} else if (t <= 19000000000.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 <= (-300.0d0)) then
tmp = -2.0d0
else if (t <= 19000000000.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 <= -300.0) {
tmp = -2.0;
} else if (t <= 19000000000.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -300.0: tmp = -2.0 elif t <= 19000000000.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -300.0) tmp = -2.0; elseif (t <= 19000000000.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 <= -300.0) tmp = -2.0; elseif (t <= 19000000000.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -300.0], -2.0, If[LessEqual[t, 19000000000.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -300:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 19000000000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -300 or 1.9e10 < t Initial program 78.8%
Taylor expanded in t around inf 86.1%
Taylor expanded in x around 0 40.5%
if -300 < t < 1.9e10Initial program 98.9%
Taylor expanded in t around 0 78.8%
associate-*r/78.8%
metadata-eval78.8%
Simplified78.8%
Taylor expanded in z around inf 43.8%
(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 88.1%
Taylor expanded in t around inf 57.7%
Taylor expanded in x around 0 23.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 2024097
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))