
(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 18 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 89.2%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -1.05e+91)
(/ x y)
(if (<= (/ x y) 1e-308)
(/ 2.0 t)
(if (<= (/ x y) 2e-16)
-2.0
(if (<= (/ x y) 5.5e+54) (/ 2.0 t) (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.05e+91) {
tmp = x / y;
} else if ((x / y) <= 1e-308) {
tmp = 2.0 / t;
} else if ((x / y) <= 2e-16) {
tmp = -2.0;
} else if ((x / y) <= 5.5e+54) {
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) <= (-1.05d+91)) then
tmp = x / y
else if ((x / y) <= 1d-308) then
tmp = 2.0d0 / t
else if ((x / y) <= 2d-16) then
tmp = -2.0d0
else if ((x / y) <= 5.5d+54) 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) <= -1.05e+91) {
tmp = x / y;
} else if ((x / y) <= 1e-308) {
tmp = 2.0 / t;
} else if ((x / y) <= 2e-16) {
tmp = -2.0;
} else if ((x / y) <= 5.5e+54) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.05e+91: tmp = x / y elif (x / y) <= 1e-308: tmp = 2.0 / t elif (x / y) <= 2e-16: tmp = -2.0 elif (x / y) <= 5.5e+54: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.05e+91) tmp = Float64(x / y); elseif (Float64(x / y) <= 1e-308) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2e-16) tmp = -2.0; elseif (Float64(x / y) <= 5.5e+54) 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) <= -1.05e+91) tmp = x / y; elseif ((x / y) <= 1e-308) tmp = 2.0 / t; elseif ((x / y) <= 2e-16) tmp = -2.0; elseif ((x / y) <= 5.5e+54) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.05e+91], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e-308], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-16], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 5.5e+54], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.05 \cdot 10^{+91}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{-308}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-16}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 5.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.05000000000000004e91 or 5.50000000000000026e54 < (/.f64 x y) Initial program 86.7%
Taylor expanded in x around inf 77.4%
if -1.05000000000000004e91 < (/.f64 x y) < 9.9999999999999991e-309 or 2e-16 < (/.f64 x y) < 5.50000000000000026e54Initial program 92.6%
Taylor expanded in t around 0 73.4%
associate-*r/73.4%
metadata-eval73.4%
Simplified73.4%
Taylor expanded in z around inf 36.7%
if 9.9999999999999991e-309 < (/.f64 x y) < 2e-16Initial program 86.3%
Taylor expanded in z around inf 53.0%
associate-*r/53.0%
Simplified53.0%
Taylor expanded in x around 0 53.0%
Taylor expanded in t around inf 35.6%
Final simplification50.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -3.9e+46)
(and (not (<= t -7.2e-65)) (or (<= t -6.5e-103) (not (<= t 310.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 <= -3.9e+46) || (!(t <= -7.2e-65) && ((t <= -6.5e-103) || !(t <= 310.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 <= (-3.9d+46)) .or. (.not. (t <= (-7.2d-65))) .and. (t <= (-6.5d-103)) .or. (.not. (t <= 310.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 <= -3.9e+46) || (!(t <= -7.2e-65) && ((t <= -6.5e-103) || !(t <= 310.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 <= -3.9e+46) or (not (t <= -7.2e-65) and ((t <= -6.5e-103) or not (t <= 310.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 <= -3.9e+46) || (!(t <= -7.2e-65) && ((t <= -6.5e-103) || !(t <= 310.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 <= -3.9e+46) || (~((t <= -7.2e-65)) && ((t <= -6.5e-103) || ~((t <= 310.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, -3.9e+46], And[N[Not[LessEqual[t, -7.2e-65]], $MachinePrecision], Or[LessEqual[t, -6.5e-103], N[Not[LessEqual[t, 310.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 -3.9 \cdot 10^{+46} \lor \neg \left(t \leq -7.2 \cdot 10^{-65}\right) \land \left(t \leq -6.5 \cdot 10^{-103} \lor \neg \left(t \leq 310\right)\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -3.89999999999999995e46 or -7.1999999999999996e-65 < t < -6.49999999999999966e-103 or 310 < t Initial program 77.2%
Taylor expanded in t around inf 76.9%
if -3.89999999999999995e46 < t < -7.1999999999999996e-65 or -6.49999999999999966e-103 < t < 310Initial program 99.7%
Taylor expanded in t around 0 80.5%
associate-*r/80.5%
metadata-eval80.5%
Simplified80.5%
Final simplification78.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= t -3.9e+46)
t_1
(if (<= t -7.2e-65)
(* 2.0 (/ (+ 1.0 z) (* t z)))
(if (or (<= t -6.5e-103) (not (<= t 250.0)))
t_1
(/ (+ 2.0 (/ 2.0 z)) t))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -3.9e+46) {
tmp = t_1;
} else if (t <= -7.2e-65) {
tmp = 2.0 * ((1.0 + z) / (t * z));
} else if ((t <= -6.5e-103) || !(t <= 250.0)) {
tmp = t_1;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
if (t <= (-3.9d+46)) then
tmp = t_1
else if (t <= (-7.2d-65)) then
tmp = 2.0d0 * ((1.0d0 + z) / (t * z))
else if ((t <= (-6.5d-103)) .or. (.not. (t <= 250.0d0))) then
tmp = t_1
else
tmp = (2.0d0 + (2.0d0 / z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -3.9e+46) {
tmp = t_1;
} else if (t <= -7.2e-65) {
tmp = 2.0 * ((1.0 + z) / (t * z));
} else if ((t <= -6.5e-103) || !(t <= 250.0)) {
tmp = t_1;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if t <= -3.9e+46: tmp = t_1 elif t <= -7.2e-65: tmp = 2.0 * ((1.0 + z) / (t * z)) elif (t <= -6.5e-103) or not (t <= 250.0): tmp = t_1 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -3.9e+46) tmp = t_1; elseif (t <= -7.2e-65) tmp = Float64(2.0 * Float64(Float64(1.0 + z) / Float64(t * z))); elseif ((t <= -6.5e-103) || !(t <= 250.0)) tmp = t_1; else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if (t <= -3.9e+46) tmp = t_1; elseif (t <= -7.2e-65) tmp = 2.0 * ((1.0 + z) / (t * z)); elseif ((t <= -6.5e-103) || ~((t <= 250.0))) tmp = t_1; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -3.9e+46], t$95$1, If[LessEqual[t, -7.2e-65], N[(2.0 * N[(N[(1.0 + z), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -6.5e-103], N[Not[LessEqual[t, 250.0]], $MachinePrecision]], t$95$1, N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{+46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.2 \cdot 10^{-65}:\\
\;\;\;\;2 \cdot \frac{1 + z}{t \cdot z}\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{-103} \lor \neg \left(t \leq 250\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -3.89999999999999995e46 or -7.1999999999999996e-65 < t < -6.49999999999999966e-103 or 250 < t Initial program 77.2%
Taylor expanded in t around inf 76.9%
if -3.89999999999999995e46 < t < -7.1999999999999996e-65Initial program 99.6%
+-commutative99.6%
remove-double-neg99.6%
distribute-frac-neg99.6%
unsub-neg99.6%
*-commutative99.6%
associate-*r*99.6%
distribute-rgt1-in99.6%
associate-*r/99.6%
/-rgt-identity99.6%
fma-neg99.6%
/-rgt-identity99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
distribute-frac-neg99.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in t around 0 74.8%
if -6.49999999999999966e-103 < t < 250Initial program 99.7%
Taylor expanded in t around 0 81.5%
associate-*r/81.5%
metadata-eval81.5%
Simplified81.5%
Final simplification78.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 5.5e-13))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (+ -2.0 (/ 2.0 (* t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 5.5e-13)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (-2.0 + (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.0d0)) .or. (.not. (z <= 5.5d-13))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + ((-2.0d0) + (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.0) || !(z <= 5.5e-13)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (-2.0 + (2.0 / (t * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 5.5e-13): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + (-2.0 + (2.0 / (t * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 5.5e-13)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / Float64(t * z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 5.5e-13))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + (-2.0 + (2.0 / (t * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 5.5e-13]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 5.5 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t \cdot z}\right)\\
\end{array}
\end{array}
if z < -1 or 5.49999999999999979e-13 < z Initial program 78.5%
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.1%
+-commutative99.1%
associate--l+99.1%
sub-neg99.1%
associate-*r/99.1%
metadata-eval99.1%
metadata-eval99.1%
Simplified99.1%
if -1 < z < 5.49999999999999979e-13Initial program 99.8%
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 z around 0 99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 5.5e-13))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (+ -2.0 (/ (/ 2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 5.5e-13)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (-2.0 + ((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.0d0)) .or. (.not. (z <= 5.5d-13))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + ((-2.0d0) + ((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.0) || !(z <= 5.5e-13)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (-2.0 + ((2.0 / t) / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 5.5e-13): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + (-2.0 + ((2.0 / t) / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 5.5e-13)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 / t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 5.5e-13))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + (-2.0 + ((2.0 / t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 5.5e-13]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 5.5 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{\frac{2}{t}}{z}\right)\\
\end{array}
\end{array}
if z < -1 or 5.49999999999999979e-13 < z Initial program 78.5%
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.1%
+-commutative99.1%
associate--l+99.1%
sub-neg99.1%
associate-*r/99.1%
metadata-eval99.1%
metadata-eval99.1%
Simplified99.1%
if -1 < z < 5.49999999999999979e-13Initial program 99.8%
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 t around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
associate-/r*62.6%
Simplified99.8%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -4.8e+110)
t_2
(if (<= z -2.6e-57)
t_1
(if (<= z 4.8e-154) (/ 2.0 (* t z)) (if (<= z 4.8e+141) 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 + (2.0 / t);
double tmp;
if (z <= -4.8e+110) {
tmp = t_2;
} else if (z <= -2.6e-57) {
tmp = t_1;
} else if (z <= 4.8e-154) {
tmp = 2.0 / (t * z);
} else if (z <= 4.8e+141) {
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) + (2.0d0 / t)
if (z <= (-4.8d+110)) then
tmp = t_2
else if (z <= (-2.6d-57)) then
tmp = t_1
else if (z <= 4.8d-154) then
tmp = 2.0d0 / (t * z)
else if (z <= 4.8d+141) 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 + (2.0 / t);
double tmp;
if (z <= -4.8e+110) {
tmp = t_2;
} else if (z <= -2.6e-57) {
tmp = t_1;
} else if (z <= 4.8e-154) {
tmp = 2.0 / (t * z);
} else if (z <= 4.8e+141) {
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 + (2.0 / t) tmp = 0 if z <= -4.8e+110: tmp = t_2 elif z <= -2.6e-57: tmp = t_1 elif z <= 4.8e-154: tmp = 2.0 / (t * z) elif z <= 4.8e+141: 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(2.0 / t)) tmp = 0.0 if (z <= -4.8e+110) tmp = t_2; elseif (z <= -2.6e-57) tmp = t_1; elseif (z <= 4.8e-154) tmp = Float64(2.0 / Float64(t * z)); elseif (z <= 4.8e+141) 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 + (2.0 / t); tmp = 0.0; if (z <= -4.8e+110) tmp = t_2; elseif (z <= -2.6e-57) tmp = t_1; elseif (z <= 4.8e-154) tmp = 2.0 / (t * z); elseif (z <= 4.8e+141) 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[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+110], t$95$2, If[LessEqual[z, -2.6e-57], t$95$1, If[LessEqual[z, 4.8e-154], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+141], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-154}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.80000000000000025e110 or 4.79999999999999995e141 < z Initial program 68.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 100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 73.0%
sub-neg73.0%
associate-*r/73.0%
metadata-eval73.0%
metadata-eval73.0%
Simplified73.0%
if -4.80000000000000025e110 < z < -2.59999999999999985e-57 or 4.79999999999999974e-154 < z < 4.79999999999999995e141Initial program 97.4%
Taylor expanded in t around inf 68.0%
if -2.59999999999999985e-57 < z < 4.79999999999999974e-154Initial program 99.7%
Taylor expanded in t around 0 72.7%
associate-*r/72.7%
metadata-eval72.7%
Simplified72.7%
Taylor expanded in z around 0 72.7%
Final simplification71.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -3.3e+110)
t_2
(if (<= z -1.25e-73)
t_1
(if (<= z 8e-153) (/ (/ 2.0 t) z) (if (<= z 4.8e+140) 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 + (2.0 / t);
double tmp;
if (z <= -3.3e+110) {
tmp = t_2;
} else if (z <= -1.25e-73) {
tmp = t_1;
} else if (z <= 8e-153) {
tmp = (2.0 / t) / z;
} else if (z <= 4.8e+140) {
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) + (2.0d0 / t)
if (z <= (-3.3d+110)) then
tmp = t_2
else if (z <= (-1.25d-73)) then
tmp = t_1
else if (z <= 8d-153) then
tmp = (2.0d0 / t) / z
else if (z <= 4.8d+140) 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 + (2.0 / t);
double tmp;
if (z <= -3.3e+110) {
tmp = t_2;
} else if (z <= -1.25e-73) {
tmp = t_1;
} else if (z <= 8e-153) {
tmp = (2.0 / t) / z;
} else if (z <= 4.8e+140) {
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 + (2.0 / t) tmp = 0 if z <= -3.3e+110: tmp = t_2 elif z <= -1.25e-73: tmp = t_1 elif z <= 8e-153: tmp = (2.0 / t) / z elif z <= 4.8e+140: 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(2.0 / t)) tmp = 0.0 if (z <= -3.3e+110) tmp = t_2; elseif (z <= -1.25e-73) tmp = t_1; elseif (z <= 8e-153) tmp = Float64(Float64(2.0 / t) / z); elseif (z <= 4.8e+140) 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 + (2.0 / t); tmp = 0.0; if (z <= -3.3e+110) tmp = t_2; elseif (z <= -1.25e-73) tmp = t_1; elseif (z <= 8e-153) tmp = (2.0 / t) / z; elseif (z <= 4.8e+140) 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[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e+110], t$95$2, If[LessEqual[z, -1.25e-73], t$95$1, If[LessEqual[z, 8e-153], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 4.8e+140], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+140}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.29999999999999971e110 or 4.7999999999999999e140 < z Initial program 68.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 100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 73.0%
sub-neg73.0%
associate-*r/73.0%
metadata-eval73.0%
metadata-eval73.0%
Simplified73.0%
if -3.29999999999999971e110 < z < -1.25e-73 or 8.00000000000000031e-153 < z < 4.7999999999999999e140Initial program 97.4%
Taylor expanded in t around inf 68.0%
if -1.25e-73 < z < 8.00000000000000031e-153Initial program 99.7%
Taylor expanded in t around 0 72.7%
associate-*r/72.7%
metadata-eval72.7%
Simplified72.7%
Taylor expanded in z around 0 72.7%
associate-/r*72.8%
Simplified72.8%
Final simplification71.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -4.3e+110)
t_2
(if (<= z -4e-52)
t_1
(if (<= z 5.2e-39)
(+ -2.0 (/ 2.0 (* t z)))
(if (<= z 3.6e+141) 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 + (2.0 / t);
double tmp;
if (z <= -4.3e+110) {
tmp = t_2;
} else if (z <= -4e-52) {
tmp = t_1;
} else if (z <= 5.2e-39) {
tmp = -2.0 + (2.0 / (t * z));
} else if (z <= 3.6e+141) {
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) + (2.0d0 / t)
if (z <= (-4.3d+110)) then
tmp = t_2
else if (z <= (-4d-52)) then
tmp = t_1
else if (z <= 5.2d-39) then
tmp = (-2.0d0) + (2.0d0 / (t * z))
else if (z <= 3.6d+141) 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 + (2.0 / t);
double tmp;
if (z <= -4.3e+110) {
tmp = t_2;
} else if (z <= -4e-52) {
tmp = t_1;
} else if (z <= 5.2e-39) {
tmp = -2.0 + (2.0 / (t * z));
} else if (z <= 3.6e+141) {
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 + (2.0 / t) tmp = 0 if z <= -4.3e+110: tmp = t_2 elif z <= -4e-52: tmp = t_1 elif z <= 5.2e-39: tmp = -2.0 + (2.0 / (t * z)) elif z <= 3.6e+141: 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(2.0 / t)) tmp = 0.0 if (z <= -4.3e+110) tmp = t_2; elseif (z <= -4e-52) tmp = t_1; elseif (z <= 5.2e-39) tmp = Float64(-2.0 + Float64(2.0 / Float64(t * z))); elseif (z <= 3.6e+141) 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 + (2.0 / t); tmp = 0.0; if (z <= -4.3e+110) tmp = t_2; elseif (z <= -4e-52) tmp = t_1; elseif (z <= 5.2e-39) tmp = -2.0 + (2.0 / (t * z)); elseif (z <= 3.6e+141) 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[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+110], t$95$2, If[LessEqual[z, -4e-52], t$95$1, If[LessEqual[z, 5.2e-39], N[(-2.0 + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+141], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-39}:\\
\;\;\;\;-2 + \frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.30000000000000007e110 or 3.6000000000000001e141 < z Initial program 68.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 100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 73.0%
sub-neg73.0%
associate-*r/73.0%
metadata-eval73.0%
metadata-eval73.0%
Simplified73.0%
if -4.30000000000000007e110 < z < -4e-52 or 5.2e-39 < z < 3.6000000000000001e141Initial program 96.7%
Taylor expanded in t around inf 71.6%
if -4e-52 < z < 5.2e-39Initial 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.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 z around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 79.3%
sub-neg79.3%
associate-*r/79.3%
metadata-eval79.3%
*-commutative79.3%
metadata-eval79.3%
+-commutative79.3%
*-commutative79.3%
Simplified79.3%
Final simplification75.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -2.7e+110)
t_2
(if (<= z -3.45e-63)
t_1
(if (<= z 5.4e-38)
(+ -2.0 (/ (/ 2.0 t) z))
(if (<= z 1.5e+142) 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 + (2.0 / t);
double tmp;
if (z <= -2.7e+110) {
tmp = t_2;
} else if (z <= -3.45e-63) {
tmp = t_1;
} else if (z <= 5.4e-38) {
tmp = -2.0 + ((2.0 / t) / z);
} else if (z <= 1.5e+142) {
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) + (2.0d0 / t)
if (z <= (-2.7d+110)) then
tmp = t_2
else if (z <= (-3.45d-63)) then
tmp = t_1
else if (z <= 5.4d-38) then
tmp = (-2.0d0) + ((2.0d0 / t) / z)
else if (z <= 1.5d+142) 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 + (2.0 / t);
double tmp;
if (z <= -2.7e+110) {
tmp = t_2;
} else if (z <= -3.45e-63) {
tmp = t_1;
} else if (z <= 5.4e-38) {
tmp = -2.0 + ((2.0 / t) / z);
} else if (z <= 1.5e+142) {
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 + (2.0 / t) tmp = 0 if z <= -2.7e+110: tmp = t_2 elif z <= -3.45e-63: tmp = t_1 elif z <= 5.4e-38: tmp = -2.0 + ((2.0 / t) / z) elif z <= 1.5e+142: 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(2.0 / t)) tmp = 0.0 if (z <= -2.7e+110) tmp = t_2; elseif (z <= -3.45e-63) tmp = t_1; elseif (z <= 5.4e-38) tmp = Float64(-2.0 + Float64(Float64(2.0 / t) / z)); elseif (z <= 1.5e+142) 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 + (2.0 / t); tmp = 0.0; if (z <= -2.7e+110) tmp = t_2; elseif (z <= -3.45e-63) tmp = t_1; elseif (z <= 5.4e-38) tmp = -2.0 + ((2.0 / t) / z); elseif (z <= 1.5e+142) 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[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+110], t$95$2, If[LessEqual[z, -3.45e-63], t$95$1, If[LessEqual[z, 5.4e-38], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+142], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.45 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-38}:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+142}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.7000000000000001e110 or 1.49999999999999987e142 < z Initial program 68.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 100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 73.0%
sub-neg73.0%
associate-*r/73.0%
metadata-eval73.0%
metadata-eval73.0%
Simplified73.0%
if -2.7000000000000001e110 < z < -3.45e-63 or 5.40000000000000011e-38 < z < 1.49999999999999987e142Initial program 96.7%
Taylor expanded in t around inf 71.6%
if -3.45e-63 < z < 5.40000000000000011e-38Initial 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.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 z around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 79.3%
sub-neg79.3%
associate-*r/79.3%
metadata-eval79.3%
*-commutative79.3%
metadata-eval79.3%
+-commutative79.3%
associate-/l/79.4%
Simplified79.4%
Final simplification75.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.05e+91) (not (<= (/ x y) 2.2e+54))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.05e+91) || !((x / y) <= 2.2e+54)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1.05d+91)) .or. (.not. ((x / y) <= 2.2d+54))) then
tmp = x / y
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.05e+91) || !((x / y) <= 2.2e+54)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.05e+91) or not ((x / y) <= 2.2e+54): tmp = x / y else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.05e+91) || !(Float64(x / y) <= 2.2e+54)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1.05e+91) || ~(((x / y) <= 2.2e+54))) tmp = x / y; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.05e+91], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.2e+54]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.05 \cdot 10^{+91} \lor \neg \left(\frac{x}{y} \leq 2.2 \cdot 10^{+54}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.05000000000000004e91 or 2.1999999999999999e54 < (/.f64 x y) Initial program 86.7%
Taylor expanded in x around inf 77.4%
if -1.05000000000000004e91 < (/.f64 x y) < 2.1999999999999999e54Initial program 90.6%
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.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 59.1%
+-commutative59.1%
associate--l+59.1%
sub-neg59.1%
associate-*r/59.1%
metadata-eval59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in x around 0 53.7%
sub-neg53.7%
associate-*r/53.7%
metadata-eval53.7%
metadata-eval53.7%
Simplified53.7%
Final simplification62.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.6e-44) (not (<= z 1.15e-152))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ -2.0 (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.6e-44) || !(z <= 1.15e-152)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + ((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 <= (-3.6d-44)) .or. (.not. (z <= 1.15d-152))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (-2.0d0) + ((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 <= -3.6e-44) || !(z <= 1.15e-152)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.6e-44) or not (z <= 1.15e-152): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = -2.0 + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.6e-44) || !(z <= 1.15e-152)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(-2.0 + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.6e-44) || ~((z <= 1.15e-152))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = -2.0 + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.6e-44], N[Not[LessEqual[z, 1.15e-152]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-44} \lor \neg \left(z \leq 1.15 \cdot 10^{-152}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -3.5999999999999999e-44 or 1.1500000000000001e-152 < z Initial program 82.8%
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-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 92.8%
+-commutative92.8%
associate--l+92.8%
sub-neg92.8%
associate-*r/92.8%
metadata-eval92.8%
metadata-eval92.8%
Simplified92.8%
if -3.5999999999999999e-44 < z < 1.1500000000000001e-152Initial 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.8%
distribute-rgt-out99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 83.5%
sub-neg83.5%
associate-*r/83.5%
metadata-eval83.5%
*-commutative83.5%
metadata-eval83.5%
+-commutative83.5%
associate-/l/83.6%
Simplified83.6%
Final simplification89.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.5e-5) (not (<= z 4.4e-40))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ 2.0 (* t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.5e-5) || !(z <= 4.4e-40)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (2.0 / (t * z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-7.5d-5)) .or. (.not. (z <= 4.4d-40))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + (2.0d0 / (t * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.5e-5) || !(z <= 4.4e-40)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (2.0 / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.5e-5) or not (z <= 4.4e-40): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + (2.0 / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.5e-5) || !(z <= 4.4e-40)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.5e-5) || ~((z <= 4.4e-40))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + (2.0 / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.5e-5], N[Not[LessEqual[z, 4.4e-40]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-5} \lor \neg \left(z \leq 4.4 \cdot 10^{-40}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\end{array}
\end{array}
if z < -7.49999999999999934e-5 or 4.40000000000000018e-40 < z Initial program 79.3%
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 98.4%
+-commutative98.4%
associate--l+98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
Simplified98.4%
if -7.49999999999999934e-5 < z < 4.40000000000000018e-40Initial program 99.8%
Taylor expanded in z around 0 87.7%
Final simplification93.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8e-6) (not (<= z 5.4e-38))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e-6) || !(z <= 5.4e-38)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-8d-6)) .or. (.not. (z <= 5.4d-38))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e-6) || !(z <= 5.4e-38)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8e-6) or not (z <= 5.4e-38): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8e-6) || !(z <= 5.4e-38)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8e-6) || ~((z <= 5.4e-38))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e-6], N[Not[LessEqual[z, 5.4e-38]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-6} \lor \neg \left(z \leq 5.4 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -7.99999999999999964e-6 or 5.40000000000000011e-38 < z Initial program 79.3%
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 98.4%
+-commutative98.4%
associate--l+98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
Simplified98.4%
if -7.99999999999999964e-6 < z < 5.40000000000000011e-38Initial program 99.8%
Taylor expanded in z around 0 87.7%
associate-/r*87.8%
Simplified87.8%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.05e+91) (/ x y) (if (<= (/ x y) 9.4e+55) (+ -2.0 (/ 2.0 t)) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.05e+91) {
tmp = x / y;
} else if ((x / y) <= 9.4e+55) {
tmp = -2.0 + (2.0 / 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.05d+91)) then
tmp = x / y
else if ((x / y) <= 9.4d+55) then
tmp = (-2.0d0) + (2.0d0 / 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.05e+91) {
tmp = x / y;
} else if ((x / y) <= 9.4e+55) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.05e+91: tmp = x / y elif (x / y) <= 9.4e+55: tmp = -2.0 + (2.0 / t) else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.05e+91) tmp = Float64(x / y); elseif (Float64(x / y) <= 9.4e+55) tmp = Float64(-2.0 + Float64(2.0 / 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.05e+91) tmp = x / y; elseif ((x / y) <= 9.4e+55) tmp = -2.0 + (2.0 / t); else tmp = (x / y) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.05e+91], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 9.4e+55], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.05 \cdot 10^{+91}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 9.4 \cdot 10^{+55}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.05000000000000004e91Initial program 83.3%
Taylor expanded in x around inf 89.4%
if -1.05000000000000004e91 < (/.f64 x y) < 9.4000000000000001e55Initial program 90.6%
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.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 59.1%
+-commutative59.1%
associate--l+59.1%
sub-neg59.1%
associate-*r/59.1%
metadata-eval59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in x around 0 53.7%
sub-neg53.7%
associate-*r/53.7%
metadata-eval53.7%
metadata-eval53.7%
Simplified53.7%
if 9.4000000000000001e55 < (/.f64 x y) Initial program 88.9%
Taylor expanded in t around inf 69.5%
Final simplification62.1%
(FPCore (x y z t) :precision binary64 (+ (/ x y) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t));
}
def code(x, y, z, t): return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t))) end
function tmp = code(x, y, z, t) tmp = (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)
\end{array}
Initial program 89.2%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around 0 99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (<= t -5e-22) -2.0 (if (<= t 470.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5e-22) {
tmp = -2.0;
} else if (t <= 470.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 <= (-5d-22)) then
tmp = -2.0d0
else if (t <= 470.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 <= -5e-22) {
tmp = -2.0;
} else if (t <= 470.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5e-22: tmp = -2.0 elif t <= 470.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5e-22) tmp = -2.0; elseif (t <= 470.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 <= -5e-22) tmp = -2.0; elseif (t <= 470.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5e-22], -2.0, If[LessEqual[t, 470.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-22}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 470:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -4.99999999999999954e-22 or 470 < t Initial program 76.9%
Taylor expanded in z around inf 74.2%
associate-*r/74.2%
Simplified74.2%
Taylor expanded in x around 0 34.4%
Taylor expanded in t around inf 33.7%
if -4.99999999999999954e-22 < t < 470Initial program 99.7%
Taylor expanded in t around 0 77.1%
associate-*r/77.1%
metadata-eval77.1%
Simplified77.1%
Taylor expanded in z around inf 40.7%
Final simplification37.5%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 89.2%
Taylor expanded in z around inf 68.3%
associate-*r/68.3%
Simplified68.3%
Taylor expanded in x around 0 38.0%
Taylor expanded in t around inf 16.8%
Final simplification16.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 2024011
(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))))