
(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 13 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 (* (/ 1.0 t) (+ 2.0 (/ 2.0 z))))))
double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / 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) + ((1.0d0 / t) * (2.0d0 + (2.0d0 / z))))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / z))));
}
def code(x, y, z, t): return (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / z))))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(1.0 / t) * Float64(2.0 + Float64(2.0 / z))))) end
function tmp = code(x, y, z, t) tmp = (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / z)))); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(1.0 / t), $MachinePrecision] * N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(-2 + \frac{1}{t} \cdot \left(2 + \frac{2}{z}\right)\right)
\end{array}
Initial program 83.8%
Taylor expanded in z around inf 98.7%
+-commutative98.7%
associate-*r/98.7%
metadata-eval98.7%
*-commutative98.7%
div-sub98.7%
sub-neg98.7%
*-inverses98.7%
metadata-eval98.7%
distribute-lft-in98.7%
metadata-eval98.7%
associate-+l+98.7%
+-commutative98.7%
*-commutative98.7%
+-commutative98.7%
associate-/l/98.7%
metadata-eval98.7%
associate-*r/98.7%
*-rgt-identity98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -6.3)
t_1
(if (<= t 4e-18)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (or (<= t 1.75e+25) (not (<= t 1.6e+61)))
t_1
(- -2.0 (/ (/ -2.0 z) t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -6.3) {
tmp = t_1;
} else if (t <= 4e-18) {
tmp = (2.0 + (2.0 / z)) / t;
} else if ((t <= 1.75e+25) || !(t <= 1.6e+61)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (t <= (-6.3d0)) then
tmp = t_1
else if (t <= 4d-18) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if ((t <= 1.75d+25) .or. (.not. (t <= 1.6d+61))) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (t <= -6.3) {
tmp = t_1;
} else if (t <= 4e-18) {
tmp = (2.0 + (2.0 / z)) / t;
} else if ((t <= 1.75e+25) || !(t <= 1.6e+61)) {
tmp = t_1;
} else {
tmp = -2.0 - ((-2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -6.3: tmp = t_1 elif t <= 4e-18: tmp = (2.0 + (2.0 / z)) / t elif (t <= 1.75e+25) or not (t <= 1.6e+61): tmp = t_1 else: tmp = -2.0 - ((-2.0 / z) / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -6.3) tmp = t_1; elseif (t <= 4e-18) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif ((t <= 1.75e+25) || !(t <= 1.6e+61)) tmp = t_1; else tmp = Float64(-2.0 - Float64(Float64(-2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -6.3) tmp = t_1; elseif (t <= 4e-18) tmp = (2.0 + (2.0 / z)) / t; elseif ((t <= 1.75e+25) || ~((t <= 1.6e+61))) tmp = t_1; else tmp = -2.0 - ((-2.0 / z) / t); 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, -6.3], t$95$1, If[LessEqual[t, 4e-18], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[t, 1.75e+25], N[Not[LessEqual[t, 1.6e+61]], $MachinePrecision]], t$95$1, N[(-2.0 - N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -6.3:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-18}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+25} \lor \neg \left(t \leq 1.6 \cdot 10^{+61}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{\frac{-2}{z}}{t}\\
\end{array}
\end{array}
if t < -6.29999999999999982 or 4.0000000000000003e-18 < t < 1.75e25 or 1.5999999999999999e61 < t Initial program 69.4%
Taylor expanded in t around inf 85.1%
if -6.29999999999999982 < t < 4.0000000000000003e-18Initial program 97.4%
Taylor expanded in t around 0 77.2%
associate-*r/77.2%
metadata-eval77.2%
Simplified77.2%
if 1.75e25 < t < 1.5999999999999999e61Initial program 85.0%
Taylor expanded in z around inf 99.3%
+-commutative99.3%
associate-*r/99.3%
metadata-eval99.3%
*-commutative99.3%
div-sub99.3%
sub-neg99.3%
*-inverses99.3%
metadata-eval99.3%
distribute-lft-in99.3%
metadata-eval99.3%
associate-+l+99.3%
+-commutative99.3%
*-commutative99.3%
+-commutative99.3%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 99.3%
associate--l+99.3%
associate-*r/99.3%
metadata-eval99.3%
associate-*r/99.3%
metadata-eval99.3%
sub-neg99.3%
*-commutative99.3%
associate-/r*99.8%
*-rgt-identity99.8%
associate-*r/99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
associate-*r/99.8%
distribute-rgt-in99.8%
associate-*l/99.8%
*-lft-identity99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-neg-frac299.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Final simplification81.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -6.2e-72)
t_1
(if (<= z 1.9e-92)
(/ 2.0 (* t z))
(if (or (<= z 10500.0) (not (<= z 1.25e+36)))
t_1
(- -2.0 (/ -2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -6.2e-72) {
tmp = t_1;
} else if (z <= 1.9e-92) {
tmp = 2.0 / (t * z);
} else if ((z <= 10500.0) || !(z <= 1.25e+36)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-6.2d-72)) then
tmp = t_1
else if (z <= 1.9d-92) then
tmp = 2.0d0 / (t * z)
else if ((z <= 10500.0d0) .or. (.not. (z <= 1.25d+36))) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (z <= -6.2e-72) {
tmp = t_1;
} else if (z <= 1.9e-92) {
tmp = 2.0 / (t * z);
} else if ((z <= 10500.0) || !(z <= 1.25e+36)) {
tmp = t_1;
} else {
tmp = -2.0 - (-2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -6.2e-72: tmp = t_1 elif z <= 1.9e-92: tmp = 2.0 / (t * z) elif (z <= 10500.0) or not (z <= 1.25e+36): tmp = t_1 else: tmp = -2.0 - (-2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -6.2e-72) tmp = t_1; elseif (z <= 1.9e-92) tmp = Float64(2.0 / Float64(t * z)); elseif ((z <= 10500.0) || !(z <= 1.25e+36)) tmp = t_1; else tmp = Float64(-2.0 - Float64(-2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -6.2e-72) tmp = t_1; elseif (z <= 1.9e-92) tmp = 2.0 / (t * z); elseif ((z <= 10500.0) || ~((z <= 1.25e+36))) tmp = t_1; else tmp = -2.0 - (-2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -6.2e-72], t$95$1, If[LessEqual[z, 1.9e-92], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 10500.0], N[Not[LessEqual[z, 1.25e+36]], $MachinePrecision]], t$95$1, N[(-2.0 - N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-92}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 10500 \lor \neg \left(z \leq 1.25 \cdot 10^{+36}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{-2}{t}\\
\end{array}
\end{array}
if z < -6.1999999999999996e-72 or 1.9e-92 < z < 10500 or 1.24999999999999994e36 < z Initial program 73.3%
Taylor expanded in t around inf 70.6%
if -6.1999999999999996e-72 < z < 1.9e-92Initial program 97.9%
Taylor expanded in z around inf 97.8%
+-commutative97.8%
associate-*r/97.8%
metadata-eval97.8%
*-commutative97.8%
div-sub97.8%
sub-neg97.8%
*-inverses97.8%
metadata-eval97.8%
distribute-lft-in97.8%
metadata-eval97.8%
associate-+l+97.8%
+-commutative97.8%
*-commutative97.8%
+-commutative97.8%
associate-/l/97.8%
metadata-eval97.8%
associate-*r/97.8%
*-rgt-identity97.8%
Simplified97.8%
Taylor expanded in z around 0 71.1%
if 10500 < z < 1.24999999999999994e36Initial program 99.8%
Taylor expanded in z around inf 100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
*-commutative100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-+l+100.0%
+-commutative100.0%
*-commutative100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
sub-neg100.0%
*-commutative100.0%
associate-/r*100.0%
*-rgt-identity100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-+l+100.0%
metadata-eval100.0%
associate-*r/100.0%
distribute-rgt-in100.0%
associate-*l/100.0%
*-lft-identity100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-frac2100.0%
Simplified100.0%
Taylor expanded in z around inf 94.4%
Final simplification71.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -5.4e-72)
t_1
(if (<= z 7.2e-113)
(/ (/ 2.0 t) z)
(if (or (<= z 17000000000.0) (not (<= z 6.4e+38)))
t_1
(- -2.0 (/ -2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -5.4e-72) {
tmp = t_1;
} else if (z <= 7.2e-113) {
tmp = (2.0 / t) / z;
} else if ((z <= 17000000000.0) || !(z <= 6.4e+38)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-5.4d-72)) then
tmp = t_1
else if (z <= 7.2d-113) then
tmp = (2.0d0 / t) / z
else if ((z <= 17000000000.0d0) .or. (.not. (z <= 6.4d+38))) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (z <= -5.4e-72) {
tmp = t_1;
} else if (z <= 7.2e-113) {
tmp = (2.0 / t) / z;
} else if ((z <= 17000000000.0) || !(z <= 6.4e+38)) {
tmp = t_1;
} else {
tmp = -2.0 - (-2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -5.4e-72: tmp = t_1 elif z <= 7.2e-113: tmp = (2.0 / t) / z elif (z <= 17000000000.0) or not (z <= 6.4e+38): tmp = t_1 else: tmp = -2.0 - (-2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -5.4e-72) tmp = t_1; elseif (z <= 7.2e-113) tmp = Float64(Float64(2.0 / t) / z); elseif ((z <= 17000000000.0) || !(z <= 6.4e+38)) tmp = t_1; else tmp = Float64(-2.0 - Float64(-2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -5.4e-72) tmp = t_1; elseif (z <= 7.2e-113) tmp = (2.0 / t) / z; elseif ((z <= 17000000000.0) || ~((z <= 6.4e+38))) tmp = t_1; else tmp = -2.0 - (-2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -5.4e-72], t$95$1, If[LessEqual[z, 7.2e-113], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, 17000000000.0], N[Not[LessEqual[z, 6.4e+38]], $MachinePrecision]], t$95$1, N[(-2.0 - N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;z \leq 17000000000 \lor \neg \left(z \leq 6.4 \cdot 10^{+38}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{-2}{t}\\
\end{array}
\end{array}
if z < -5.4e-72 or 7.1999999999999995e-113 < z < 1.7e10 or 6.3999999999999997e38 < z Initial program 74.0%
Taylor expanded in t around inf 70.1%
if -5.4e-72 < z < 7.1999999999999995e-113Initial program 97.8%
Taylor expanded in z around inf 97.8%
+-commutative97.8%
associate-*r/97.8%
metadata-eval97.8%
*-commutative97.8%
div-sub97.8%
sub-neg97.8%
*-inverses97.8%
metadata-eval97.8%
distribute-lft-in97.8%
metadata-eval97.8%
associate-+l+97.8%
+-commutative97.8%
*-commutative97.8%
+-commutative97.8%
associate-/l/97.7%
metadata-eval97.7%
associate-*r/97.7%
*-rgt-identity97.7%
Simplified97.7%
Taylor expanded in z around 0 71.9%
associate-/r*72.0%
Simplified72.0%
if 1.7e10 < z < 6.3999999999999997e38Initial program 99.8%
Taylor expanded in z around inf 100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
*-commutative100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-+l+100.0%
+-commutative100.0%
*-commutative100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
sub-neg100.0%
*-commutative100.0%
associate-/r*100.0%
*-rgt-identity100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-+l+100.0%
metadata-eval100.0%
associate-*r/100.0%
distribute-rgt-in100.0%
associate-*l/100.0%
*-lft-identity100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-frac2100.0%
Simplified100.0%
Taylor expanded in z around inf 94.4%
Final simplification71.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -950000.0) (not (<= (/ x y) 3.9e+27))) (+ (/ x y) (/ (/ 2.0 t) z)) (+ -2.0 (/ (- (/ 2.0 z) -2.0) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -950000.0) || !((x / y) <= 3.9e+27)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = -2.0 + (((2.0 / z) - -2.0) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-950000.0d0)) .or. (.not. ((x / y) <= 3.9d+27))) then
tmp = (x / y) + ((2.0d0 / t) / z)
else
tmp = (-2.0d0) + (((2.0d0 / z) - (-2.0d0)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -950000.0) || !((x / y) <= 3.9e+27)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = -2.0 + (((2.0 / z) - -2.0) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -950000.0) or not ((x / y) <= 3.9e+27): tmp = (x / y) + ((2.0 / t) / z) else: tmp = -2.0 + (((2.0 / z) - -2.0) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -950000.0) || !(Float64(x / y) <= 3.9e+27)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = Float64(-2.0 + Float64(Float64(Float64(2.0 / z) - -2.0) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -950000.0) || ~(((x / y) <= 3.9e+27))) tmp = (x / y) + ((2.0 / t) / z); else tmp = -2.0 + (((2.0 / z) - -2.0) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -950000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3.9e+27]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(N[(2.0 / z), $MachinePrecision] - -2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -950000 \lor \neg \left(\frac{x}{y} \leq 3.9 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z} - -2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.5e5 or 3.8999999999999999e27 < (/.f64 x y) Initial program 85.4%
Taylor expanded in z around 0 92.0%
associate-/r*92.0%
Simplified92.0%
if -9.5e5 < (/.f64 x y) < 3.8999999999999999e27Initial program 82.3%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
*-commutative99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
+-commutative99.9%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 98.0%
associate--l+98.0%
associate-*r/98.0%
metadata-eval98.0%
associate-*r/98.0%
metadata-eval98.0%
sub-neg98.0%
*-commutative98.0%
associate-/r*98.0%
*-rgt-identity98.0%
associate-*r/98.0%
metadata-eval98.0%
associate-+l+98.0%
metadata-eval98.0%
associate-*r/98.0%
distribute-rgt-in98.0%
associate-*l/98.0%
*-lft-identity98.0%
+-commutative98.0%
remove-double-neg98.0%
distribute-neg-frac298.0%
Simplified98.0%
Final simplification95.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3.3e+36) (not (<= (/ x y) 3.7e+56))) (/ x y) (- -2.0 (/ (/ -2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3.3e+36) || !((x / y) <= 3.7e+56)) {
tmp = x / y;
} 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 (((x / y) <= (-3.3d+36)) .or. (.not. ((x / y) <= 3.7d+56))) then
tmp = x / y
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 (((x / y) <= -3.3e+36) || !((x / y) <= 3.7e+56)) {
tmp = x / y;
} else {
tmp = -2.0 - ((-2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3.3e+36) or not ((x / y) <= 3.7e+56): tmp = x / y else: tmp = -2.0 - ((-2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -3.3e+36) || !(Float64(x / y) <= 3.7e+56)) tmp = Float64(x / y); else tmp = Float64(-2.0 - Float64(Float64(-2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -3.3e+36) || ~(((x / y) <= 3.7e+56))) tmp = x / y; else tmp = -2.0 - ((-2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -3.3e+36], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3.7e+56]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 - N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3.3 \cdot 10^{+36} \lor \neg \left(\frac{x}{y} \leq 3.7 \cdot 10^{+56}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{\frac{-2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.2999999999999999e36 or 3.69999999999999997e56 < (/.f64 x y) Initial program 84.8%
Taylor expanded in x around inf 79.4%
if -3.2999999999999999e36 < (/.f64 x y) < 3.69999999999999997e56Initial program 83.1%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
*-commutative99.9%
div-sub99.8%
sub-neg99.8%
*-inverses99.8%
metadata-eval99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 96.1%
associate--l+96.1%
associate-*r/96.1%
metadata-eval96.1%
associate-*r/96.1%
metadata-eval96.1%
sub-neg96.1%
*-commutative96.1%
associate-/r*96.1%
*-rgt-identity96.1%
associate-*r/96.1%
metadata-eval96.1%
associate-+l+96.1%
metadata-eval96.1%
associate-*r/96.1%
distribute-rgt-in96.1%
associate-*l/96.1%
*-lft-identity96.1%
+-commutative96.1%
remove-double-neg96.1%
distribute-neg-frac296.1%
Simplified96.1%
Taylor expanded in z around 0 73.5%
Final simplification76.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -350000000.0) (not (<= (/ x y) 4.2e+27))) (/ x y) (- -2.0 (/ -2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -350000000.0) || !((x / y) <= 4.2e+27)) {
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) <= (-350000000.0d0)) .or. (.not. ((x / y) <= 4.2d+27))) 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) <= -350000000.0) || !((x / y) <= 4.2e+27)) {
tmp = x / y;
} else {
tmp = -2.0 - (-2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -350000000.0) or not ((x / y) <= 4.2e+27): 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) <= -350000000.0) || !(Float64(x / y) <= 4.2e+27)) 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) <= -350000000.0) || ~(((x / y) <= 4.2e+27))) 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], -350000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4.2e+27]], $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 -350000000 \lor \neg \left(\frac{x}{y} \leq 4.2 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{-2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.5e8 or 4.19999999999999989e27 < (/.f64 x y) Initial program 85.4%
Taylor expanded in x around inf 73.6%
if -3.5e8 < (/.f64 x y) < 4.19999999999999989e27Initial program 82.3%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
*-commutative99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
+-commutative99.9%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 98.0%
associate--l+98.0%
associate-*r/98.0%
metadata-eval98.0%
associate-*r/98.0%
metadata-eval98.0%
sub-neg98.0%
*-commutative98.0%
associate-/r*98.0%
*-rgt-identity98.0%
associate-*r/98.0%
metadata-eval98.0%
associate-+l+98.0%
metadata-eval98.0%
associate-*r/98.0%
distribute-rgt-in98.0%
associate-*l/98.0%
*-lft-identity98.0%
+-commutative98.0%
remove-double-neg98.0%
distribute-neg-frac298.0%
Simplified98.0%
Taylor expanded in z around inf 59.3%
Final simplification66.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3500.0) (not (<= (/ x y) 0.25))) (- (/ x y) 2.0) (- -2.0 (/ -2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3500.0) || !((x / y) <= 0.25)) {
tmp = (x / y) - 2.0;
} 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) <= (-3500.0d0)) .or. (.not. ((x / y) <= 0.25d0))) then
tmp = (x / y) - 2.0d0
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) <= -3500.0) || !((x / y) <= 0.25)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 - (-2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3500.0) or not ((x / y) <= 0.25): tmp = (x / y) - 2.0 else: tmp = -2.0 - (-2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -3500.0) || !(Float64(x / y) <= 0.25)) tmp = Float64(Float64(x / y) - 2.0); 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) <= -3500.0) || ~(((x / y) <= 0.25))) tmp = (x / y) - 2.0; else tmp = -2.0 - (-2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -3500.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 0.25]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(-2.0 - N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3500 \lor \neg \left(\frac{x}{y} \leq 0.25\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{-2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3500 or 0.25 < (/.f64 x y) Initial program 85.9%
Taylor expanded in t around inf 72.3%
if -3500 < (/.f64 x y) < 0.25Initial program 81.8%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
*-commutative99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
+-commutative99.9%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 98.7%
associate--l+98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
sub-neg98.7%
*-commutative98.7%
associate-/r*98.7%
*-rgt-identity98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-+l+98.7%
metadata-eval98.7%
associate-*r/98.7%
distribute-rgt-in98.7%
associate-*l/98.7%
*-lft-identity98.7%
+-commutative98.7%
remove-double-neg98.7%
distribute-neg-frac298.7%
Simplified98.7%
Taylor expanded in z around inf 60.3%
Final simplification66.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.5e-29) (not (<= z 9.2e-62))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (- -2.0 (/ (/ -2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e-29) || !(z <= 9.2e-62)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} 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 ((z <= (-9.5d-29)) .or. (.not. (z <= 9.2d-62))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
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 ((z <= -9.5e-29) || !(z <= 9.2e-62)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 - ((-2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.5e-29) or not (z <= 9.2e-62): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = -2.0 - ((-2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.5e-29) || !(z <= 9.2e-62)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(-2.0 - Float64(Float64(-2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.5e-29) || ~((z <= 9.2e-62))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = -2.0 - ((-2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.5e-29], N[Not[LessEqual[z, 9.2e-62]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 - N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-29} \lor \neg \left(z \leq 9.2 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{\frac{-2}{z}}{t}\\
\end{array}
\end{array}
if z < -9.50000000000000023e-29 or 9.20000000000000002e-62 < z Initial program 72.3%
Taylor expanded in z around inf 97.6%
div-sub97.6%
sub-neg97.6%
*-inverses97.6%
metadata-eval97.6%
distribute-lft-in97.6%
metadata-eval97.6%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
if -9.50000000000000023e-29 < z < 9.20000000000000002e-62Initial program 97.3%
Taylor expanded in z around inf 97.3%
+-commutative97.3%
associate-*r/97.3%
metadata-eval97.3%
*-commutative97.3%
div-sub97.3%
sub-neg97.3%
*-inverses97.3%
metadata-eval97.3%
distribute-lft-in97.3%
metadata-eval97.3%
associate-+l+97.3%
+-commutative97.3%
*-commutative97.3%
+-commutative97.3%
associate-/l/97.3%
metadata-eval97.3%
associate-*r/97.3%
*-rgt-identity97.3%
Simplified97.2%
Taylor expanded in x around 0 75.9%
associate--l+75.9%
associate-*r/75.9%
metadata-eval75.9%
associate-*r/75.9%
metadata-eval75.9%
sub-neg75.9%
*-commutative75.9%
associate-/r*75.9%
*-rgt-identity75.9%
associate-*r/75.8%
metadata-eval75.8%
associate-+l+75.8%
metadata-eval75.8%
associate-*r/75.8%
distribute-rgt-in75.8%
associate-*l/75.9%
*-lft-identity75.9%
+-commutative75.9%
remove-double-neg75.9%
distribute-neg-frac275.9%
Simplified75.9%
Taylor expanded in z around 0 75.9%
Final simplification87.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.1) (not (<= z 9.6e-61))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.1) || !(z <= 9.6e-61)) {
tmp = (x / y) + (-2.0 + (2.0 / 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 ((z <= (-4.1d0)) .or. (.not. (z <= 9.6d-61))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / 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 ((z <= -4.1) || !(z <= 9.6e-61)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.1) or not (z <= 9.6e-61): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.1) || !(z <= 9.6e-61)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / 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 ((z <= -4.1) || ~((z <= 9.6e-61))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.1], N[Not[LessEqual[z, 9.6e-61]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $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 -4.1 \lor \neg \left(z \leq 9.6 \cdot 10^{-61}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -4.0999999999999996 or 9.6000000000000004e-61 < z Initial program 71.5%
Taylor expanded in z around inf 98.3%
div-sub98.3%
sub-neg98.3%
*-inverses98.3%
metadata-eval98.3%
distribute-lft-in98.3%
metadata-eval98.3%
associate-*r/98.3%
metadata-eval98.3%
Simplified98.3%
if -4.0999999999999996 < z < 9.6000000000000004e-61Initial program 97.4%
Taylor expanded in z around 0 88.4%
associate-/r*88.4%
Simplified88.4%
Final simplification93.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -950000.0) (not (<= (/ x y) 4.2e+27))) (/ x y) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -950000.0) || !((x / y) <= 4.2e+27)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-950000.0d0)) .or. (.not. ((x / y) <= 4.2d+27))) then
tmp = x / y
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -950000.0) || !((x / y) <= 4.2e+27)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -950000.0) or not ((x / y) <= 4.2e+27): tmp = x / y else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -950000.0) || !(Float64(x / y) <= 4.2e+27)) tmp = Float64(x / y); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -950000.0) || ~(((x / y) <= 4.2e+27))) tmp = x / y; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -950000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4.2e+27]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -950000 \lor \neg \left(\frac{x}{y} \leq 4.2 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.5e5 or 4.19999999999999989e27 < (/.f64 x y) Initial program 85.4%
Taylor expanded in x around inf 73.6%
if -9.5e5 < (/.f64 x y) < 4.19999999999999989e27Initial program 82.3%
Taylor expanded in t around 0 65.2%
associate-*r/65.2%
metadata-eval65.2%
Simplified65.2%
Taylor expanded in z around inf 26.8%
Final simplification49.5%
(FPCore (x y z t) :precision binary64 (+ (+ (/ x y) -2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
return ((x / y) + -2.0) + ((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 = ((x / y) + (-2.0d0)) + ((2.0d0 + (2.0d0 / z)) / t)
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) + -2.0) + ((2.0 + (2.0 / z)) / t);
}
def code(x, y, z, t): return ((x / y) + -2.0) + ((2.0 + (2.0 / z)) / t)
function code(x, y, z, t) return Float64(Float64(Float64(x / y) + -2.0) + Float64(Float64(2.0 + Float64(2.0 / z)) / t)) end
function tmp = code(x, y, z, t) tmp = ((x / y) + -2.0) + ((2.0 + (2.0 / z)) / t); end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{x}{y} + -2\right) + \frac{2 + \frac{2}{z}}{t}
\end{array}
Initial program 83.8%
+-commutative83.8%
remove-double-neg83.8%
distribute-frac-neg83.8%
unsub-neg83.8%
*-commutative83.8%
associate-*r*83.8%
distribute-rgt1-in83.8%
associate-/l*83.8%
fma-neg83.8%
*-commutative83.8%
fma-define83.8%
*-commutative83.8%
distribute-frac-neg83.8%
remove-double-neg83.8%
Simplified83.8%
Taylor expanded in t around inf 98.7%
associate--l+98.7%
+-commutative98.7%
sub-neg98.7%
metadata-eval98.7%
+-commutative98.7%
associate-*r/98.7%
distribute-lft-in98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (/ 2.0 t))
double code(double x, double y, double z, double t) {
return 2.0 / 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 / t
end function
public static double code(double x, double y, double z, double t) {
return 2.0 / t;
}
def code(x, y, z, t): return 2.0 / t
function code(x, y, z, t) return Float64(2.0 / t) end
function tmp = code(x, y, z, t) tmp = 2.0 / t; end
code[x_, y_, z_, t_] := N[(2.0 / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t}
\end{array}
Initial program 83.8%
Taylor expanded in t around 0 48.2%
associate-*r/48.2%
metadata-eval48.2%
Simplified48.2%
Taylor expanded in z around inf 17.4%
Final simplification17.4%
(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 2024055
(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))))