
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (+ (/ x y) (- (/ (+ 2.0 (/ 2.0 z)) t) 2.0)))
double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) - 2.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + (((2.0d0 + (2.0d0 / z)) / t) - 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) - 2.0);
}
def code(x, y, z, t): return (x / y) + (((2.0 + (2.0 / z)) / t) - 2.0)
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) - 2.0)) end
function tmp = code(x, y, z, t) tmp = (x / y) + (((2.0 + (2.0 / z)) / t) - 2.0); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2 + \frac{2}{z}}{t} - 2\right)
\end{array}
Initial program 83.5%
+-commutative83.5%
remove-double-neg83.5%
distribute-frac-neg83.5%
unsub-neg83.5%
*-commutative83.5%
associate-*r*83.5%
distribute-rgt1-in83.5%
associate-/l*83.4%
fma-neg83.4%
*-commutative83.4%
fma-define83.4%
*-commutative83.4%
distribute-frac-neg83.4%
remove-double-neg83.4%
Simplified83.4%
Taylor expanded in t around inf 99.5%
+-commutative99.5%
associate--l+99.5%
associate-*r/99.5%
distribute-lft-in99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* z t))) (t_2 (- (/ x y) 2.0)))
(if (<= t -4.3e-53)
t_2
(if (<= t -1e-121)
t_1
(if (<= t -7.2e-178)
t_2
(if (<= t 5.2e-298)
t_1
(if (<= t 1.95e-272)
(/ 2.0 t)
(if (<= t 3.25e-233)
t_1
(if (<= t 3.9e-110) (/ 2.0 t) t_2)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -4.3e-53) {
tmp = t_2;
} else if (t <= -1e-121) {
tmp = t_1;
} else if (t <= -7.2e-178) {
tmp = t_2;
} else if (t <= 5.2e-298) {
tmp = t_1;
} else if (t <= 1.95e-272) {
tmp = 2.0 / t;
} else if (t <= 3.25e-233) {
tmp = t_1;
} else if (t <= 3.9e-110) {
tmp = 2.0 / t;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 / (z * t)
t_2 = (x / y) - 2.0d0
if (t <= (-4.3d-53)) then
tmp = t_2
else if (t <= (-1d-121)) then
tmp = t_1
else if (t <= (-7.2d-178)) then
tmp = t_2
else if (t <= 5.2d-298) then
tmp = t_1
else if (t <= 1.95d-272) then
tmp = 2.0d0 / t
else if (t <= 3.25d-233) then
tmp = t_1
else if (t <= 3.9d-110) then
tmp = 2.0d0 / t
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -4.3e-53) {
tmp = t_2;
} else if (t <= -1e-121) {
tmp = t_1;
} else if (t <= -7.2e-178) {
tmp = t_2;
} else if (t <= 5.2e-298) {
tmp = t_1;
} else if (t <= 1.95e-272) {
tmp = 2.0 / t;
} else if (t <= 3.25e-233) {
tmp = t_1;
} else if (t <= 3.9e-110) {
tmp = 2.0 / t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (z * t) t_2 = (x / y) - 2.0 tmp = 0 if t <= -4.3e-53: tmp = t_2 elif t <= -1e-121: tmp = t_1 elif t <= -7.2e-178: tmp = t_2 elif t <= 5.2e-298: tmp = t_1 elif t <= 1.95e-272: tmp = 2.0 / t elif t <= 3.25e-233: tmp = t_1 elif t <= 3.9e-110: tmp = 2.0 / t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(z * t)) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -4.3e-53) tmp = t_2; elseif (t <= -1e-121) tmp = t_1; elseif (t <= -7.2e-178) tmp = t_2; elseif (t <= 5.2e-298) tmp = t_1; elseif (t <= 1.95e-272) tmp = Float64(2.0 / t); elseif (t <= 3.25e-233) tmp = t_1; elseif (t <= 3.9e-110) tmp = Float64(2.0 / t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (z * t); t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -4.3e-53) tmp = t_2; elseif (t <= -1e-121) tmp = t_1; elseif (t <= -7.2e-178) tmp = t_2; elseif (t <= 5.2e-298) tmp = t_1; elseif (t <= 1.95e-272) tmp = 2.0 / t; elseif (t <= 3.25e-233) tmp = t_1; elseif (t <= 3.9e-110) tmp = 2.0 / t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -4.3e-53], t$95$2, If[LessEqual[t, -1e-121], t$95$1, If[LessEqual[t, -7.2e-178], t$95$2, If[LessEqual[t, 5.2e-298], t$95$1, If[LessEqual[t, 1.95e-272], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 3.25e-233], t$95$1, If[LessEqual[t, 3.9e-110], N[(2.0 / t), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z \cdot t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{-53}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7.2 \cdot 10^{-178}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-298}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-272}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 3.25 \cdot 10^{-233}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-110}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -4.3e-53 or -9.9999999999999998e-122 < t < -7.19999999999999987e-178 or 3.9e-110 < t Initial program 76.4%
Taylor expanded in t around inf 81.9%
if -4.3e-53 < t < -9.9999999999999998e-122 or -7.19999999999999987e-178 < t < 5.1999999999999998e-298 or 1.9499999999999999e-272 < t < 3.24999999999999995e-233Initial program 97.9%
+-commutative97.9%
remove-double-neg97.9%
distribute-frac-neg97.9%
unsub-neg97.9%
*-commutative97.9%
associate-*r*97.9%
distribute-rgt1-in97.9%
associate-/l*97.9%
fma-neg97.8%
*-commutative97.8%
fma-define97.8%
*-commutative97.8%
distribute-frac-neg97.8%
remove-double-neg97.8%
Simplified97.8%
Taylor expanded in t around inf 97.9%
+-commutative97.9%
associate--l+97.9%
associate-*r/97.9%
distribute-lft-in97.9%
metadata-eval97.9%
associate-*r/97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in z around 0 65.0%
if 5.1999999999999998e-298 < t < 1.9499999999999999e-272 or 3.24999999999999995e-233 < t < 3.9e-110Initial program 99.8%
Taylor expanded in t around 0 96.8%
associate-*r/96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in z around inf 69.5%
Final simplification77.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ 2.0 t) z)) (t_2 (- (/ x y) 2.0)))
(if (<= t -1.58e-55)
t_2
(if (<= t -4.2e-117)
t_1
(if (<= t -2e-179)
t_2
(if (<= t 5e-297)
(/ 2.0 (* z t))
(if (<= t 1.1e-272)
(/ 2.0 t)
(if (<= t 1.5e-232)
t_1
(if (<= t 1.02e-110) (/ 2.0 t) t_2)))))))))
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 <= -1.58e-55) {
tmp = t_2;
} else if (t <= -4.2e-117) {
tmp = t_1;
} else if (t <= -2e-179) {
tmp = t_2;
} else if (t <= 5e-297) {
tmp = 2.0 / (z * t);
} else if (t <= 1.1e-272) {
tmp = 2.0 / t;
} else if (t <= 1.5e-232) {
tmp = t_1;
} else if (t <= 1.02e-110) {
tmp = 2.0 / t;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (2.0d0 / t) / z
t_2 = (x / y) - 2.0d0
if (t <= (-1.58d-55)) then
tmp = t_2
else if (t <= (-4.2d-117)) then
tmp = t_1
else if (t <= (-2d-179)) then
tmp = t_2
else if (t <= 5d-297) then
tmp = 2.0d0 / (z * t)
else if (t <= 1.1d-272) then
tmp = 2.0d0 / t
else if (t <= 1.5d-232) then
tmp = t_1
else if (t <= 1.02d-110) then
tmp = 2.0d0 / t
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 / t) / z;
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -1.58e-55) {
tmp = t_2;
} else if (t <= -4.2e-117) {
tmp = t_1;
} else if (t <= -2e-179) {
tmp = t_2;
} else if (t <= 5e-297) {
tmp = 2.0 / (z * t);
} else if (t <= 1.1e-272) {
tmp = 2.0 / t;
} else if (t <= 1.5e-232) {
tmp = t_1;
} else if (t <= 1.02e-110) {
tmp = 2.0 / t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / t) / z t_2 = (x / y) - 2.0 tmp = 0 if t <= -1.58e-55: tmp = t_2 elif t <= -4.2e-117: tmp = t_1 elif t <= -2e-179: tmp = t_2 elif t <= 5e-297: tmp = 2.0 / (z * t) elif t <= 1.1e-272: tmp = 2.0 / t elif t <= 1.5e-232: tmp = t_1 elif t <= 1.02e-110: tmp = 2.0 / t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / t) / z) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -1.58e-55) tmp = t_2; elseif (t <= -4.2e-117) tmp = t_1; elseif (t <= -2e-179) tmp = t_2; elseif (t <= 5e-297) tmp = Float64(2.0 / Float64(z * t)); elseif (t <= 1.1e-272) tmp = Float64(2.0 / t); elseif (t <= 1.5e-232) tmp = t_1; elseif (t <= 1.02e-110) tmp = Float64(2.0 / t); else tmp = t_2; 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 <= -1.58e-55) tmp = t_2; elseif (t <= -4.2e-117) tmp = t_1; elseif (t <= -2e-179) tmp = t_2; elseif (t <= 5e-297) tmp = 2.0 / (z * t); elseif (t <= 1.1e-272) tmp = 2.0 / t; elseif (t <= 1.5e-232) tmp = t_1; elseif (t <= 1.02e-110) tmp = 2.0 / t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.58e-55], t$95$2, If[LessEqual[t, -4.2e-117], t$95$1, If[LessEqual[t, -2e-179], t$95$2, If[LessEqual[t, 5e-297], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.1e-272], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 1.5e-232], t$95$1, If[LessEqual[t, 1.02e-110], N[(2.0 / t), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{2}{t}}{z}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1.58 \cdot 10^{-55}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -4.2 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-179}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-297}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-272}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-232}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-110}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.58000000000000007e-55 or -4.1999999999999998e-117 < t < -2e-179 or 1.02000000000000006e-110 < t Initial program 76.4%
Taylor expanded in t around inf 81.9%
if -1.58000000000000007e-55 < t < -4.1999999999999998e-117 or 1.09999999999999994e-272 < t < 1.49999999999999995e-232Initial program 99.7%
+-commutative99.7%
frac-2neg99.7%
frac-add91.1%
+-commutative91.1%
fma-define91.1%
*-commutative91.1%
*-commutative91.1%
*-commutative91.1%
Applied egg-rr91.1%
Taylor expanded in t around 0 90.0%
Taylor expanded in z around 0 68.6%
associate-/r*68.7%
Simplified68.7%
if -2e-179 < t < 5e-297Initial program 96.4%
+-commutative96.4%
remove-double-neg96.4%
distribute-frac-neg96.4%
unsub-neg96.4%
*-commutative96.4%
associate-*r*96.4%
distribute-rgt1-in96.4%
associate-/l*96.4%
fma-neg96.4%
*-commutative96.4%
fma-define96.4%
*-commutative96.4%
distribute-frac-neg96.4%
remove-double-neg96.4%
Simplified96.4%
Taylor expanded in t around inf 96.4%
+-commutative96.4%
associate--l+96.4%
associate-*r/96.4%
distribute-lft-in96.4%
metadata-eval96.4%
associate-*r/96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in z around 0 62.1%
if 5e-297 < t < 1.09999999999999994e-272 or 1.49999999999999995e-232 < t < 1.02000000000000006e-110Initial program 99.8%
Taylor expanded in t around 0 96.8%
associate-*r/96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in z around inf 69.5%
Final simplification77.0%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -5.8e+30)
(/ x y)
(if (<= (/ x y) -2.15e-27)
(/ 2.0 t)
(if (<= (/ x y) 2.65e-20)
-2.0
(if (<= (/ x y) 1.6e+26) (/ 2.0 t) (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5.8e+30) {
tmp = x / y;
} else if ((x / y) <= -2.15e-27) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.65e-20) {
tmp = -2.0;
} else if ((x / y) <= 1.6e+26) {
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) <= (-5.8d+30)) then
tmp = x / y
else if ((x / y) <= (-2.15d-27)) then
tmp = 2.0d0 / t
else if ((x / y) <= 2.65d-20) then
tmp = -2.0d0
else if ((x / y) <= 1.6d+26) 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) <= -5.8e+30) {
tmp = x / y;
} else if ((x / y) <= -2.15e-27) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.65e-20) {
tmp = -2.0;
} else if ((x / y) <= 1.6e+26) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5.8e+30: tmp = x / y elif (x / y) <= -2.15e-27: tmp = 2.0 / t elif (x / y) <= 2.65e-20: tmp = -2.0 elif (x / y) <= 1.6e+26: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5.8e+30) tmp = Float64(x / y); elseif (Float64(x / y) <= -2.15e-27) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2.65e-20) tmp = -2.0; elseif (Float64(x / y) <= 1.6e+26) 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) <= -5.8e+30) tmp = x / y; elseif ((x / y) <= -2.15e-27) tmp = 2.0 / t; elseif ((x / y) <= 2.65e-20) tmp = -2.0; elseif ((x / y) <= 1.6e+26) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5.8e+30], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2.15e-27], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.65e-20], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 1.6e+26], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5.8 \cdot 10^{+30}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -2.15 \cdot 10^{-27}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2.65 \cdot 10^{-20}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.6 \cdot 10^{+26}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -5.7999999999999996e30 or 1.60000000000000014e26 < (/.f64 x y) Initial program 78.4%
Taylor expanded in x around inf 79.8%
if -5.7999999999999996e30 < (/.f64 x y) < -2.15000000000000001e-27 or 2.6500000000000001e-20 < (/.f64 x y) < 1.60000000000000014e26Initial program 99.7%
Taylor expanded in t around 0 87.3%
associate-*r/87.3%
metadata-eval87.3%
Simplified87.3%
Taylor expanded in z around inf 51.8%
if -2.15000000000000001e-27 < (/.f64 x y) < 2.6500000000000001e-20Initial program 85.2%
Taylor expanded in t around inf 48.3%
Taylor expanded in x around 0 48.3%
Final simplification62.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- -2.0 (/ -2.0 (* z t)))) (t_2 (+ (/ x y) (+ (/ 2.0 t) -2.0))))
(if (<= z -1.9e-9)
t_2
(if (<= z 2.1e-225)
t_1
(if (<= z 6.2e-133) (- (/ x y) 2.0) (if (<= z 9e-29) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 - (-2.0 / (z * t));
double t_2 = (x / y) + ((2.0 / t) + -2.0);
double tmp;
if (z <= -1.9e-9) {
tmp = t_2;
} else if (z <= 2.1e-225) {
tmp = t_1;
} else if (z <= 6.2e-133) {
tmp = (x / y) - 2.0;
} else if (z <= 9e-29) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) - ((-2.0d0) / (z * t))
t_2 = (x / y) + ((2.0d0 / t) + (-2.0d0))
if (z <= (-1.9d-9)) then
tmp = t_2
else if (z <= 2.1d-225) then
tmp = t_1
else if (z <= 6.2d-133) then
tmp = (x / y) - 2.0d0
else if (z <= 9d-29) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 - (-2.0 / (z * t));
double t_2 = (x / y) + ((2.0 / t) + -2.0);
double tmp;
if (z <= -1.9e-9) {
tmp = t_2;
} else if (z <= 2.1e-225) {
tmp = t_1;
} else if (z <= 6.2e-133) {
tmp = (x / y) - 2.0;
} else if (z <= 9e-29) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 - (-2.0 / (z * t)) t_2 = (x / y) + ((2.0 / t) + -2.0) tmp = 0 if z <= -1.9e-9: tmp = t_2 elif z <= 2.1e-225: tmp = t_1 elif z <= 6.2e-133: tmp = (x / y) - 2.0 elif z <= 9e-29: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 - Float64(-2.0 / Float64(z * t))) t_2 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)) tmp = 0.0 if (z <= -1.9e-9) tmp = t_2; elseif (z <= 2.1e-225) tmp = t_1; elseif (z <= 6.2e-133) tmp = Float64(Float64(x / y) - 2.0); elseif (z <= 9e-29) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 - (-2.0 / (z * t)); t_2 = (x / y) + ((2.0 / t) + -2.0); tmp = 0.0; if (z <= -1.9e-9) tmp = t_2; elseif (z <= 2.1e-225) tmp = t_1; elseif (z <= 6.2e-133) tmp = (x / y) - 2.0; elseif (z <= 9e-29) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 - N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e-9], t$95$2, If[LessEqual[z, 2.1e-225], t$95$1, If[LessEqual[z, 6.2e-133], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[z, 9e-29], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 - \frac{-2}{z \cdot t}\\
t_2 := \frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-225}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-133}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.90000000000000006e-9 or 8.9999999999999996e-29 < z Initial program 72.4%
Taylor expanded in z around inf 98.2%
div-sub98.2%
sub-neg98.2%
*-inverses98.2%
metadata-eval98.2%
distribute-lft-in98.2%
associate-*r/98.2%
metadata-eval98.2%
metadata-eval98.2%
Simplified98.2%
if -1.90000000000000006e-9 < z < 2.1e-225 or 6.20000000000000032e-133 < z < 8.9999999999999996e-29Initial program 98.9%
+-commutative98.9%
remove-double-neg98.9%
distribute-frac-neg98.9%
unsub-neg98.9%
*-commutative98.9%
associate-*r*98.9%
distribute-rgt1-in98.9%
associate-/l*98.8%
fma-neg98.8%
*-commutative98.8%
fma-define98.8%
*-commutative98.8%
distribute-frac-neg98.8%
remove-double-neg98.8%
Simplified98.8%
Taylor expanded in t around inf 98.9%
+-commutative98.9%
associate--l+98.9%
associate-*r/98.9%
distribute-lft-in98.9%
metadata-eval98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around 0 98.5%
Taylor expanded in x around 0 78.0%
sub-neg78.0%
associate-*r/78.0%
metadata-eval78.0%
*-commutative78.0%
metadata-eval78.0%
+-commutative78.0%
metadata-eval78.0%
distribute-neg-frac78.0%
unsub-neg78.0%
*-commutative78.0%
Simplified78.0%
if 2.1e-225 < z < 6.20000000000000032e-133Initial program 100.0%
Taylor expanded in t around inf 87.9%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+38) (not (<= (/ x y) 6.5e+25))) (/ x y) (- -2.0 (/ -2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+38) || !((x / y) <= 6.5e+25)) {
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) <= (-1d+38)) .or. (.not. ((x / y) <= 6.5d+25))) 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) <= -1e+38) || !((x / y) <= 6.5e+25)) {
tmp = x / y;
} else {
tmp = -2.0 - (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+38) or not ((x / y) <= 6.5e+25): 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) <= -1e+38) || !(Float64(x / y) <= 6.5e+25)) tmp = Float64(x / y); else tmp = Float64(-2.0 - Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+38) || ~(((x / y) <= 6.5e+25))) 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], -1e+38], N[Not[LessEqual[N[(x / y), $MachinePrecision], 6.5e+25]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 - N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+38} \lor \neg \left(\frac{x}{y} \leq 6.5 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 - \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999977e37 or 6.50000000000000005e25 < (/.f64 x y) Initial program 78.2%
Taylor expanded in x around inf 80.5%
if -9.99999999999999977e37 < (/.f64 x y) < 6.50000000000000005e25Initial program 87.5%
+-commutative87.5%
remove-double-neg87.5%
distribute-frac-neg87.5%
unsub-neg87.5%
*-commutative87.5%
associate-*r*87.5%
distribute-rgt1-in87.5%
associate-/l*87.4%
fma-neg87.4%
*-commutative87.4%
fma-define87.4%
*-commutative87.4%
distribute-frac-neg87.4%
remove-double-neg87.4%
Simplified87.4%
Taylor expanded in t around inf 99.9%
+-commutative99.9%
associate--l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 75.3%
Taylor expanded in x around 0 74.0%
sub-neg74.0%
associate-*r/74.0%
metadata-eval74.0%
*-commutative74.0%
metadata-eval74.0%
+-commutative74.0%
metadata-eval74.0%
distribute-neg-frac74.0%
unsub-neg74.0%
*-commutative74.0%
Simplified74.0%
Final simplification76.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -90000000000000.0) (not (<= z 1.0))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (- (/ (/ 2.0 z) t) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -90000000000000.0) || !(z <= 1.0)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (((2.0 / z) / t) - 2.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-90000000000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + (((2.0d0 / z) / t) - 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -90000000000000.0) || !(z <= 1.0)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (((2.0 / z) / t) - 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -90000000000000.0) or not (z <= 1.0): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + (((2.0 / z) / t) - 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -90000000000000.0) || !(z <= 1.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(Float64(Float64(2.0 / z) / t) - 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -90000000000000.0) || ~((z <= 1.0))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + (((2.0 / z) / t) - 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -90000000000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -90000000000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(\frac{\frac{2}{z}}{t} - 2\right)\\
\end{array}
\end{array}
if z < -9e13 or 1 < z Initial program 70.0%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
if -9e13 < z < 1Initial program 99.0%
+-commutative99.0%
remove-double-neg99.0%
distribute-frac-neg99.0%
unsub-neg99.0%
*-commutative99.0%
associate-*r*99.0%
distribute-rgt1-in99.0%
associate-/l*99.0%
fma-neg99.0%
*-commutative99.0%
fma-define99.0%
*-commutative99.0%
distribute-frac-neg99.0%
remove-double-neg99.0%
Simplified99.0%
Taylor expanded in t around inf 99.0%
+-commutative99.0%
associate--l+99.0%
associate-*r/99.0%
distribute-lft-in99.0%
metadata-eval99.0%
associate-*r/99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in z around 0 97.7%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.26e-10) (not (<= z 3.3e-115))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.26e-10) || !(z <= 3.3e-115)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.26d-10)) .or. (.not. (z <= 3.3d-115))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.26e-10) || !(z <= 3.3e-115)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.26e-10) or not (z <= 3.3e-115): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.26e-10) || !(z <= 3.3e-115)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.26e-10) || ~((z <= 3.3e-115))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.26e-10], N[Not[LessEqual[z, 3.3e-115]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $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 -1.26 \cdot 10^{-10} \lor \neg \left(z \leq 3.3 \cdot 10^{-115}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -1.26000000000000004e-10 or 3.2999999999999999e-115 < z Initial program 74.9%
Taylor expanded in z around inf 94.6%
div-sub94.6%
sub-neg94.6%
*-inverses94.6%
metadata-eval94.6%
distribute-lft-in94.6%
associate-*r/94.6%
metadata-eval94.6%
metadata-eval94.6%
Simplified94.6%
if -1.26000000000000004e-10 < z < 3.2999999999999999e-115Initial program 99.9%
Taylor expanded in z around 0 88.0%
associate-/r*88.0%
Simplified88.0%
Final simplification92.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8e-45) (not (<= t 1150000000.0))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8e-45) || !(t <= 1150000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-8d-45)) .or. (.not. (t <= 1150000000.0d0))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 + (2.0d0 / z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8e-45) || !(t <= 1150000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8e-45) or not (t <= 1150000000.0): tmp = (x / y) - 2.0 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8e-45) || !(t <= 1150000000.0)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8e-45) || ~((t <= 1150000000.0))) tmp = (x / y) - 2.0; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8e-45], N[Not[LessEqual[t, 1150000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-45} \lor \neg \left(t \leq 1150000000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -7.99999999999999987e-45 or 1.15e9 < t Initial program 71.1%
Taylor expanded in t around inf 90.1%
if -7.99999999999999987e-45 < t < 1.15e9Initial program 98.9%
Taylor expanded in t around 0 82.0%
associate-*r/82.0%
metadata-eval82.0%
Simplified82.0%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.9e-179) (not (<= t 2e-111))) (- (/ x y) 2.0) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.9e-179) || !(t <= 2e-111)) {
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.9d-179)) .or. (.not. (t <= 2d-111))) 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.9e-179) || !(t <= 2e-111)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.9e-179) or not (t <= 2e-111): tmp = (x / y) - 2.0 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.9e-179) || !(t <= 2e-111)) 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.9e-179) || ~((t <= 2e-111))) 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.9e-179], N[Not[LessEqual[t, 2e-111]], $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.9 \cdot 10^{-179} \lor \neg \left(t \leq 2 \cdot 10^{-111}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if t < -2.8999999999999999e-179 or 2.00000000000000018e-111 < t Initial program 78.3%
Taylor expanded in t around inf 76.3%
if -2.8999999999999999e-179 < t < 2.00000000000000018e-111Initial program 98.3%
Taylor expanded in t around 0 94.0%
associate-*r/94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in z around inf 47.8%
Final simplification68.9%
(FPCore (x y z t) :precision binary64 (if (<= t -3.55e+25) -2.0 (if (<= t 4400000.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.55e+25) {
tmp = -2.0;
} else if (t <= 4400000.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 <= (-3.55d+25)) then
tmp = -2.0d0
else if (t <= 4400000.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 <= -3.55e+25) {
tmp = -2.0;
} else if (t <= 4400000.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.55e+25: tmp = -2.0 elif t <= 4400000.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.55e+25) tmp = -2.0; elseif (t <= 4400000.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 <= -3.55e+25) tmp = -2.0; elseif (t <= 4400000.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.55e+25], -2.0, If[LessEqual[t, 4400000.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.55 \cdot 10^{+25}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 4400000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -3.5500000000000001e25 or 4.4e6 < t Initial program 68.4%
Taylor expanded in t around inf 92.4%
Taylor expanded in x around 0 46.5%
if -3.5500000000000001e25 < t < 4.4e6Initial program 99.0%
Taylor expanded in t around 0 77.7%
associate-*r/77.7%
metadata-eval77.7%
Simplified77.7%
Taylor expanded in z around inf 35.0%
Final simplification40.8%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 83.5%
Taylor expanded in t around inf 59.0%
Taylor expanded in x around 0 24.8%
Final simplification24.8%
(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 2024043
(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))))