
(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 15 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 85.8%
Taylor expanded in t around 0 98.3%
sub-neg98.3%
metadata-eval98.3%
associate-*r/98.3%
+-commutative98.3%
associate-*r/98.3%
metadata-eval98.3%
metadata-eval98.3%
+-commutative98.3%
associate-/l/98.3%
metadata-eval98.3%
associate-*r/98.3%
*-rgt-identity98.3%
associate-*r/98.3%
distribute-rgt-out98.3%
associate-*r/98.3%
metadata-eval98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z))) (t_2 (+ (/ x y) -2.0)))
(if (<= t -0.00078)
t_2
(if (<= t -5e-137)
t_1
(if (<= t -1.9e-180)
(/ 2.0 t)
(if (<= t -1.25e-272)
t_1
(if (<= t 2.45e-159)
(/ 2.0 t)
(if (or (<= t 1.55e+53) (not (<= t 1.6e+63))) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (t * z);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -0.00078) {
tmp = t_2;
} else if (t <= -5e-137) {
tmp = t_1;
} else if (t <= -1.9e-180) {
tmp = 2.0 / t;
} else if (t <= -1.25e-272) {
tmp = t_1;
} else if (t <= 2.45e-159) {
tmp = 2.0 / t;
} else if ((t <= 1.55e+53) || !(t <= 1.6e+63)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 / (t * z)
t_2 = (x / y) + (-2.0d0)
if (t <= (-0.00078d0)) then
tmp = t_2
else if (t <= (-5d-137)) then
tmp = t_1
else if (t <= (-1.9d-180)) then
tmp = 2.0d0 / t
else if (t <= (-1.25d-272)) then
tmp = t_1
else if (t <= 2.45d-159) then
tmp = 2.0d0 / t
else if ((t <= 1.55d+53) .or. (.not. (t <= 1.6d+63))) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (t * z);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -0.00078) {
tmp = t_2;
} else if (t <= -5e-137) {
tmp = t_1;
} else if (t <= -1.9e-180) {
tmp = 2.0 / t;
} else if (t <= -1.25e-272) {
tmp = t_1;
} else if (t <= 2.45e-159) {
tmp = 2.0 / t;
} else if ((t <= 1.55e+53) || !(t <= 1.6e+63)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (t * z) t_2 = (x / y) + -2.0 tmp = 0 if t <= -0.00078: tmp = t_2 elif t <= -5e-137: tmp = t_1 elif t <= -1.9e-180: tmp = 2.0 / t elif t <= -1.25e-272: tmp = t_1 elif t <= 2.45e-159: tmp = 2.0 / t elif (t <= 1.55e+53) or not (t <= 1.6e+63): tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(t * z)) t_2 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -0.00078) tmp = t_2; elseif (t <= -5e-137) tmp = t_1; elseif (t <= -1.9e-180) tmp = Float64(2.0 / t); elseif (t <= -1.25e-272) tmp = t_1; elseif (t <= 2.45e-159) tmp = Float64(2.0 / t); elseif ((t <= 1.55e+53) || !(t <= 1.6e+63)) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (t * z); t_2 = (x / y) + -2.0; tmp = 0.0; if (t <= -0.00078) tmp = t_2; elseif (t <= -5e-137) tmp = t_1; elseif (t <= -1.9e-180) tmp = 2.0 / t; elseif (t <= -1.25e-272) tmp = t_1; elseif (t <= 2.45e-159) tmp = 2.0 / t; elseif ((t <= 1.55e+53) || ~((t <= 1.6e+63))) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -0.00078], t$95$2, If[LessEqual[t, -5e-137], t$95$1, If[LessEqual[t, -1.9e-180], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, -1.25e-272], t$95$1, If[LessEqual[t, 2.45e-159], N[(2.0 / t), $MachinePrecision], If[Or[LessEqual[t, 1.55e+53], N[Not[LessEqual[t, 1.6e+63]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t \cdot z}\\
t_2 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -0.00078:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-180}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.45 \cdot 10^{-159}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+53} \lor \neg \left(t \leq 1.6 \cdot 10^{+63}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.79999999999999986e-4 or 2.45000000000000007e-159 < t < 1.5500000000000001e53 or 1.60000000000000006e63 < t Initial program 79.5%
Taylor expanded in t around inf 78.3%
if -7.79999999999999986e-4 < t < -5.00000000000000001e-137 or -1.9e-180 < t < -1.24999999999999995e-272 or 1.5500000000000001e53 < t < 1.60000000000000006e63Initial program 99.8%
Taylor expanded in t around 0 99.7%
sub-neg99.7%
metadata-eval99.7%
associate-*r/99.7%
+-commutative99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
associate-/l/99.7%
metadata-eval99.7%
associate-*r/99.7%
*-rgt-identity99.7%
associate-*r/99.8%
distribute-rgt-out99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 66.2%
if -5.00000000000000001e-137 < t < -1.9e-180 or -1.24999999999999995e-272 < t < 2.45000000000000007e-159Initial program 94.3%
Taylor expanded in t around 0 85.4%
associate-*r/85.4%
metadata-eval85.4%
Simplified85.4%
Taylor expanded in z around inf 57.5%
Final simplification72.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)) (t_2 (/ 2.0 (* t z))))
(if (<= t -0.135)
t_1
(if (<= t -1.3e-132)
(/ (/ 2.0 t) z)
(if (<= t -8.5e-181)
(/ 2.0 t)
(if (<= t -1.2e-272)
t_2
(if (<= t 9.2e-159)
(/ 2.0 t)
(if (or (<= t 1.55e+53) (not (<= t 1.6e+63))) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double t_2 = 2.0 / (t * z);
double tmp;
if (t <= -0.135) {
tmp = t_1;
} else if (t <= -1.3e-132) {
tmp = (2.0 / t) / z;
} else if (t <= -8.5e-181) {
tmp = 2.0 / t;
} else if (t <= -1.2e-272) {
tmp = t_2;
} else if (t <= 9.2e-159) {
tmp = 2.0 / t;
} else if ((t <= 1.55e+53) || !(t <= 1.6e+63)) {
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 = (x / y) + (-2.0d0)
t_2 = 2.0d0 / (t * z)
if (t <= (-0.135d0)) then
tmp = t_1
else if (t <= (-1.3d-132)) then
tmp = (2.0d0 / t) / z
else if (t <= (-8.5d-181)) then
tmp = 2.0d0 / t
else if (t <= (-1.2d-272)) then
tmp = t_2
else if (t <= 9.2d-159) then
tmp = 2.0d0 / t
else if ((t <= 1.55d+53) .or. (.not. (t <= 1.6d+63))) 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 = (x / y) + -2.0;
double t_2 = 2.0 / (t * z);
double tmp;
if (t <= -0.135) {
tmp = t_1;
} else if (t <= -1.3e-132) {
tmp = (2.0 / t) / z;
} else if (t <= -8.5e-181) {
tmp = 2.0 / t;
} else if (t <= -1.2e-272) {
tmp = t_2;
} else if (t <= 9.2e-159) {
tmp = 2.0 / t;
} else if ((t <= 1.55e+53) || !(t <= 1.6e+63)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 t_2 = 2.0 / (t * z) tmp = 0 if t <= -0.135: tmp = t_1 elif t <= -1.3e-132: tmp = (2.0 / t) / z elif t <= -8.5e-181: tmp = 2.0 / t elif t <= -1.2e-272: tmp = t_2 elif t <= 9.2e-159: tmp = 2.0 / t elif (t <= 1.55e+53) or not (t <= 1.6e+63): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) t_2 = Float64(2.0 / Float64(t * z)) tmp = 0.0 if (t <= -0.135) tmp = t_1; elseif (t <= -1.3e-132) tmp = Float64(Float64(2.0 / t) / z); elseif (t <= -8.5e-181) tmp = Float64(2.0 / t); elseif (t <= -1.2e-272) tmp = t_2; elseif (t <= 9.2e-159) tmp = Float64(2.0 / t); elseif ((t <= 1.55e+53) || !(t <= 1.6e+63)) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; t_2 = 2.0 / (t * z); tmp = 0.0; if (t <= -0.135) tmp = t_1; elseif (t <= -1.3e-132) tmp = (2.0 / t) / z; elseif (t <= -8.5e-181) tmp = 2.0 / t; elseif (t <= -1.2e-272) tmp = t_2; elseif (t <= 9.2e-159) tmp = 2.0 / t; elseif ((t <= 1.55e+53) || ~((t <= 1.6e+63))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.135], t$95$1, If[LessEqual[t, -1.3e-132], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, -8.5e-181], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, -1.2e-272], t$95$2, If[LessEqual[t, 9.2e-159], N[(2.0 / t), $MachinePrecision], If[Or[LessEqual[t, 1.55e+53], N[Not[LessEqual[t, 1.6e+63]], $MachinePrecision]], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
t_2 := \frac{2}{t \cdot z}\\
\mathbf{if}\;t \leq -0.135:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-132}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-181}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-272}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-159}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+53} \lor \neg \left(t \leq 1.6 \cdot 10^{+63}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -0.13500000000000001 or 9.19999999999999914e-159 < t < 1.5500000000000001e53 or 1.60000000000000006e63 < t Initial program 79.5%
Taylor expanded in t around inf 78.3%
if -0.13500000000000001 < t < -1.3e-132Initial program 99.6%
Taylor expanded in t around 0 99.7%
sub-neg99.7%
metadata-eval99.7%
associate-*r/99.7%
+-commutative99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
associate-/l/99.6%
metadata-eval99.6%
associate-*r/99.6%
*-rgt-identity99.6%
associate-*r/99.7%
distribute-rgt-out99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-+r+99.7%
associate-*r/99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.6%
*-rgt-identity99.6%
associate-*r/99.7%
distribute-rgt-in99.7%
associate-*l/99.6%
*-lft-identity99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 65.1%
associate-/r*65.3%
Simplified65.3%
if -1.3e-132 < t < -8.49999999999999953e-181 or -1.19999999999999995e-272 < t < 9.19999999999999914e-159Initial program 94.3%
Taylor expanded in t around 0 85.4%
associate-*r/85.4%
metadata-eval85.4%
Simplified85.4%
Taylor expanded in z around inf 57.5%
if -8.49999999999999953e-181 < t < -1.19999999999999995e-272 or 1.5500000000000001e53 < t < 1.60000000000000006e63Initial program 99.9%
Taylor expanded in t around 0 99.7%
sub-neg99.7%
metadata-eval99.7%
associate-*r/99.7%
+-commutative99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
associate-/l/99.7%
metadata-eval99.7%
associate-*r/99.7%
*-rgt-identity99.7%
associate-*r/99.8%
distribute-rgt-out99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 66.8%
Final simplification72.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z))) (t_2 (* 2.0 (+ (/ 1.0 t) -1.0))))
(if (<= (/ x y) -4e+58)
(/ x y)
(if (<= (/ x y) 9.2e-181)
t_2
(if (<= (/ x y) 7.8e-71)
t_1
(if (<= (/ x y) 2.9e-5)
t_2
(if (<= (/ x y) 6.8e+16) t_1 (/ x y))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (t * z);
double t_2 = 2.0 * ((1.0 / t) + -1.0);
double tmp;
if ((x / y) <= -4e+58) {
tmp = x / y;
} else if ((x / y) <= 9.2e-181) {
tmp = t_2;
} else if ((x / y) <= 7.8e-71) {
tmp = t_1;
} else if ((x / y) <= 2.9e-5) {
tmp = t_2;
} else if ((x / y) <= 6.8e+16) {
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) :: t_2
real(8) :: tmp
t_1 = 2.0d0 / (t * z)
t_2 = 2.0d0 * ((1.0d0 / t) + (-1.0d0))
if ((x / y) <= (-4d+58)) then
tmp = x / y
else if ((x / y) <= 9.2d-181) then
tmp = t_2
else if ((x / y) <= 7.8d-71) then
tmp = t_1
else if ((x / y) <= 2.9d-5) then
tmp = t_2
else if ((x / y) <= 6.8d+16) 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 / (t * z);
double t_2 = 2.0 * ((1.0 / t) + -1.0);
double tmp;
if ((x / y) <= -4e+58) {
tmp = x / y;
} else if ((x / y) <= 9.2e-181) {
tmp = t_2;
} else if ((x / y) <= 7.8e-71) {
tmp = t_1;
} else if ((x / y) <= 2.9e-5) {
tmp = t_2;
} else if ((x / y) <= 6.8e+16) {
tmp = t_1;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (t * z) t_2 = 2.0 * ((1.0 / t) + -1.0) tmp = 0 if (x / y) <= -4e+58: tmp = x / y elif (x / y) <= 9.2e-181: tmp = t_2 elif (x / y) <= 7.8e-71: tmp = t_1 elif (x / y) <= 2.9e-5: tmp = t_2 elif (x / y) <= 6.8e+16: tmp = t_1 else: tmp = x / y return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(t * z)) t_2 = Float64(2.0 * Float64(Float64(1.0 / t) + -1.0)) tmp = 0.0 if (Float64(x / y) <= -4e+58) tmp = Float64(x / y); elseif (Float64(x / y) <= 9.2e-181) tmp = t_2; elseif (Float64(x / y) <= 7.8e-71) tmp = t_1; elseif (Float64(x / y) <= 2.9e-5) tmp = t_2; elseif (Float64(x / y) <= 6.8e+16) tmp = t_1; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (t * z); t_2 = 2.0 * ((1.0 / t) + -1.0); tmp = 0.0; if ((x / y) <= -4e+58) tmp = x / y; elseif ((x / y) <= 9.2e-181) tmp = t_2; elseif ((x / y) <= 7.8e-71) tmp = t_1; elseif ((x / y) <= 2.9e-5) tmp = t_2; elseif ((x / y) <= 6.8e+16) 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[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(1.0 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -4e+58], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 9.2e-181], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 7.8e-71], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 2.9e-5], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 6.8e+16], t$95$1, N[(x / y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t \cdot z}\\
t_2 := 2 \cdot \left(\frac{1}{t} + -1\right)\\
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+58}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 9.2 \cdot 10^{-181}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq 7.8 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2.9 \cdot 10^{-5}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq 6.8 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.99999999999999978e58 or 6.8e16 < (/.f64 x y) Initial program 83.4%
Taylor expanded in x around inf 75.6%
if -3.99999999999999978e58 < (/.f64 x y) < 9.19999999999999963e-181 or 7.8000000000000004e-71 < (/.f64 x y) < 2.9e-5Initial program 85.5%
+-commutative85.5%
remove-double-neg85.5%
distribute-frac-neg85.5%
unsub-neg85.5%
*-commutative85.5%
associate-*r*85.5%
distribute-rgt1-in85.5%
associate-*r/85.4%
/-rgt-identity85.4%
fma-neg85.4%
/-rgt-identity85.4%
*-commutative85.4%
fma-def85.4%
*-commutative85.4%
distribute-frac-neg85.4%
remove-double-neg85.4%
Simplified85.4%
Taylor expanded in x around 0 81.7%
Taylor expanded in z around inf 65.3%
div-sub65.3%
sub-neg65.3%
*-inverses65.3%
metadata-eval65.3%
Simplified65.3%
if 9.19999999999999963e-181 < (/.f64 x y) < 7.8000000000000004e-71 or 2.9e-5 < (/.f64 x y) < 6.8e16Initial program 99.7%
Taylor expanded in t around 0 99.7%
sub-neg99.7%
metadata-eval99.7%
associate-*r/99.7%
+-commutative99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
associate-/l/99.7%
metadata-eval99.7%
associate-*r/99.7%
*-rgt-identity99.7%
associate-*r/99.6%
distribute-rgt-out99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 74.3%
Final simplification71.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (+ -2.0 (/ 2.0 t)))))
(if (<= (/ x y) -1.35e-5)
t_1
(if (<= (/ x y) 1.8e+17)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(if (<= (/ x y) 3.6e+70) t_1 (+ (/ x y) (* (/ 1.0 t) (/ 2.0 z))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if ((x / y) <= -1.35e-5) {
tmp = t_1;
} else if ((x / y) <= 1.8e+17) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else if ((x / y) <= 3.6e+70) {
tmp = t_1;
} else {
tmp = (x / y) + ((1.0 / t) * (2.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) :: t_1
real(8) :: tmp
t_1 = (x / y) + ((-2.0d0) + (2.0d0 / t))
if ((x / y) <= (-1.35d-5)) then
tmp = t_1
else if ((x / y) <= 1.8d+17) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else if ((x / y) <= 3.6d+70) then
tmp = t_1
else
tmp = (x / y) + ((1.0d0 / t) * (2.0d0 / z))
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 + (2.0 / t));
double tmp;
if ((x / y) <= -1.35e-5) {
tmp = t_1;
} else if ((x / y) <= 1.8e+17) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else if ((x / y) <= 3.6e+70) {
tmp = t_1;
} else {
tmp = (x / y) + ((1.0 / t) * (2.0 / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (-2.0 + (2.0 / t)) tmp = 0 if (x / y) <= -1.35e-5: tmp = t_1 elif (x / y) <= 1.8e+17: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) elif (x / y) <= 3.6e+70: tmp = t_1 else: tmp = (x / y) + ((1.0 / t) * (2.0 / z)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))) tmp = 0.0 if (Float64(x / y) <= -1.35e-5) tmp = t_1; elseif (Float64(x / y) <= 1.8e+17) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); elseif (Float64(x / y) <= 3.6e+70) tmp = t_1; else tmp = Float64(Float64(x / y) + Float64(Float64(1.0 / t) * Float64(2.0 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (-2.0 + (2.0 / t)); tmp = 0.0; if ((x / y) <= -1.35e-5) tmp = t_1; elseif ((x / y) <= 1.8e+17) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); elseif ((x / y) <= 3.6e+70) tmp = t_1; else tmp = (x / y) + ((1.0 / t) * (2.0 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1.35e-5], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 1.8e+17], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 3.6e+70], t$95$1, N[(N[(x / y), $MachinePrecision] + N[(N[(1.0 / t), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{if}\;\frac{x}{y} \leq -1.35 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 1.8 \cdot 10^{+17}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 3.6 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{1}{t} \cdot \frac{2}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.3499999999999999e-5 or 1.8e17 < (/.f64 x y) < 3.6e70Initial program 89.8%
Taylor expanded in t around 0 98.7%
sub-neg98.7%
metadata-eval98.7%
associate-*r/98.7%
+-commutative98.7%
associate-*r/98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
associate-/l/98.7%
metadata-eval98.7%
associate-*r/98.7%
*-rgt-identity98.7%
associate-*r/98.7%
distribute-rgt-out98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in z around inf 85.9%
sub-neg85.9%
associate-*r/85.9%
metadata-eval85.9%
+-commutative85.9%
metadata-eval85.9%
associate-+l+85.9%
Simplified85.9%
if -1.3499999999999999e-5 < (/.f64 x y) < 1.8e17Initial program 87.4%
Taylor expanded in t around 0 99.8%
sub-neg99.8%
metadata-eval99.8%
associate-*r/99.8%
+-commutative99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
distribute-rgt-out99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
sub-neg99.8%
associate-*r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
*-rgt-identity99.8%
associate-*r/99.8%
distribute-rgt-in99.8%
associate-*l/99.8%
*-lft-identity99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
if 3.6e70 < (/.f64 x y) Initial program 76.7%
Taylor expanded in z around 0 90.7%
associate-/r*90.8%
Simplified90.8%
associate-/l/90.7%
metadata-eval90.7%
frac-times90.8%
Applied egg-rr90.8%
Final simplification93.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (+ -2.0 (/ 2.0 t)))))
(if (<= (/ x y) -8.8e-10)
t_1
(if (<= (/ x y) 5.1e+16)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(if (<= (/ x y) 2.1e+71) t_1 (+ (/ x y) (/ (/ 2.0 t) z)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if ((x / y) <= -8.8e-10) {
tmp = t_1;
} else if ((x / y) <= 5.1e+16) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else if ((x / y) <= 2.1e+71) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) + ((-2.0d0) + (2.0d0 / t))
if ((x / y) <= (-8.8d-10)) then
tmp = t_1
else if ((x / y) <= 5.1d+16) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else if ((x / y) <= 2.1d+71) then
tmp = t_1
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 t_1 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if ((x / y) <= -8.8e-10) {
tmp = t_1;
} else if ((x / y) <= 5.1e+16) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else if ((x / y) <= 2.1e+71) {
tmp = t_1;
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (-2.0 + (2.0 / t)) tmp = 0 if (x / y) <= -8.8e-10: tmp = t_1 elif (x / y) <= 5.1e+16: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) elif (x / y) <= 2.1e+71: tmp = t_1 else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))) tmp = 0.0 if (Float64(x / y) <= -8.8e-10) tmp = t_1; elseif (Float64(x / y) <= 5.1e+16) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); elseif (Float64(x / y) <= 2.1e+71) tmp = t_1; else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (-2.0 + (2.0 / t)); tmp = 0.0; if ((x / y) <= -8.8e-10) tmp = t_1; elseif ((x / y) <= 5.1e+16) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); elseif ((x / y) <= 2.1e+71) tmp = t_1; else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -8.8e-10], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5.1e+16], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.1e+71], t$95$1, N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{if}\;\frac{x}{y} \leq -8.8 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 5.1 \cdot 10^{+16}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2.1 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -8.7999999999999996e-10 or 5.1e16 < (/.f64 x y) < 2.09999999999999989e71Initial program 89.8%
Taylor expanded in t around 0 98.7%
sub-neg98.7%
metadata-eval98.7%
associate-*r/98.7%
+-commutative98.7%
associate-*r/98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
associate-/l/98.7%
metadata-eval98.7%
associate-*r/98.7%
*-rgt-identity98.7%
associate-*r/98.7%
distribute-rgt-out98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in z around inf 85.9%
sub-neg85.9%
associate-*r/85.9%
metadata-eval85.9%
+-commutative85.9%
metadata-eval85.9%
associate-+l+85.9%
Simplified85.9%
if -8.7999999999999996e-10 < (/.f64 x y) < 5.1e16Initial program 87.4%
Taylor expanded in t around 0 99.8%
sub-neg99.8%
metadata-eval99.8%
associate-*r/99.8%
+-commutative99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
distribute-rgt-out99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
sub-neg99.8%
associate-*r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
*-rgt-identity99.8%
associate-*r/99.8%
distribute-rgt-in99.8%
associate-*l/99.8%
*-lft-identity99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
if 2.09999999999999989e71 < (/.f64 x y) Initial program 76.7%
Taylor expanded in z around 0 90.7%
associate-/r*90.8%
Simplified90.8%
Final simplification93.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= t -7.5e-5)
t_1
(if (<= t 6e-32)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (or (<= t 1.55e+53) (not (<= t 1.6e+63))) t_1 (/ 2.0 (* t z)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -7.5e-5) {
tmp = t_1;
} else if (t <= 6e-32) {
tmp = (2.0 + (2.0 / z)) / t;
} else if ((t <= 1.55e+53) || !(t <= 1.6e+63)) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
if (t <= (-7.5d-5)) then
tmp = t_1
else if (t <= 6d-32) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if ((t <= 1.55d+53) .or. (.not. (t <= 1.6d+63))) then
tmp = t_1
else
tmp = 2.0d0 / (t * z)
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 <= -7.5e-5) {
tmp = t_1;
} else if (t <= 6e-32) {
tmp = (2.0 + (2.0 / z)) / t;
} else if ((t <= 1.55e+53) || !(t <= 1.6e+63)) {
tmp = t_1;
} else {
tmp = 2.0 / (t * z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if t <= -7.5e-5: tmp = t_1 elif t <= 6e-32: tmp = (2.0 + (2.0 / z)) / t elif (t <= 1.55e+53) or not (t <= 1.6e+63): tmp = t_1 else: tmp = 2.0 / (t * z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -7.5e-5) tmp = t_1; elseif (t <= 6e-32) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif ((t <= 1.55e+53) || !(t <= 1.6e+63)) tmp = t_1; else tmp = Float64(2.0 / Float64(t * z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if (t <= -7.5e-5) tmp = t_1; elseif (t <= 6e-32) tmp = (2.0 + (2.0 / z)) / t; elseif ((t <= 1.55e+53) || ~((t <= 1.6e+63))) tmp = t_1; else tmp = 2.0 / (t * z); 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, -7.5e-5], t$95$1, If[LessEqual[t, 6e-32], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[t, 1.55e+53], N[Not[LessEqual[t, 1.6e+63]], $MachinePrecision]], t$95$1, N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-32}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+53} \lor \neg \left(t \leq 1.6 \cdot 10^{+63}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\end{array}
\end{array}
if t < -7.49999999999999934e-5 or 6.0000000000000001e-32 < t < 1.5500000000000001e53 or 1.60000000000000006e63 < t Initial program 77.1%
Taylor expanded in t around inf 85.3%
if -7.49999999999999934e-5 < t < 6.0000000000000001e-32Initial program 96.2%
Taylor expanded in t around 0 82.8%
associate-*r/82.8%
metadata-eval82.8%
Simplified82.8%
if 1.5500000000000001e53 < t < 1.60000000000000006e63Initial program 99.7%
Taylor expanded in t around 0 99.7%
sub-neg99.7%
metadata-eval99.7%
associate-*r/99.7%
+-commutative99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
associate-/l/99.4%
metadata-eval99.4%
associate-*r/99.4%
*-rgt-identity99.4%
associate-*r/99.7%
distribute-rgt-out99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Final simplification84.5%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -13500.0)
(/ x y)
(if (<= (/ x y) 2.1e-276)
-2.0
(if (<= (/ x y) 2.9e+17) (/ 2.0 t) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -13500.0) {
tmp = x / y;
} else if ((x / y) <= 2.1e-276) {
tmp = -2.0;
} else if ((x / y) <= 2.9e+17) {
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) <= (-13500.0d0)) then
tmp = x / y
else if ((x / y) <= 2.1d-276) then
tmp = -2.0d0
else if ((x / y) <= 2.9d+17) 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) <= -13500.0) {
tmp = x / y;
} else if ((x / y) <= 2.1e-276) {
tmp = -2.0;
} else if ((x / y) <= 2.9e+17) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -13500.0: tmp = x / y elif (x / y) <= 2.1e-276: tmp = -2.0 elif (x / y) <= 2.9e+17: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -13500.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 2.1e-276) tmp = -2.0; elseif (Float64(x / y) <= 2.9e+17) 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) <= -13500.0) tmp = x / y; elseif ((x / y) <= 2.1e-276) tmp = -2.0; elseif ((x / y) <= 2.9e+17) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -13500.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.1e-276], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 2.9e+17], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -13500:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2.1 \cdot 10^{-276}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 2.9 \cdot 10^{+17}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -13500 or 2.9e17 < (/.f64 x y) Initial program 84.0%
Taylor expanded in x around inf 72.3%
if -13500 < (/.f64 x y) < 2.1e-276Initial program 86.4%
+-commutative86.4%
remove-double-neg86.4%
distribute-frac-neg86.4%
unsub-neg86.4%
*-commutative86.4%
associate-*r*86.4%
distribute-rgt1-in86.4%
associate-*r/86.3%
/-rgt-identity86.3%
fma-neg86.3%
/-rgt-identity86.3%
*-commutative86.3%
fma-def86.3%
*-commutative86.3%
distribute-frac-neg86.3%
remove-double-neg86.3%
Simplified86.3%
Taylor expanded in x around 0 84.4%
Taylor expanded in t around inf 45.0%
if 2.1e-276 < (/.f64 x y) < 2.9e17Initial program 89.6%
Taylor expanded in t around 0 77.4%
associate-*r/77.4%
metadata-eval77.4%
Simplified77.4%
Taylor expanded in z around inf 33.7%
Final simplification56.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.0054) (not (<= (/ x y) 3.3e+16))) (+ (/ 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) <= -0.0054) || !((x / y) <= 3.3e+16)) {
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) <= (-0.0054d0)) .or. (.not. ((x / y) <= 3.3d+16))) 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) <= -0.0054) || !((x / y) <= 3.3e+16)) {
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) <= -0.0054) or not ((x / y) <= 3.3e+16): 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) <= -0.0054) || !(Float64(x / y) <= 3.3e+16)) 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) <= -0.0054) || ~(((x / y) <= 3.3e+16))) 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], -0.0054], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3.3e+16]], $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 -0.0054 \lor \neg \left(\frac{x}{y} \leq 3.3 \cdot 10^{+16}\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) < -0.0054000000000000003 or 3.3e16 < (/.f64 x y) Initial program 84.4%
Taylor expanded in t around 0 97.0%
sub-neg97.0%
metadata-eval97.0%
associate-*r/97.0%
+-commutative97.0%
associate-*r/97.0%
metadata-eval97.0%
metadata-eval97.0%
+-commutative97.0%
associate-/l/97.0%
metadata-eval97.0%
associate-*r/97.0%
*-rgt-identity97.0%
associate-*r/97.0%
distribute-rgt-out97.0%
associate-*r/97.0%
metadata-eval97.0%
Simplified97.0%
Taylor expanded in z around inf 84.7%
sub-neg84.7%
associate-*r/84.7%
metadata-eval84.7%
+-commutative84.7%
metadata-eval84.7%
associate-+l+84.7%
Simplified84.7%
if -0.0054000000000000003 < (/.f64 x y) < 3.3e16Initial program 87.4%
Taylor expanded in t around 0 99.8%
sub-neg99.8%
metadata-eval99.8%
associate-*r/99.8%
+-commutative99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
distribute-rgt-out99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
sub-neg99.8%
associate-*r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
*-rgt-identity99.8%
associate-*r/99.8%
distribute-rgt-in99.8%
associate-*l/99.8%
*-lft-identity99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Final simplification91.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.6e+103) (/ x y) (if (<= (/ x y) 4e+123) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t)) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.6e+103) {
tmp = x / y;
} else if ((x / y) <= 4e+123) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} 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) <= (-1.6d+103)) then
tmp = x / y
else if ((x / y) <= 4d+123) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
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) <= -1.6e+103) {
tmp = x / y;
} else if ((x / y) <= 4e+123) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.6e+103: tmp = x / y elif (x / y) <= 4e+123: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.6e+103) tmp = Float64(x / y); elseif (Float64(x / y) <= 4e+123) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); 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) <= -1.6e+103) tmp = x / y; elseif ((x / y) <= 4e+123) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.6e+103], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4e+123], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.6 \cdot 10^{+103}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{+123}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.59999999999999996e103Initial program 88.1%
Taylor expanded in x around inf 88.4%
if -1.59999999999999996e103 < (/.f64 x y) < 3.99999999999999991e123Initial program 88.5%
Taylor expanded in t around 0 99.8%
sub-neg99.8%
metadata-eval99.8%
associate-*r/99.8%
+-commutative99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
distribute-rgt-out99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 88.5%
sub-neg88.5%
associate-*r/88.5%
metadata-eval88.5%
*-commutative88.5%
associate-/r*88.5%
*-rgt-identity88.5%
associate-*r/88.5%
distribute-rgt-in88.5%
associate-*l/88.5%
*-lft-identity88.5%
metadata-eval88.5%
+-commutative88.5%
Simplified88.5%
if 3.99999999999999991e123 < (/.f64 x y) Initial program 73.9%
Taylor expanded in t around inf 89.0%
Final simplification88.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ (/ 2.0 z) t) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 / z) / t) + ((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 ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = ((2.0d0 / z) / t) + ((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 ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 / z) / t) + ((x / y) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = ((2.0 / z) / t) + ((x / y) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(Float64(2.0 / z) / t) + Float64(Float64(x / y) + -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = ((2.0 / z) / t) + ((x / y) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{z}}{t} + \left(\frac{x}{y} + -2\right)\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 74.1%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
distribute-rgt-out100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 99.2%
sub-neg99.2%
associate-*r/99.2%
metadata-eval99.2%
+-commutative99.2%
metadata-eval99.2%
associate-+l+99.2%
Simplified99.2%
if -1 < z < 1Initial program 96.8%
Taylor expanded in t around 0 96.7%
sub-neg96.7%
metadata-eval96.7%
associate-*r/96.7%
+-commutative96.7%
associate-*r/96.7%
metadata-eval96.7%
metadata-eval96.7%
+-commutative96.7%
associate-/l/96.7%
metadata-eval96.7%
associate-*r/96.7%
*-rgt-identity96.7%
associate-*r/96.8%
distribute-rgt-out96.8%
associate-*r/96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in x around 0 96.7%
associate-+r+96.7%
associate-*r/96.7%
metadata-eval96.7%
*-commutative96.7%
associate-/r*96.7%
*-rgt-identity96.7%
associate-*r/96.8%
distribute-rgt-in96.8%
associate-*l/96.7%
*-lft-identity96.7%
associate--l+96.7%
sub-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in z around 0 95.3%
Final simplification97.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.8e-62) (not (<= t 1.38e-160))) (+ (/ x y) -2.0) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.8e-62) || !(t <= 1.38e-160)) {
tmp = (x / y) + -2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2.8d-62)) .or. (.not. (t <= 1.38d-160))) then
tmp = (x / y) + (-2.0d0)
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.8e-62) || !(t <= 1.38e-160)) {
tmp = (x / y) + -2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.8e-62) or not (t <= 1.38e-160): tmp = (x / y) + -2.0 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.8e-62) || !(t <= 1.38e-160)) tmp = Float64(Float64(x / y) + -2.0); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.8e-62) || ~((t <= 1.38e-160))) tmp = (x / y) + -2.0; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.8e-62], N[Not[LessEqual[t, 1.38e-160]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-62} \lor \neg \left(t \leq 1.38 \cdot 10^{-160}\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if t < -2.80000000000000002e-62 or 1.38e-160 < t Initial program 81.0%
Taylor expanded in t around inf 73.8%
if -2.80000000000000002e-62 < t < 1.38e-160Initial program 96.1%
Taylor expanded in t around 0 87.7%
associate-*r/87.7%
metadata-eval87.7%
Simplified87.7%
Taylor expanded in z around inf 47.1%
Final simplification65.4%
(FPCore (x y z t) :precision binary64 (if (<= t -2.05e-6) -2.0 (if (<= t 1.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.05e-6) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.05d-6)) then
tmp = -2.0d0
else if (t <= 1.0d0) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.05e-6) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.05e-6: tmp = -2.0 elif t <= 1.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.05e-6) tmp = -2.0; elseif (t <= 1.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.05e-6) tmp = -2.0; elseif (t <= 1.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.05e-6], -2.0, If[LessEqual[t, 1.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{-6}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -2.0499999999999999e-6 or 1 < t Initial program 77.0%
+-commutative77.0%
remove-double-neg77.0%
distribute-frac-neg77.0%
unsub-neg77.0%
*-commutative77.0%
associate-*r*77.0%
distribute-rgt1-in77.0%
associate-*r/77.0%
/-rgt-identity77.0%
fma-neg77.0%
/-rgt-identity77.0%
*-commutative77.0%
fma-def77.0%
*-commutative77.0%
distribute-frac-neg77.0%
remove-double-neg77.0%
Simplified77.0%
Taylor expanded in x around 0 37.7%
Taylor expanded in t around inf 33.0%
if -2.0499999999999999e-6 < t < 1Initial program 96.4%
Taylor expanded in t around 0 79.6%
associate-*r/79.6%
metadata-eval79.6%
Simplified79.6%
Taylor expanded in z around inf 40.8%
Final simplification36.5%
(FPCore (x y z t) :precision binary64 (+ (/ (+ 2.0 (/ 2.0 z)) t) (+ (/ x y) -2.0)))
double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / t) + ((x / y) + -2.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((2.0d0 + (2.0d0 / z)) / t) + ((x / y) + (-2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / t) + ((x / y) + -2.0);
}
def code(x, y, z, t): return ((2.0 + (2.0 / z)) / t) + ((x / y) + -2.0)
function code(x, y, z, t) return Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + Float64(Float64(x / y) + -2.0)) end
function tmp = code(x, y, z, t) tmp = ((2.0 + (2.0 / z)) / t) + ((x / y) + -2.0); end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 + \frac{2}{z}}{t} + \left(\frac{x}{y} + -2\right)
\end{array}
Initial program 85.8%
Taylor expanded in t around 0 98.3%
sub-neg98.3%
metadata-eval98.3%
associate-*r/98.3%
+-commutative98.3%
associate-*r/98.3%
metadata-eval98.3%
metadata-eval98.3%
+-commutative98.3%
associate-/l/98.3%
metadata-eval98.3%
associate-*r/98.3%
*-rgt-identity98.3%
associate-*r/98.3%
distribute-rgt-out98.3%
associate-*r/98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in x around 0 98.3%
associate-+r+98.3%
associate-*r/98.3%
metadata-eval98.3%
*-commutative98.3%
associate-/r*98.3%
*-rgt-identity98.3%
associate-*r/98.3%
distribute-rgt-in98.3%
associate-*l/98.3%
*-lft-identity98.3%
associate--l+98.3%
sub-neg98.3%
metadata-eval98.3%
Simplified98.3%
Final simplification98.3%
(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 85.8%
+-commutative85.8%
remove-double-neg85.8%
distribute-frac-neg85.8%
unsub-neg85.8%
*-commutative85.8%
associate-*r*85.8%
distribute-rgt1-in85.8%
associate-*r/85.7%
/-rgt-identity85.7%
fma-neg85.7%
/-rgt-identity85.7%
*-commutative85.7%
fma-def85.7%
*-commutative85.7%
distribute-frac-neg85.7%
remove-double-neg85.7%
Simplified85.7%
Taylor expanded in x around 0 56.9%
Taylor expanded in t around inf 19.1%
Final simplification19.1%
(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 2024029
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))