
(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 (+ (/ x y) (+ (/ 2.0 (* t z)) (+ (/ 2.0 t) -2.0))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / (t * z)) + ((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 = (x / y) + ((2.0d0 / (t * z)) + ((2.0d0 / t) + (-2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / (t * z)) + ((2.0 / t) + -2.0));
}
def code(x, y, z, t): return (x / y) + ((2.0 / (t * z)) + ((2.0 / t) + -2.0))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 / Float64(t * z)) + Float64(Float64(2.0 / t) + -2.0))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 / (t * z)) + ((2.0 / t) + -2.0)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2}{t \cdot z} + \left(\frac{2}{t} + -2\right)\right)
\end{array}
Initial program 88.9%
Taylor expanded in t around inf 99.5%
sub-neg99.5%
metadata-eval99.5%
associate-*r/99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= (/ x y) -2.0)
t_1
(if (<= (/ x y) 1.12e-27)
(- (/ 2.0 t) 2.0)
(if (<= (/ x y) 9.5e+105) (/ 2.0 (* t z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -2.0) {
tmp = t_1;
} else if ((x / y) <= 1.12e-27) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 9.5e+105) {
tmp = 2.0 / (t * z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (2.0d0 / t)
if ((x / y) <= (-2.0d0)) then
tmp = t_1
else if ((x / y) <= 1.12d-27) then
tmp = (2.0d0 / t) - 2.0d0
else if ((x / y) <= 9.5d+105) then
tmp = 2.0d0 / (t * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -2.0) {
tmp = t_1;
} else if ((x / y) <= 1.12e-27) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 9.5e+105) {
tmp = 2.0 / (t * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if (x / y) <= -2.0: tmp = t_1 elif (x / y) <= 1.12e-27: tmp = (2.0 / t) - 2.0 elif (x / y) <= 9.5e+105: tmp = 2.0 / (t * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -2.0) tmp = t_1; elseif (Float64(x / y) <= 1.12e-27) tmp = Float64(Float64(2.0 / t) - 2.0); elseif (Float64(x / y) <= 9.5e+105) tmp = Float64(2.0 / Float64(t * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if ((x / y) <= -2.0) tmp = t_1; elseif ((x / y) <= 1.12e-27) tmp = (2.0 / t) - 2.0; elseif ((x / y) <= 9.5e+105) tmp = 2.0 / (t * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 1.12e-27], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 9.5e+105], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -2:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 1.12 \cdot 10^{-27}:\\
\;\;\;\;\frac{2}{t} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 9.5 \cdot 10^{+105}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -2 or 9.4999999999999995e105 < (/.f64 x y) Initial program 84.3%
Taylor expanded in t around inf 98.9%
sub-neg98.9%
metadata-eval98.9%
associate-*r/98.9%
+-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
associate-*r/98.9%
metadata-eval98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around inf 87.8%
sub-neg87.8%
associate-*r/87.8%
metadata-eval87.8%
+-commutative87.8%
metadata-eval87.8%
associate-+r+87.8%
+-commutative87.8%
metadata-eval87.8%
sub-neg87.8%
associate-+l-87.8%
Simplified87.8%
Taylor expanded in x around inf 87.3%
neg-mul-187.3%
distribute-neg-frac287.3%
Simplified87.3%
sub-neg87.3%
distribute-frac-neg287.3%
remove-double-neg87.3%
+-commutative87.3%
Applied egg-rr87.3%
if -2 < (/.f64 x y) < 1.1199999999999999e-27Initial program 90.5%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 64.7%
sub-neg64.7%
associate-*r/64.7%
metadata-eval64.7%
+-commutative64.7%
metadata-eval64.7%
associate-+r+64.7%
+-commutative64.7%
metadata-eval64.7%
sub-neg64.7%
associate-+l-64.7%
Simplified64.7%
Taylor expanded in x around 0 64.6%
if 1.1199999999999999e-27 < (/.f64 x y) < 9.4999999999999995e105Initial program 96.5%
Taylor expanded in z around 0 67.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2000000.0) (not (<= (/ x y) 1e-15))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* t z))) (- -2.0 (* (/ 2.0 t) (+ -1.0 (/ -1.0 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2000000.0) || !((x / y) <= 1e-15)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else {
tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / 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) <= (-2000000.0d0)) .or. (.not. ((x / y) <= 1d-15))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (t * z))
else
tmp = (-2.0d0) - ((2.0d0 / t) * ((-1.0d0) + ((-1.0d0) / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2000000.0) || !((x / y) <= 1e-15)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else {
tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2000000.0) or not ((x / y) <= 1e-15): tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)) else: tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2000000.0) || !(Float64(x / y) <= 1e-15)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(t * z))); else tmp = Float64(-2.0 - Float64(Float64(2.0 / t) * Float64(-1.0 + Float64(-1.0 / z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2000000.0) || ~(((x / y) <= 1e-15))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)); else tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e-15]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 - N[(N[(2.0 / t), $MachinePrecision] * N[(-1.0 + N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2000000 \lor \neg \left(\frac{x}{y} \leq 10^{-15}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{2}{t} \cdot \left(-1 + \frac{-1}{z}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -2e6 or 1.0000000000000001e-15 < (/.f64 x y) Initial program 86.7%
Taylor expanded in t around 0 98.6%
if -2e6 < (/.f64 x y) < 1.0000000000000001e-15Initial program 90.9%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.7%
sub-neg99.7%
associate-*r/99.7%
metadata-eval99.7%
associate-*r/99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
remove-double-neg99.7%
distribute-frac-neg299.7%
unsub-neg99.7%
distribute-frac-neg299.7%
associate-/r*99.8%
distribute-frac-neg99.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 99.7%
sub-neg99.7%
associate-*r/99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
associate-/r*99.8%
*-rgt-identity99.8%
associate-*r/99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
Simplified99.8%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -5e+44)
(/ x y)
(if (<= (/ x y) 5.2e-29)
(- (/ 2.0 t) 2.0)
(if (<= (/ x y) 1.45e+106) (/ 2.0 (* t z)) (- (/ x y) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+44) {
tmp = x / y;
} else if ((x / y) <= 5.2e-29) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 1.45e+106) {
tmp = 2.0 / (t * z);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-5d+44)) then
tmp = x / y
else if ((x / y) <= 5.2d-29) then
tmp = (2.0d0 / t) - 2.0d0
else if ((x / y) <= 1.45d+106) then
tmp = 2.0d0 / (t * z)
else
tmp = (x / y) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+44) {
tmp = x / y;
} else if ((x / y) <= 5.2e-29) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 1.45e+106) {
tmp = 2.0 / (t * z);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+44: tmp = x / y elif (x / y) <= 5.2e-29: tmp = (2.0 / t) - 2.0 elif (x / y) <= 1.45e+106: tmp = 2.0 / (t * z) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+44) tmp = Float64(x / y); elseif (Float64(x / y) <= 5.2e-29) tmp = Float64(Float64(2.0 / t) - 2.0); elseif (Float64(x / y) <= 1.45e+106) 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) tmp = 0.0; if ((x / y) <= -5e+44) tmp = x / y; elseif ((x / y) <= 5.2e-29) tmp = (2.0 / t) - 2.0; elseif ((x / y) <= 1.45e+106) tmp = 2.0 / (t * z); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+44], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5.2e-29], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.45e+106], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+44}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{2}{t} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.45 \cdot 10^{+106}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -4.9999999999999996e44Initial program 81.2%
Taylor expanded in x around inf 73.5%
if -4.9999999999999996e44 < (/.f64 x y) < 5.2000000000000004e-29Initial program 91.0%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 64.3%
sub-neg64.3%
associate-*r/64.3%
metadata-eval64.3%
+-commutative64.3%
metadata-eval64.3%
associate-+r+64.3%
+-commutative64.3%
metadata-eval64.3%
sub-neg64.3%
associate-+l-64.3%
Simplified64.3%
Taylor expanded in x around 0 63.0%
if 5.2000000000000004e-29 < (/.f64 x y) < 1.4500000000000001e106Initial program 96.5%
Taylor expanded in z around 0 67.6%
if 1.4500000000000001e106 < (/.f64 x y) Initial program 86.1%
Taylor expanded in t around inf 89.4%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -1e+47)
(+ (/ x y) (/ 2.0 t))
(if (<= (/ x y) 5e+43)
(- -2.0 (* (/ 2.0 t) (+ -1.0 (/ -1.0 z))))
(/ (+ x (* (/ 2.0 t) (/ y z))) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1e+47) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 5e+43) {
tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z)));
} else {
tmp = (x + ((2.0 / t) * (y / z))) / 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) <= (-1d+47)) then
tmp = (x / y) + (2.0d0 / t)
else if ((x / y) <= 5d+43) then
tmp = (-2.0d0) - ((2.0d0 / t) * ((-1.0d0) + ((-1.0d0) / z)))
else
tmp = (x + ((2.0d0 / t) * (y / z))) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1e+47) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 5e+43) {
tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z)));
} else {
tmp = (x + ((2.0 / t) * (y / z))) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1e+47: tmp = (x / y) + (2.0 / t) elif (x / y) <= 5e+43: tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z))) else: tmp = (x + ((2.0 / t) * (y / z))) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1e+47) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (Float64(x / y) <= 5e+43) tmp = Float64(-2.0 - Float64(Float64(2.0 / t) * Float64(-1.0 + Float64(-1.0 / z)))); else tmp = Float64(Float64(x + Float64(Float64(2.0 / t) * Float64(y / z))) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1e+47) tmp = (x / y) + (2.0 / t); elseif ((x / y) <= 5e+43) tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z))); else tmp = (x + ((2.0 / t) * (y / z))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1e+47], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e+43], N[(-2.0 - N[(N[(2.0 / t), $MachinePrecision] * N[(-1.0 + N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(2.0 / t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+47}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{+43}:\\
\;\;\;\;-2 - \frac{2}{t} \cdot \left(-1 + \frac{-1}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{2}{t} \cdot \frac{y}{z}}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e47Initial program 81.2%
Taylor expanded in t around inf 98.1%
sub-neg98.1%
metadata-eval98.1%
associate-*r/98.1%
+-commutative98.1%
metadata-eval98.1%
associate-+l+98.1%
associate-*r/98.1%
metadata-eval98.1%
associate-*r/98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in z around inf 87.1%
sub-neg87.1%
associate-*r/87.1%
metadata-eval87.1%
+-commutative87.1%
metadata-eval87.1%
associate-+r+87.1%
+-commutative87.1%
metadata-eval87.1%
sub-neg87.1%
associate-+l-87.1%
Simplified87.1%
Taylor expanded in x around inf 87.1%
neg-mul-187.1%
distribute-neg-frac287.1%
Simplified87.1%
sub-neg87.1%
distribute-frac-neg287.1%
remove-double-neg87.1%
+-commutative87.1%
Applied egg-rr87.1%
if -1e47 < (/.f64 x y) < 5.0000000000000004e43Initial program 92.2%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.0%
sub-neg98.0%
associate-*r/98.0%
metadata-eval98.0%
associate-*r/98.0%
metadata-eval98.0%
+-commutative98.0%
metadata-eval98.0%
associate-+r+98.0%
+-commutative98.0%
associate-+l+98.0%
remove-double-neg98.0%
distribute-frac-neg298.0%
unsub-neg98.0%
distribute-frac-neg298.0%
associate-/r*98.0%
distribute-frac-neg98.0%
distribute-neg-frac98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in t around inf 98.0%
sub-neg98.0%
associate-*r/98.0%
metadata-eval98.0%
+-commutative98.0%
metadata-eval98.0%
associate-+r+98.0%
+-commutative98.0%
associate-+r+98.0%
+-commutative98.0%
associate-+l+98.0%
associate-/r*98.0%
*-rgt-identity98.0%
associate-*r/98.1%
*-rgt-identity98.1%
distribute-lft-out98.1%
Simplified98.1%
if 5.0000000000000004e43 < (/.f64 x y) Initial program 86.6%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around 0 95.8%
associate-*r/95.8%
times-frac95.8%
Simplified95.8%
Final simplification95.4%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -1e+47)
(+ (/ x y) (/ 2.0 t))
(if (<= (/ x y) 5e+103)
(- -2.0 (* (/ 2.0 t) (+ -1.0 (/ -1.0 z))))
(/ (+ x (* 2.0 (/ y t))) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1e+47) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 5e+103) {
tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z)));
} else {
tmp = (x + (2.0 * (y / t))) / 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) <= (-1d+47)) then
tmp = (x / y) + (2.0d0 / t)
else if ((x / y) <= 5d+103) then
tmp = (-2.0d0) - ((2.0d0 / t) * ((-1.0d0) + ((-1.0d0) / z)))
else
tmp = (x + (2.0d0 * (y / t))) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1e+47) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 5e+103) {
tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z)));
} else {
tmp = (x + (2.0 * (y / t))) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1e+47: tmp = (x / y) + (2.0 / t) elif (x / y) <= 5e+103: tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z))) else: tmp = (x + (2.0 * (y / t))) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1e+47) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (Float64(x / y) <= 5e+103) tmp = Float64(-2.0 - Float64(Float64(2.0 / t) * Float64(-1.0 + Float64(-1.0 / z)))); else tmp = Float64(Float64(x + Float64(2.0 * Float64(y / t))) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1e+47) tmp = (x / y) + (2.0 / t); elseif ((x / y) <= 5e+103) tmp = -2.0 - ((2.0 / t) * (-1.0 + (-1.0 / z))); else tmp = (x + (2.0 * (y / t))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1e+47], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e+103], N[(-2.0 - N[(N[(2.0 / t), $MachinePrecision] * N[(-1.0 + N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(2.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+47}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{+103}:\\
\;\;\;\;-2 - \frac{2}{t} \cdot \left(-1 + \frac{-1}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 2 \cdot \frac{y}{t}}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e47Initial program 81.2%
Taylor expanded in t around inf 98.1%
sub-neg98.1%
metadata-eval98.1%
associate-*r/98.1%
+-commutative98.1%
metadata-eval98.1%
associate-+l+98.1%
associate-*r/98.1%
metadata-eval98.1%
associate-*r/98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in z around inf 87.1%
sub-neg87.1%
associate-*r/87.1%
metadata-eval87.1%
+-commutative87.1%
metadata-eval87.1%
associate-+r+87.1%
+-commutative87.1%
metadata-eval87.1%
sub-neg87.1%
associate-+l-87.1%
Simplified87.1%
Taylor expanded in x around inf 87.1%
neg-mul-187.1%
distribute-neg-frac287.1%
Simplified87.1%
sub-neg87.1%
distribute-frac-neg287.1%
remove-double-neg87.1%
+-commutative87.1%
Applied egg-rr87.1%
if -1e47 < (/.f64 x y) < 5e103Initial program 92.0%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 95.8%
sub-neg95.8%
associate-*r/95.8%
metadata-eval95.8%
associate-*r/95.8%
metadata-eval95.8%
+-commutative95.8%
metadata-eval95.8%
associate-+r+95.8%
+-commutative95.8%
associate-+l+95.8%
remove-double-neg95.8%
distribute-frac-neg295.8%
unsub-neg95.8%
distribute-frac-neg295.8%
associate-/r*95.8%
distribute-frac-neg95.8%
distribute-neg-frac95.8%
metadata-eval95.8%
Simplified95.8%
Taylor expanded in t around inf 95.8%
sub-neg95.8%
associate-*r/95.8%
metadata-eval95.8%
+-commutative95.8%
metadata-eval95.8%
associate-+r+95.8%
+-commutative95.8%
associate-+r+95.8%
+-commutative95.8%
associate-+l+95.8%
associate-/r*95.8%
*-rgt-identity95.8%
associate-*r/95.8%
*-rgt-identity95.8%
distribute-lft-out95.8%
Simplified95.8%
if 5e103 < (/.f64 x y) Initial program 86.1%
Taylor expanded in z around inf 94.7%
div-sub94.7%
sub-neg94.7%
*-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t around 0 76.3%
Taylor expanded in x around inf 73.5%
Taylor expanded in y around 0 97.2%
Final simplification94.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.8e-31) (not (<= t 5.2e-62))) (+ (/ 2.0 t) (- (/ 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.8e-31) || !(t <= 5.2e-62)) {
tmp = (2.0 / t) + ((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.8d-31)) .or. (.not. (t <= 5.2d-62))) then
tmp = (2.0d0 / t) + ((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.8e-31) || !(t <= 5.2e-62)) {
tmp = (2.0 / t) + ((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.8e-31) or not (t <= 5.2e-62): tmp = (2.0 / t) + ((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.8e-31) || !(t <= 5.2e-62)) tmp = Float64(Float64(2.0 / t) + 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.8e-31) || ~((t <= 5.2e-62))) tmp = (2.0 / t) + ((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.8e-31], N[Not[LessEqual[t, 5.2e-62]], $MachinePrecision]], N[(N[(2.0 / t), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-31} \lor \neg \left(t \leq 5.2 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{2}{t} + \left(\frac{x}{y} - 2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -2.7999999999999999e-31 or 5.1999999999999999e-62 < t Initial program 81.9%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 79.2%
sub-neg79.2%
associate-*r/79.2%
metadata-eval79.2%
+-commutative79.2%
metadata-eval79.2%
associate-+r+79.2%
+-commutative79.2%
metadata-eval79.2%
sub-neg79.2%
associate-+l-79.2%
Simplified79.2%
if -2.7999999999999999e-31 < t < 5.1999999999999999e-62Initial program 98.8%
Taylor expanded in t around 0 85.0%
associate-*r/85.0%
metadata-eval85.0%
Simplified85.0%
Final simplification81.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.9e+43) (not (<= (/ x y) 2.4e+18))) (/ x y) (- (/ 2.0 t) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.9e+43) || !((x / y) <= 2.4e+18)) {
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) <= (-2.9d+43)) .or. (.not. ((x / y) <= 2.4d+18))) 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) <= -2.9e+43) || !((x / y) <= 2.4e+18)) {
tmp = x / y;
} else {
tmp = (2.0 / t) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2.9e+43) or not ((x / y) <= 2.4e+18): 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) <= -2.9e+43) || !(Float64(x / y) <= 2.4e+18)) 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) <= -2.9e+43) || ~(((x / y) <= 2.4e+18))) 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], -2.9e+43], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.4e+18]], $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 -2.9 \cdot 10^{+43} \lor \neg \left(\frac{x}{y} \leq 2.4 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -2.9000000000000002e43 or 2.4e18 < (/.f64 x y) Initial program 84.4%
Taylor expanded in x around inf 74.2%
if -2.9000000000000002e43 < (/.f64 x y) < 2.4e18Initial program 91.9%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 60.6%
sub-neg60.6%
associate-*r/60.6%
metadata-eval60.6%
+-commutative60.6%
metadata-eval60.6%
associate-+r+60.6%
+-commutative60.6%
metadata-eval60.6%
sub-neg60.6%
associate-+l-60.6%
Simplified60.6%
Taylor expanded in x around 0 59.4%
Final simplification65.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.9e-25) (not (<= t 52000000.0))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.9e-25) || !(t <= 52000000.0)) {
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 <= (-5.9d-25)) .or. (.not. (t <= 52000000.0d0))) 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 <= -5.9e-25) || !(t <= 52000000.0)) {
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 <= -5.9e-25) or not (t <= 52000000.0): 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 <= -5.9e-25) || !(t <= 52000000.0)) 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 <= -5.9e-25) || ~((t <= 52000000.0))) 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, -5.9e-25], N[Not[LessEqual[t, 52000000.0]], $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 -5.9 \cdot 10^{-25} \lor \neg \left(t \leq 52000000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -5.8999999999999998e-25 or 5.2e7 < t Initial program 80.7%
Taylor expanded in t around inf 79.1%
if -5.8999999999999998e-25 < t < 5.2e7Initial program 98.9%
Taylor expanded in t around 0 82.3%
associate-*r/82.3%
metadata-eval82.3%
Simplified82.3%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -8.2e-11) (not (<= (/ x y) 1.36e-14))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -8.2e-11) || !((x / y) <= 1.36e-14)) {
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) <= (-8.2d-11)) .or. (.not. ((x / y) <= 1.36d-14))) 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) <= -8.2e-11) || !((x / y) <= 1.36e-14)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -8.2e-11) or not ((x / y) <= 1.36e-14): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -8.2e-11) || !(Float64(x / y) <= 1.36e-14)) 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) <= -8.2e-11) || ~(((x / y) <= 1.36e-14))) tmp = x / y; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -8.2e-11], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.36e-14]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -8.2 \cdot 10^{-11} \lor \neg \left(\frac{x}{y} \leq 1.36 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -8.2000000000000001e-11 or 1.36e-14 < (/.f64 x y) Initial program 86.7%
Taylor expanded in x around inf 64.7%
if -8.2000000000000001e-11 < (/.f64 x y) < 1.36e-14Initial program 90.9%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.7%
sub-neg99.7%
associate-*r/99.7%
metadata-eval99.7%
associate-*r/99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
remove-double-neg99.7%
distribute-frac-neg299.7%
unsub-neg99.7%
distribute-frac-neg299.7%
associate-/r*99.8%
distribute-frac-neg99.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 39.3%
Final simplification51.3%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 310.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 310.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.0d0)) then
tmp = -2.0d0
else if (t <= 310.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.0) {
tmp = -2.0;
} else if (t <= 310.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 310.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 310.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.0) tmp = -2.0; elseif (t <= 310.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 310.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 310:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 310 < t Initial program 79.2%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 60.7%
sub-neg60.7%
associate-*r/60.7%
metadata-eval60.7%
associate-*r/60.7%
metadata-eval60.7%
+-commutative60.7%
metadata-eval60.7%
associate-+r+60.7%
+-commutative60.7%
associate-+l+60.7%
remove-double-neg60.7%
distribute-frac-neg260.7%
unsub-neg60.7%
distribute-frac-neg260.7%
associate-/r*60.7%
distribute-frac-neg60.7%
distribute-neg-frac60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in t around inf 40.8%
if -1 < t < 310Initial program 98.9%
Taylor expanded in z around inf 59.1%
div-sub59.1%
sub-neg59.1%
*-inverses59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in t around 0 36.5%
(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.9%
Taylor expanded in t around inf 99.5%
sub-neg99.5%
metadata-eval99.5%
associate-*r/99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 70.0%
sub-neg70.0%
associate-*r/70.0%
metadata-eval70.0%
associate-*r/70.0%
metadata-eval70.0%
+-commutative70.0%
metadata-eval70.0%
associate-+r+70.0%
+-commutative70.0%
associate-+l+70.0%
remove-double-neg70.0%
distribute-frac-neg270.0%
unsub-neg70.0%
distribute-frac-neg270.0%
associate-/r*70.0%
distribute-frac-neg70.0%
distribute-neg-frac70.0%
metadata-eval70.0%
Simplified70.0%
Taylor expanded in t around inf 22.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 2024186
(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))))