
(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 (+ (+ (/ 2.0 t) (+ (/ 2.0 (* t z)) (/ x y))) -2.0))
double code(double x, double y, double z, double t) {
return ((2.0 / t) + ((2.0 / (t * z)) + (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 / t) + ((2.0d0 / (t * z)) + (x / y))) + (-2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 / t) + ((2.0 / (t * z)) + (x / y))) + -2.0;
}
def code(x, y, z, t): return ((2.0 / t) + ((2.0 / (t * z)) + (x / y))) + -2.0
function code(x, y, z, t) return Float64(Float64(Float64(2.0 / t) + Float64(Float64(2.0 / Float64(t * z)) + Float64(x / y))) + -2.0) end
function tmp = code(x, y, z, t) tmp = ((2.0 / t) + ((2.0 / (t * z)) + (x / y))) + -2.0; end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 / t), $MachinePrecision] + N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{2}{t} + \left(\frac{2}{t \cdot z} + \frac{x}{y}\right)\right) + -2
\end{array}
Initial program 87.3%
Taylor expanded in t around 0 98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ 2.0 t) (/ x y)))
(t_2 (/ 2.0 (* t z)))
(t_3 (- (/ x y) 2.0)))
(if (<= t -1.0)
t_3
(if (<= t -5.8e-247)
t_1
(if (<= t -1.42e-300)
t_2
(if (<= t 5e-258)
(/ 2.0 t)
(if (<= t 7.2e-156)
t_2
(if (<= t 1.3e-90)
t_1
(if (<= t 1.9e-66) t_2 (if (<= t 6.4e-17) t_1 t_3))))))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / t) + (x / y);
double t_2 = 2.0 / (t * z);
double t_3 = (x / y) - 2.0;
double tmp;
if (t <= -1.0) {
tmp = t_3;
} else if (t <= -5.8e-247) {
tmp = t_1;
} else if (t <= -1.42e-300) {
tmp = t_2;
} else if (t <= 5e-258) {
tmp = 2.0 / t;
} else if (t <= 7.2e-156) {
tmp = t_2;
} else if (t <= 1.3e-90) {
tmp = t_1;
} else if (t <= 1.9e-66) {
tmp = t_2;
} else if (t <= 6.4e-17) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (2.0d0 / t) + (x / y)
t_2 = 2.0d0 / (t * z)
t_3 = (x / y) - 2.0d0
if (t <= (-1.0d0)) then
tmp = t_3
else if (t <= (-5.8d-247)) then
tmp = t_1
else if (t <= (-1.42d-300)) then
tmp = t_2
else if (t <= 5d-258) then
tmp = 2.0d0 / t
else if (t <= 7.2d-156) then
tmp = t_2
else if (t <= 1.3d-90) then
tmp = t_1
else if (t <= 1.9d-66) then
tmp = t_2
else if (t <= 6.4d-17) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 / t) + (x / y);
double t_2 = 2.0 / (t * z);
double t_3 = (x / y) - 2.0;
double tmp;
if (t <= -1.0) {
tmp = t_3;
} else if (t <= -5.8e-247) {
tmp = t_1;
} else if (t <= -1.42e-300) {
tmp = t_2;
} else if (t <= 5e-258) {
tmp = 2.0 / t;
} else if (t <= 7.2e-156) {
tmp = t_2;
} else if (t <= 1.3e-90) {
tmp = t_1;
} else if (t <= 1.9e-66) {
tmp = t_2;
} else if (t <= 6.4e-17) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / t) + (x / y) t_2 = 2.0 / (t * z) t_3 = (x / y) - 2.0 tmp = 0 if t <= -1.0: tmp = t_3 elif t <= -5.8e-247: tmp = t_1 elif t <= -1.42e-300: tmp = t_2 elif t <= 5e-258: tmp = 2.0 / t elif t <= 7.2e-156: tmp = t_2 elif t <= 1.3e-90: tmp = t_1 elif t <= 1.9e-66: tmp = t_2 elif t <= 6.4e-17: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / t) + Float64(x / y)) t_2 = Float64(2.0 / Float64(t * z)) t_3 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -1.0) tmp = t_3; elseif (t <= -5.8e-247) tmp = t_1; elseif (t <= -1.42e-300) tmp = t_2; elseif (t <= 5e-258) tmp = Float64(2.0 / t); elseif (t <= 7.2e-156) tmp = t_2; elseif (t <= 1.3e-90) tmp = t_1; elseif (t <= 1.9e-66) tmp = t_2; elseif (t <= 6.4e-17) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / t) + (x / y); t_2 = 2.0 / (t * z); t_3 = (x / y) - 2.0; tmp = 0.0; if (t <= -1.0) tmp = t_3; elseif (t <= -5.8e-247) tmp = t_1; elseif (t <= -1.42e-300) tmp = t_2; elseif (t <= 5e-258) tmp = 2.0 / t; elseif (t <= 7.2e-156) tmp = t_2; elseif (t <= 1.3e-90) tmp = t_1; elseif (t <= 1.9e-66) tmp = t_2; elseif (t <= 6.4e-17) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.0], t$95$3, If[LessEqual[t, -5.8e-247], t$95$1, If[LessEqual[t, -1.42e-300], t$95$2, If[LessEqual[t, 5e-258], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 7.2e-156], t$95$2, If[LessEqual[t, 1.3e-90], t$95$1, If[LessEqual[t, 1.9e-66], t$95$2, If[LessEqual[t, 6.4e-17], t$95$1, t$95$3]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t} + \frac{x}{y}\\
t_2 := \frac{2}{t \cdot z}\\
t_3 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -5.8 \cdot 10^{-247}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.42 \cdot 10^{-300}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-258}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-156}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-66}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -1 or 6.4000000000000005e-17 < t Initial program 74.0%
Taylor expanded in t around inf 88.4%
if -1 < t < -5.8e-247 or 7.19999999999999998e-156 < t < 1.3e-90 or 1.8999999999999999e-66 < t < 6.4000000000000005e-17Initial program 98.7%
Taylor expanded in z around inf 70.0%
associate-*r/70.0%
associate-/l*70.0%
Simplified70.0%
Taylor expanded in t around 0 69.6%
if -5.8e-247 < t < -1.42e-300 or 4.9999999999999999e-258 < t < 7.19999999999999998e-156 or 1.3e-90 < t < 1.8999999999999999e-66Initial program 95.3%
Taylor expanded in z around 0 75.4%
Taylor expanded in x around 0 75.4%
if -1.42e-300 < t < 4.9999999999999999e-258Initial program 91.9%
Taylor expanded in t around 0 100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 69.9%
Final simplification78.6%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -1.16e+59)
(/ x y)
(if (<= (/ x y) -6.4e-18)
(/ 2.0 t)
(if (<= (/ x y) -1.55e-220)
-2.0
(if (<= (/ x y) 2.8e-181)
(/ 2.0 t)
(if (<= (/ x y) 2500.0) -2.0 (/ x y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.16e+59) {
tmp = x / y;
} else if ((x / y) <= -6.4e-18) {
tmp = 2.0 / t;
} else if ((x / y) <= -1.55e-220) {
tmp = -2.0;
} else if ((x / y) <= 2.8e-181) {
tmp = 2.0 / t;
} else if ((x / y) <= 2500.0) {
tmp = -2.0;
} 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) <= (-1.16d+59)) then
tmp = x / y
else if ((x / y) <= (-6.4d-18)) then
tmp = 2.0d0 / t
else if ((x / y) <= (-1.55d-220)) then
tmp = -2.0d0
else if ((x / y) <= 2.8d-181) then
tmp = 2.0d0 / t
else if ((x / y) <= 2500.0d0) then
tmp = -2.0d0
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) <= -1.16e+59) {
tmp = x / y;
} else if ((x / y) <= -6.4e-18) {
tmp = 2.0 / t;
} else if ((x / y) <= -1.55e-220) {
tmp = -2.0;
} else if ((x / y) <= 2.8e-181) {
tmp = 2.0 / t;
} else if ((x / y) <= 2500.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.16e+59: tmp = x / y elif (x / y) <= -6.4e-18: tmp = 2.0 / t elif (x / y) <= -1.55e-220: tmp = -2.0 elif (x / y) <= 2.8e-181: tmp = 2.0 / t elif (x / y) <= 2500.0: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.16e+59) tmp = Float64(x / y); elseif (Float64(x / y) <= -6.4e-18) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= -1.55e-220) tmp = -2.0; elseif (Float64(x / y) <= 2.8e-181) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2500.0) tmp = -2.0; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1.16e+59) tmp = x / y; elseif ((x / y) <= -6.4e-18) tmp = 2.0 / t; elseif ((x / y) <= -1.55e-220) tmp = -2.0; elseif ((x / y) <= 2.8e-181) tmp = 2.0 / t; elseif ((x / y) <= 2500.0) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.16e+59], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -6.4e-18], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1.55e-220], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 2.8e-181], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2500.0], -2.0, N[(x / y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.16 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -6.4 \cdot 10^{-18}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq -1.55 \cdot 10^{-220}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 2.8 \cdot 10^{-181}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2500:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.16000000000000001e59 or 2500 < (/.f64 x y) Initial program 87.1%
Taylor expanded in x around inf 72.7%
if -1.16000000000000001e59 < (/.f64 x y) < -6.3999999999999998e-18 or -1.55000000000000006e-220 < (/.f64 x y) < 2.79999999999999986e-181Initial program 93.2%
Taylor expanded in t around 0 78.6%
associate-*r/78.6%
metadata-eval78.6%
Simplified78.6%
Taylor expanded in z around inf 42.3%
if -6.3999999999999998e-18 < (/.f64 x y) < -1.55000000000000006e-220 or 2.79999999999999986e-181 < (/.f64 x y) < 2500Initial program 82.4%
Taylor expanded in t around inf 39.2%
Taylor expanded in x around 0 39.2%
Final simplification56.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.5) (not (<= (/ x y) 2500.0))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* t z))) (+ -2.0 (+ (/ 2.0 t) (/ 2.0 (* t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.5) || !((x / y) <= 2500.0)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else {
tmp = -2.0 + ((2.0 / t) + (2.0 / (t * z)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-2.5d0)) .or. (.not. ((x / y) <= 2500.0d0))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (t * z))
else
tmp = (-2.0d0) + ((2.0d0 / t) + (2.0d0 / (t * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.5) || !((x / y) <= 2500.0)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else {
tmp = -2.0 + ((2.0 / t) + (2.0 / (t * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2.5) or not ((x / y) <= 2500.0): tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)) else: tmp = -2.0 + ((2.0 / t) + (2.0 / (t * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2.5) || !(Float64(x / y) <= 2500.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(t * z))); else tmp = Float64(-2.0 + Float64(Float64(2.0 / t) + Float64(2.0 / Float64(t * z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2.5) || ~(((x / y) <= 2500.0))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)); else tmp = -2.0 + ((2.0 / t) + (2.0 / (t * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2.5], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2500.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.5 \lor \neg \left(\frac{x}{y} \leq 2500\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-2 + \left(\frac{2}{t} + \frac{2}{t \cdot z}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -2.5 or 2500 < (/.f64 x y) Initial program 87.2%
Taylor expanded in t around 0 95.8%
if -2.5 < (/.f64 x y) < 2500Initial program 87.5%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
associate-*r/99.7%
metadata-eval99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z))) (t_2 (- (/ x y) 2.0)))
(if (<= t -3.4e-77)
t_2
(if (<= t -1.5e-119)
t_1
(if (<= t -1.45e-193)
t_2
(if (<= t -6.2e-301)
t_1
(if (<= t 5.9e-258) (/ 2.0 t) (if (<= t 6.2e+18) t_1 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 <= -3.4e-77) {
tmp = t_2;
} else if (t <= -1.5e-119) {
tmp = t_1;
} else if (t <= -1.45e-193) {
tmp = t_2;
} else if (t <= -6.2e-301) {
tmp = t_1;
} else if (t <= 5.9e-258) {
tmp = 2.0 / t;
} else if (t <= 6.2e+18) {
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 / (t * z)
t_2 = (x / y) - 2.0d0
if (t <= (-3.4d-77)) then
tmp = t_2
else if (t <= (-1.5d-119)) then
tmp = t_1
else if (t <= (-1.45d-193)) then
tmp = t_2
else if (t <= (-6.2d-301)) then
tmp = t_1
else if (t <= 5.9d-258) then
tmp = 2.0d0 / t
else if (t <= 6.2d+18) 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 / (t * z);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -3.4e-77) {
tmp = t_2;
} else if (t <= -1.5e-119) {
tmp = t_1;
} else if (t <= -1.45e-193) {
tmp = t_2;
} else if (t <= -6.2e-301) {
tmp = t_1;
} else if (t <= 5.9e-258) {
tmp = 2.0 / t;
} else if (t <= 6.2e+18) {
tmp = t_1;
} 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 <= -3.4e-77: tmp = t_2 elif t <= -1.5e-119: tmp = t_1 elif t <= -1.45e-193: tmp = t_2 elif t <= -6.2e-301: tmp = t_1 elif t <= 5.9e-258: tmp = 2.0 / t elif t <= 6.2e+18: tmp = t_1 else: tmp = t_2 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 <= -3.4e-77) tmp = t_2; elseif (t <= -1.5e-119) tmp = t_1; elseif (t <= -1.45e-193) tmp = t_2; elseif (t <= -6.2e-301) tmp = t_1; elseif (t <= 5.9e-258) tmp = Float64(2.0 / t); elseif (t <= 6.2e+18) tmp = t_1; 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 <= -3.4e-77) tmp = t_2; elseif (t <= -1.5e-119) tmp = t_1; elseif (t <= -1.45e-193) tmp = t_2; elseif (t <= -6.2e-301) tmp = t_1; elseif (t <= 5.9e-258) tmp = 2.0 / t; elseif (t <= 6.2e+18) 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[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -3.4e-77], t$95$2, If[LessEqual[t, -1.5e-119], t$95$1, If[LessEqual[t, -1.45e-193], t$95$2, If[LessEqual[t, -6.2e-301], t$95$1, If[LessEqual[t, 5.9e-258], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 6.2e+18], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t \cdot z}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-77}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-193}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -6.2 \cdot 10^{-301}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.9 \cdot 10^{-258}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -3.39999999999999983e-77 or -1.5000000000000001e-119 < t < -1.45000000000000003e-193 or 6.2e18 < t Initial program 80.1%
Taylor expanded in t around inf 82.4%
if -3.39999999999999983e-77 < t < -1.5000000000000001e-119 or -1.45000000000000003e-193 < t < -6.20000000000000029e-301 or 5.8999999999999997e-258 < t < 6.2e18Initial program 96.8%
Taylor expanded in z around 0 69.0%
Taylor expanded in x around 0 59.0%
if -6.20000000000000029e-301 < t < 5.8999999999999997e-258Initial program 91.9%
Taylor expanded in t around 0 100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 69.9%
Final simplification72.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)) (t_2 (+ -2.0 (+ (/ 2.0 t) (/ x y)))))
(if (<= t -5.5e-77)
t_2
(if (<= t -7.2e-115)
t_1
(if (<= t -1.05e-193) t_2 (if (<= t 6.2e+18) t_1 (- (/ x y) 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = -2.0 + ((2.0 / t) + (x / y));
double tmp;
if (t <= -5.5e-77) {
tmp = t_2;
} else if (t <= -7.2e-115) {
tmp = t_1;
} else if (t <= -1.05e-193) {
tmp = t_2;
} else if (t <= 6.2e+18) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (2.0d0 + (2.0d0 / z)) / t
t_2 = (-2.0d0) + ((2.0d0 / t) + (x / y))
if (t <= (-5.5d-77)) then
tmp = t_2
else if (t <= (-7.2d-115)) then
tmp = t_1
else if (t <= (-1.05d-193)) then
tmp = t_2
else if (t <= 6.2d+18) then
tmp = t_1
else
tmp = (x / y) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = -2.0 + ((2.0 / t) + (x / y));
double tmp;
if (t <= -5.5e-77) {
tmp = t_2;
} else if (t <= -7.2e-115) {
tmp = t_1;
} else if (t <= -1.05e-193) {
tmp = t_2;
} else if (t <= 6.2e+18) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) / t t_2 = -2.0 + ((2.0 / t) + (x / y)) tmp = 0 if t <= -5.5e-77: tmp = t_2 elif t <= -7.2e-115: tmp = t_1 elif t <= -1.05e-193: tmp = t_2 elif t <= 6.2e+18: tmp = t_1 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) / t) t_2 = Float64(-2.0 + Float64(Float64(2.0 / t) + Float64(x / y))) tmp = 0.0 if (t <= -5.5e-77) tmp = t_2; elseif (t <= -7.2e-115) tmp = t_1; elseif (t <= -1.05e-193) tmp = t_2; elseif (t <= 6.2e+18) tmp = t_1; else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + (2.0 / z)) / t; t_2 = -2.0 + ((2.0 / t) + (x / y)); tmp = 0.0; if (t <= -5.5e-77) tmp = t_2; elseif (t <= -7.2e-115) tmp = t_1; elseif (t <= -1.05e-193) tmp = t_2; elseif (t <= 6.2e+18) tmp = t_1; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e-77], t$95$2, If[LessEqual[t, -7.2e-115], t$95$1, If[LessEqual[t, -1.05e-193], t$95$2, If[LessEqual[t, 6.2e+18], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
t_2 := -2 + \left(\frac{2}{t} + \frac{x}{y}\right)\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{-77}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -7.2 \cdot 10^{-115}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{-193}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if t < -5.49999999999999998e-77 or -7.20000000000000018e-115 < t < -1.05e-193Initial program 86.8%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 86.6%
+-commutative86.6%
associate-*r/86.6%
metadata-eval86.6%
Simplified86.6%
if -5.49999999999999998e-77 < t < -7.20000000000000018e-115 or -1.05e-193 < t < 6.2e18Initial program 96.3%
Taylor expanded in t around 0 87.5%
associate-*r/87.5%
metadata-eval87.5%
Simplified87.5%
if 6.2e18 < t Initial program 64.2%
Taylor expanded in t around inf 97.6%
Final simplification88.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -1.0)
t_1
(if (<= t -1.8e-193)
(+ (/ 2.0 t) (/ x y))
(if (<= t 6.2e+18) (/ (+ 2.0 (/ 2.0 z)) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.0) {
tmp = t_1;
} else if (t <= -1.8e-193) {
tmp = (2.0 / t) + (x / y);
} else if (t <= 6.2e+18) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (t <= (-1.0d0)) then
tmp = t_1
else if (t <= (-1.8d-193)) then
tmp = (2.0d0 / t) + (x / y)
else if (t <= 6.2d+18) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.0) {
tmp = t_1;
} else if (t <= -1.8e-193) {
tmp = (2.0 / t) + (x / y);
} else if (t <= 6.2e+18) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -1.0: tmp = t_1 elif t <= -1.8e-193: tmp = (2.0 / t) + (x / y) elif t <= 6.2e+18: tmp = (2.0 + (2.0 / z)) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -1.0) tmp = t_1; elseif (t <= -1.8e-193) tmp = Float64(Float64(2.0 / t) + Float64(x / y)); elseif (t <= 6.2e+18) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -1.0) tmp = t_1; elseif (t <= -1.8e-193) tmp = (2.0 / t) + (x / y); elseif (t <= 6.2e+18) tmp = (2.0 + (2.0 / z)) / t; else tmp = t_1; 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, -1.0], t$95$1, If[LessEqual[t, -1.8e-193], N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+18], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-193}:\\
\;\;\;\;\frac{2}{t} + \frac{x}{y}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+18}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1 or 6.2e18 < t Initial program 72.7%
Taylor expanded in t around inf 91.6%
if -1 < t < -1.7999999999999999e-193Initial program 99.9%
Taylor expanded in z around inf 73.2%
associate-*r/73.2%
associate-/l*73.2%
Simplified73.2%
Taylor expanded in t around 0 72.3%
if -1.7999999999999999e-193 < t < 6.2e18Initial program 96.0%
Taylor expanded in t around 0 87.4%
associate-*r/87.4%
metadata-eval87.4%
Simplified87.4%
Final simplification86.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.00032) (not (<= z 7e-9))) (+ -2.0 (+ (/ 2.0 t) (/ x y))) (+ (/ 2.0 (* t z)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00032) || !(z <= 7e-9)) {
tmp = -2.0 + ((2.0 / t) + (x / y));
} else {
tmp = (2.0 / (t * z)) + (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 ((z <= (-0.00032d0)) .or. (.not. (z <= 7d-9))) then
tmp = (-2.0d0) + ((2.0d0 / t) + (x / y))
else
tmp = (2.0d0 / (t * z)) + (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00032) || !(z <= 7e-9)) {
tmp = -2.0 + ((2.0 / t) + (x / y));
} else {
tmp = (2.0 / (t * z)) + (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.00032) or not (z <= 7e-9): tmp = -2.0 + ((2.0 / t) + (x / y)) else: tmp = (2.0 / (t * z)) + (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.00032) || !(z <= 7e-9)) tmp = Float64(-2.0 + Float64(Float64(2.0 / t) + Float64(x / y))); else tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.00032) || ~((z <= 7e-9))) tmp = -2.0 + ((2.0 / t) + (x / y)); else tmp = (2.0 / (t * z)) + (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.00032], N[Not[LessEqual[z, 7e-9]], $MachinePrecision]], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00032 \lor \neg \left(z \leq 7 \cdot 10^{-9}\right):\\
\;\;\;\;-2 + \left(\frac{2}{t} + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} + \frac{x}{y}\\
\end{array}
\end{array}
if z < -3.20000000000000026e-4 or 6.9999999999999998e-9 < z Initial program 77.9%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
if -3.20000000000000026e-4 < z < 6.9999999999999998e-9Initial program 96.8%
Taylor expanded in z around 0 87.5%
Final simplification93.7%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1e+59) (/ x y) (if (<= (/ x y) 1.6e+15) (+ (/ 2.0 t) -2.0) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1e+59) {
tmp = x / y;
} else if ((x / y) <= 1.6e+15) {
tmp = (2.0 / t) + -2.0;
} 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) <= (-1d+59)) then
tmp = x / y
else if ((x / y) <= 1.6d+15) then
tmp = (2.0d0 / t) + (-2.0d0)
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) <= -1e+59) {
tmp = x / y;
} else if ((x / y) <= 1.6e+15) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1e+59: tmp = x / y elif (x / y) <= 1.6e+15: tmp = (2.0 / t) + -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1e+59) tmp = Float64(x / y); elseif (Float64(x / y) <= 1.6e+15) tmp = Float64(Float64(2.0 / t) + -2.0); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1e+59) tmp = x / y; elseif ((x / y) <= 1.6e+15) tmp = (2.0 / t) + -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1e+59], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.6e+15], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.6 \cdot 10^{+15}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999972e58 or 1.6e15 < (/.f64 x y) Initial program 86.9%
Taylor expanded in x around inf 73.5%
if -9.99999999999999972e58 < (/.f64 x y) < 1.6e15Initial program 87.7%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 62.2%
+-commutative62.2%
associate-*r/62.2%
metadata-eval62.2%
Simplified62.2%
Taylor expanded in x around 0 58.7%
associate-*r/58.7%
metadata-eval58.7%
sub-neg58.7%
metadata-eval58.7%
Simplified58.7%
Final simplification65.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -6.6e+59) (/ x y) (if (<= (/ x y) 2500.0) (+ (/ 2.0 t) -2.0) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -6.6e+59) {
tmp = x / y;
} else if ((x / y) <= 2500.0) {
tmp = (2.0 / t) + -2.0;
} 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) <= (-6.6d+59)) then
tmp = x / y
else if ((x / y) <= 2500.0d0) then
tmp = (2.0d0 / t) + (-2.0d0)
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) <= -6.6e+59) {
tmp = x / y;
} else if ((x / y) <= 2500.0) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -6.6e+59: tmp = x / y elif (x / y) <= 2500.0: tmp = (2.0 / t) + -2.0 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -6.6e+59) tmp = Float64(x / y); elseif (Float64(x / y) <= 2500.0) tmp = Float64(Float64(2.0 / t) + -2.0); 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) <= -6.6e+59) tmp = x / y; elseif ((x / y) <= 2500.0) tmp = (2.0 / t) + -2.0; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -6.6e+59], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2500.0], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -6.6 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2500:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -6.5999999999999999e59Initial program 90.0%
Taylor expanded in x around inf 79.3%
if -6.5999999999999999e59 < (/.f64 x y) < 2500Initial program 87.5%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 61.6%
+-commutative61.6%
associate-*r/61.6%
metadata-eval61.6%
Simplified61.6%
Taylor expanded in x around 0 58.8%
associate-*r/58.8%
metadata-eval58.8%
sub-neg58.8%
metadata-eval58.8%
Simplified58.8%
if 2500 < (/.f64 x y) Initial program 84.5%
Taylor expanded in t around inf 67.5%
Final simplification65.8%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 1050.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 1050.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.0d0)) then
tmp = -2.0d0
else if (t <= 1050.0d0) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 1050.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 1050.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 1050.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.0) tmp = -2.0; elseif (t <= 1050.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 1050.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1050:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 1050 < t Initial program 73.2%
Taylor expanded in t around inf 89.9%
Taylor expanded in x around 0 35.3%
if -1 < t < 1050Initial program 97.1%
Taylor expanded in t around 0 77.0%
associate-*r/77.0%
metadata-eval77.0%
Simplified77.0%
Taylor expanded in z around inf 33.2%
Final simplification34.0%
(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 87.3%
Taylor expanded in t around inf 51.8%
Taylor expanded in x around 0 15.9%
Final simplification15.9%
(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 2023297
(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))))