
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.00039) (not (<= z 200000.0))) (+ (* (/ y z) (/ x (- b y))) (/ (- t a) (- b y))) (/ (+ (* y x) (* z (- t a))) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.00039) || !(z <= 200000.0)) {
tmp = ((y / z) * (x / (b - y))) + ((t - a) / (b - y));
} else {
tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-0.00039d0)) .or. (.not. (z <= 200000.0d0))) then
tmp = ((y / z) * (x / (b - y))) + ((t - a) / (b - y))
else
tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.00039) || !(z <= 200000.0)) {
tmp = ((y / z) * (x / (b - y))) + ((t - a) / (b - y));
} else {
tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.00039) or not (z <= 200000.0): tmp = ((y / z) * (x / (b - y))) + ((t - a) / (b - y)) else: tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.00039) || !(z <= 200000.0)) tmp = Float64(Float64(Float64(y / z) * Float64(x / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.00039) || ~((z <= 200000.0))) tmp = ((y / z) * (x / (b - y))) + ((t - a) / (b - y)); else tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.00039], N[Not[LessEqual[z, 200000.0]], $MachinePrecision]], N[(N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00039 \lor \neg \left(z \leq 200000\right):\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{b - y} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -3.89999999999999993e-4 or 2e5 < z Initial program 39.4%
Taylor expanded in z around -inf 65.1%
+-commutative65.1%
associate--l+65.1%
Simplified72.9%
Taylor expanded in x around inf 69.6%
*-commutative69.6%
times-frac91.6%
Simplified91.6%
if -3.89999999999999993e-4 < z < 2e5Initial program 92.7%
Final simplification92.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (/ y z) (/ x (- b y))) (/ (- t a) (- b y)))))
(if (<= z -1.1e-19)
t_1
(if (<= z 8e-93)
(+ x (* (- t a) (/ z y)))
(if (<= z 1.7e-70)
(/ (+ (- t a) (* (/ y z) x)) b)
(if (<= z 5.8e-46) (/ (+ (* y x) (* z (- t a))) y) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y / z) * (x / (b - y))) + ((t - a) / (b - y));
double tmp;
if (z <= -1.1e-19) {
tmp = t_1;
} else if (z <= 8e-93) {
tmp = x + ((t - a) * (z / y));
} else if (z <= 1.7e-70) {
tmp = ((t - a) + ((y / z) * x)) / b;
} else if (z <= 5.8e-46) {
tmp = ((y * x) + (z * (t - a))) / y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((y / z) * (x / (b - y))) + ((t - a) / (b - y))
if (z <= (-1.1d-19)) then
tmp = t_1
else if (z <= 8d-93) then
tmp = x + ((t - a) * (z / y))
else if (z <= 1.7d-70) then
tmp = ((t - a) + ((y / z) * x)) / b
else if (z <= 5.8d-46) then
tmp = ((y * x) + (z * (t - a))) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y / z) * (x / (b - y))) + ((t - a) / (b - y));
double tmp;
if (z <= -1.1e-19) {
tmp = t_1;
} else if (z <= 8e-93) {
tmp = x + ((t - a) * (z / y));
} else if (z <= 1.7e-70) {
tmp = ((t - a) + ((y / z) * x)) / b;
} else if (z <= 5.8e-46) {
tmp = ((y * x) + (z * (t - a))) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((y / z) * (x / (b - y))) + ((t - a) / (b - y)) tmp = 0 if z <= -1.1e-19: tmp = t_1 elif z <= 8e-93: tmp = x + ((t - a) * (z / y)) elif z <= 1.7e-70: tmp = ((t - a) + ((y / z) * x)) / b elif z <= 5.8e-46: tmp = ((y * x) + (z * (t - a))) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y / z) * Float64(x / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))) tmp = 0.0 if (z <= -1.1e-19) tmp = t_1; elseif (z <= 8e-93) tmp = Float64(x + Float64(Float64(t - a) * Float64(z / y))); elseif (z <= 1.7e-70) tmp = Float64(Float64(Float64(t - a) + Float64(Float64(y / z) * x)) / b); elseif (z <= 5.8e-46) tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((y / z) * (x / (b - y))) + ((t - a) / (b - y)); tmp = 0.0; if (z <= -1.1e-19) tmp = t_1; elseif (z <= 8e-93) tmp = x + ((t - a) * (z / y)); elseif (z <= 1.7e-70) tmp = ((t - a) + ((y / z) * x)) / b; elseif (z <= 5.8e-46) tmp = ((y * x) + (z * (t - a))) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e-19], t$95$1, If[LessEqual[z, 8e-93], N[(x + N[(N[(t - a), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-70], N[(N[(N[(t - a), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[z, 5.8e-46], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot \frac{x}{b - y} + \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-93}:\\
\;\;\;\;x + \left(t - a\right) \cdot \frac{z}{y}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-70}:\\
\;\;\;\;\frac{\left(t - a\right) + \frac{y}{z} \cdot x}{b}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-46}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.0999999999999999e-19 or 5.80000000000000009e-46 < z Initial program 44.5%
Taylor expanded in z around -inf 63.5%
+-commutative63.5%
associate--l+63.5%
Simplified70.6%
Taylor expanded in x around inf 68.3%
*-commutative68.3%
times-frac87.4%
Simplified87.4%
if -1.0999999999999999e-19 < z < 7.9999999999999992e-93Initial program 92.0%
Taylor expanded in z around 0 76.2%
Taylor expanded in x around 0 83.9%
+-commutative83.9%
associate-/l*81.4%
Simplified81.4%
div-inv81.4%
clear-num81.4%
Applied egg-rr81.4%
if 7.9999999999999992e-93 < z < 1.69999999999999998e-70Initial program 100.0%
Taylor expanded in z around -inf 100.0%
+-commutative100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
times-frac100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
associate--l+100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
if 1.69999999999999998e-70 < z < 5.80000000000000009e-46Initial program 100.0%
Taylor expanded in z around 0 100.0%
Final simplification85.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.5e+144)
t_1
(if (<= z -6e+114)
(- (/ (- a t) y) (/ x z))
(if (<= z -3.7e-14)
t_1
(if (<= z 3.8e-92)
(+ x (* (- t a) (/ z y)))
(if (<= z 2.6e-68)
(/ (+ (- t a) (* (/ y z) x)) b)
(if (<= z 8.6e-18) (/ (+ (* y x) (* z (- t a))) y) t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.5e+144) {
tmp = t_1;
} else if (z <= -6e+114) {
tmp = ((a - t) / y) - (x / z);
} else if (z <= -3.7e-14) {
tmp = t_1;
} else if (z <= 3.8e-92) {
tmp = x + ((t - a) * (z / y));
} else if (z <= 2.6e-68) {
tmp = ((t - a) + ((y / z) * x)) / b;
} else if (z <= 8.6e-18) {
tmp = ((y * x) + (z * (t - a))) / y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-2.5d+144)) then
tmp = t_1
else if (z <= (-6d+114)) then
tmp = ((a - t) / y) - (x / z)
else if (z <= (-3.7d-14)) then
tmp = t_1
else if (z <= 3.8d-92) then
tmp = x + ((t - a) * (z / y))
else if (z <= 2.6d-68) then
tmp = ((t - a) + ((y / z) * x)) / b
else if (z <= 8.6d-18) then
tmp = ((y * x) + (z * (t - a))) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.5e+144) {
tmp = t_1;
} else if (z <= -6e+114) {
tmp = ((a - t) / y) - (x / z);
} else if (z <= -3.7e-14) {
tmp = t_1;
} else if (z <= 3.8e-92) {
tmp = x + ((t - a) * (z / y));
} else if (z <= 2.6e-68) {
tmp = ((t - a) + ((y / z) * x)) / b;
} else if (z <= 8.6e-18) {
tmp = ((y * x) + (z * (t - a))) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -2.5e+144: tmp = t_1 elif z <= -6e+114: tmp = ((a - t) / y) - (x / z) elif z <= -3.7e-14: tmp = t_1 elif z <= 3.8e-92: tmp = x + ((t - a) * (z / y)) elif z <= 2.6e-68: tmp = ((t - a) + ((y / z) * x)) / b elif z <= 8.6e-18: tmp = ((y * x) + (z * (t - a))) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.5e+144) tmp = t_1; elseif (z <= -6e+114) tmp = Float64(Float64(Float64(a - t) / y) - Float64(x / z)); elseif (z <= -3.7e-14) tmp = t_1; elseif (z <= 3.8e-92) tmp = Float64(x + Float64(Float64(t - a) * Float64(z / y))); elseif (z <= 2.6e-68) tmp = Float64(Float64(Float64(t - a) + Float64(Float64(y / z) * x)) / b); elseif (z <= 8.6e-18) tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -2.5e+144) tmp = t_1; elseif (z <= -6e+114) tmp = ((a - t) / y) - (x / z); elseif (z <= -3.7e-14) tmp = t_1; elseif (z <= 3.8e-92) tmp = x + ((t - a) * (z / y)); elseif (z <= 2.6e-68) tmp = ((t - a) + ((y / z) * x)) / b; elseif (z <= 8.6e-18) tmp = ((y * x) + (z * (t - a))) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+144], t$95$1, If[LessEqual[z, -6e+114], N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.7e-14], t$95$1, If[LessEqual[z, 3.8e-92], N[(x + N[(N[(t - a), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-68], N[(N[(N[(t - a), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[z, 8.6e-18], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{+114}:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-92}:\\
\;\;\;\;x + \left(t - a\right) \cdot \frac{z}{y}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-68}:\\
\;\;\;\;\frac{\left(t - a\right) + \frac{y}{z} \cdot x}{b}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-18}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.5e144 or -6.0000000000000001e114 < z < -3.70000000000000001e-14 or 8.6000000000000005e-18 < z Initial program 42.6%
Taylor expanded in z around inf 74.0%
if -2.5e144 < z < -6.0000000000000001e114Initial program 39.8%
Taylor expanded in z around -inf 30.8%
+-commutative30.8%
associate--l+30.8%
Simplified32.0%
Taylor expanded in x around inf 40.0%
*-commutative40.0%
times-frac89.7%
Simplified89.7%
Taylor expanded in b around 0 90.2%
cancel-sign-sub-inv90.2%
+-commutative90.2%
metadata-eval90.2%
*-lft-identity90.2%
associate-+l+90.2%
associate-*r/90.2%
mul-1-neg90.2%
mul-1-neg90.2%
remove-double-neg90.2%
mul-1-neg90.2%
distribute-neg-in90.2%
mul-1-neg90.2%
sub-neg90.2%
div-sub90.2%
Simplified90.2%
if -3.70000000000000001e-14 < z < 3.8000000000000001e-92Initial program 92.0%
Taylor expanded in z around 0 76.2%
Taylor expanded in x around 0 83.9%
+-commutative83.9%
associate-/l*81.4%
Simplified81.4%
div-inv81.4%
clear-num81.4%
Applied egg-rr81.4%
if 3.8000000000000001e-92 < z < 2.5999999999999998e-68Initial program 100.0%
Taylor expanded in z around -inf 100.0%
+-commutative100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
times-frac100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
associate--l+100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
if 2.5999999999999998e-68 < z < 8.6000000000000005e-18Initial program 99.9%
Taylor expanded in z around 0 73.6%
Final simplification78.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -0.055)
(- (* (/ x z) (/ y (- b y))) (/ a (- b y)))
(if (<= z 3.8e-92)
(+ x (* (- t a) (/ z y)))
(if (<= z 1.3e-67)
(/ (+ (- t a) (* (/ y z) x)) b)
(if (<= z 9.5e-18)
(/ (+ (* y x) (* z (- t a))) y)
(/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.055) {
tmp = ((x / z) * (y / (b - y))) - (a / (b - y));
} else if (z <= 3.8e-92) {
tmp = x + ((t - a) * (z / y));
} else if (z <= 1.3e-67) {
tmp = ((t - a) + ((y / z) * x)) / b;
} else if (z <= 9.5e-18) {
tmp = ((y * x) + (z * (t - a))) / y;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-0.055d0)) then
tmp = ((x / z) * (y / (b - y))) - (a / (b - y))
else if (z <= 3.8d-92) then
tmp = x + ((t - a) * (z / y))
else if (z <= 1.3d-67) then
tmp = ((t - a) + ((y / z) * x)) / b
else if (z <= 9.5d-18) then
tmp = ((y * x) + (z * (t - a))) / y
else
tmp = (t - a) / (b - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.055) {
tmp = ((x / z) * (y / (b - y))) - (a / (b - y));
} else if (z <= 3.8e-92) {
tmp = x + ((t - a) * (z / y));
} else if (z <= 1.3e-67) {
tmp = ((t - a) + ((y / z) * x)) / b;
} else if (z <= 9.5e-18) {
tmp = ((y * x) + (z * (t - a))) / y;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -0.055: tmp = ((x / z) * (y / (b - y))) - (a / (b - y)) elif z <= 3.8e-92: tmp = x + ((t - a) * (z / y)) elif z <= 1.3e-67: tmp = ((t - a) + ((y / z) * x)) / b elif z <= 9.5e-18: tmp = ((y * x) + (z * (t - a))) / y else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -0.055) tmp = Float64(Float64(Float64(x / z) * Float64(y / Float64(b - y))) - Float64(a / Float64(b - y))); elseif (z <= 3.8e-92) tmp = Float64(x + Float64(Float64(t - a) * Float64(z / y))); elseif (z <= 1.3e-67) tmp = Float64(Float64(Float64(t - a) + Float64(Float64(y / z) * x)) / b); elseif (z <= 9.5e-18) tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / y); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -0.055) tmp = ((x / z) * (y / (b - y))) - (a / (b - y)); elseif (z <= 3.8e-92) tmp = x + ((t - a) * (z / y)); elseif (z <= 1.3e-67) tmp = ((t - a) + ((y / z) * x)) / b; elseif (z <= 9.5e-18) tmp = ((y * x) + (z * (t - a))) / y; else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -0.055], N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-92], N[(x + N[(N[(t - a), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-67], N[(N[(N[(t - a), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[z, 9.5e-18], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.055:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{b - y} - \frac{a}{b - y}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-92}:\\
\;\;\;\;x + \left(t - a\right) \cdot \frac{z}{y}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-67}:\\
\;\;\;\;\frac{\left(t - a\right) + \frac{y}{z} \cdot x}{b}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if z < -0.0550000000000000003Initial program 42.0%
Taylor expanded in z around -inf 59.8%
+-commutative59.8%
associate--l+59.8%
Simplified66.5%
Taylor expanded in x around inf 64.8%
*-commutative64.8%
times-frac90.2%
Simplified90.2%
Taylor expanded in t around 0 42.5%
*-commutative42.5%
times-frac72.3%
Simplified72.3%
if -0.0550000000000000003 < z < 3.8000000000000001e-92Initial program 91.4%
Taylor expanded in z around 0 74.7%
Taylor expanded in x around 0 82.4%
+-commutative82.4%
associate-/l*80.0%
Simplified80.0%
div-inv79.9%
clear-num80.0%
Applied egg-rr80.0%
if 3.8000000000000001e-92 < z < 1.2999999999999999e-67Initial program 100.0%
Taylor expanded in z around -inf 100.0%
+-commutative100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
times-frac100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
associate--l+100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
if 1.2999999999999999e-67 < z < 9.5000000000000003e-18Initial program 99.9%
Taylor expanded in z around 0 73.6%
if 9.5000000000000003e-18 < z Initial program 41.6%
Taylor expanded in z around inf 73.1%
Final simplification76.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))) (t_2 (/ (- a) b)))
(if (<= z -1.65e+223)
t_2
(if (<= z -1.85e+68)
t_1
(if (<= z -150000.0)
t_2
(if (<= z -2.95e-43)
(/ t (/ y z))
(if (<= z -2.2e-61)
(/ t b)
(if (<= z 1.25e-5) (+ x (* z x)) t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double t_2 = -a / b;
double tmp;
if (z <= -1.65e+223) {
tmp = t_2;
} else if (z <= -1.85e+68) {
tmp = t_1;
} else if (z <= -150000.0) {
tmp = t_2;
} else if (z <= -2.95e-43) {
tmp = t / (y / z);
} else if (z <= -2.2e-61) {
tmp = t / b;
} else if (z <= 1.25e-5) {
tmp = x + (z * x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t / (b - y)
t_2 = -a / b
if (z <= (-1.65d+223)) then
tmp = t_2
else if (z <= (-1.85d+68)) then
tmp = t_1
else if (z <= (-150000.0d0)) then
tmp = t_2
else if (z <= (-2.95d-43)) then
tmp = t / (y / z)
else if (z <= (-2.2d-61)) then
tmp = t / b
else if (z <= 1.25d-5) then
tmp = x + (z * x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double t_2 = -a / b;
double tmp;
if (z <= -1.65e+223) {
tmp = t_2;
} else if (z <= -1.85e+68) {
tmp = t_1;
} else if (z <= -150000.0) {
tmp = t_2;
} else if (z <= -2.95e-43) {
tmp = t / (y / z);
} else if (z <= -2.2e-61) {
tmp = t / b;
} else if (z <= 1.25e-5) {
tmp = x + (z * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) t_2 = -a / b tmp = 0 if z <= -1.65e+223: tmp = t_2 elif z <= -1.85e+68: tmp = t_1 elif z <= -150000.0: tmp = t_2 elif z <= -2.95e-43: tmp = t / (y / z) elif z <= -2.2e-61: tmp = t / b elif z <= 1.25e-5: tmp = x + (z * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) t_2 = Float64(Float64(-a) / b) tmp = 0.0 if (z <= -1.65e+223) tmp = t_2; elseif (z <= -1.85e+68) tmp = t_1; elseif (z <= -150000.0) tmp = t_2; elseif (z <= -2.95e-43) tmp = Float64(t / Float64(y / z)); elseif (z <= -2.2e-61) tmp = Float64(t / b); elseif (z <= 1.25e-5) tmp = Float64(x + Float64(z * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); t_2 = -a / b; tmp = 0.0; if (z <= -1.65e+223) tmp = t_2; elseif (z <= -1.85e+68) tmp = t_1; elseif (z <= -150000.0) tmp = t_2; elseif (z <= -2.95e-43) tmp = t / (y / z); elseif (z <= -2.2e-61) tmp = t / b; elseif (z <= 1.25e-5) tmp = x + (z * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-a) / b), $MachinePrecision]}, If[LessEqual[z, -1.65e+223], t$95$2, If[LessEqual[z, -1.85e+68], t$95$1, If[LessEqual[z, -150000.0], t$95$2, If[LessEqual[z, -2.95e-43], N[(t / N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-61], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.25e-5], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
t_2 := \frac{-a}{b}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+223}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -150000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.95 \cdot 10^{-43}:\\
\;\;\;\;\frac{t}{\frac{y}{z}}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-5}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.65e223 or -1.84999999999999999e68 < z < -1.5e5Initial program 40.3%
Taylor expanded in z around -inf 67.8%
+-commutative67.8%
associate--l+67.8%
Simplified71.7%
Taylor expanded in x around inf 71.6%
*-commutative71.6%
times-frac90.9%
Simplified90.9%
Taylor expanded in a around inf 57.0%
associate-*r/57.0%
neg-mul-157.0%
Simplified57.0%
Taylor expanded in b around inf 43.5%
associate-*r/43.5%
neg-mul-143.5%
Simplified43.5%
if -1.65e223 < z < -1.84999999999999999e68 or 1.25000000000000006e-5 < z Initial program 40.5%
div-inv40.5%
fma-def40.5%
+-commutative40.5%
fma-def40.5%
Applied egg-rr40.5%
Taylor expanded in t around inf 24.5%
Taylor expanded in z around inf 40.3%
if -1.5e5 < z < -2.94999999999999988e-43Initial program 81.0%
Taylor expanded in z around 0 65.8%
Taylor expanded in t around inf 41.9%
associate-/l*41.7%
Simplified41.7%
if -2.94999999999999988e-43 < z < -2.20000000000000009e-61Initial program 99.7%
div-inv99.7%
fma-def99.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in t around inf 42.0%
Taylor expanded in b around inf 43.1%
if -2.20000000000000009e-61 < z < 1.25000000000000006e-5Initial program 91.9%
Taylor expanded in y around inf 55.0%
+-commutative55.0%
mul-1-neg55.0%
unsub-neg55.0%
Simplified55.0%
Taylor expanded in z around 0 55.0%
Final simplification47.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.5e+144)
t_1
(if (<= z -8.8e+114)
(- (/ (- a t) y) (/ x z))
(if (or (<= z -1.36e-14) (not (<= z 1.6e-18)))
t_1
(+ x (* (- t a) (/ z y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.5e+144) {
tmp = t_1;
} else if (z <= -8.8e+114) {
tmp = ((a - t) / y) - (x / z);
} else if ((z <= -1.36e-14) || !(z <= 1.6e-18)) {
tmp = t_1;
} else {
tmp = x + ((t - a) * (z / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-2.5d+144)) then
tmp = t_1
else if (z <= (-8.8d+114)) then
tmp = ((a - t) / y) - (x / z)
else if ((z <= (-1.36d-14)) .or. (.not. (z <= 1.6d-18))) then
tmp = t_1
else
tmp = x + ((t - a) * (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.5e+144) {
tmp = t_1;
} else if (z <= -8.8e+114) {
tmp = ((a - t) / y) - (x / z);
} else if ((z <= -1.36e-14) || !(z <= 1.6e-18)) {
tmp = t_1;
} else {
tmp = x + ((t - a) * (z / y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -2.5e+144: tmp = t_1 elif z <= -8.8e+114: tmp = ((a - t) / y) - (x / z) elif (z <= -1.36e-14) or not (z <= 1.6e-18): tmp = t_1 else: tmp = x + ((t - a) * (z / y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.5e+144) tmp = t_1; elseif (z <= -8.8e+114) tmp = Float64(Float64(Float64(a - t) / y) - Float64(x / z)); elseif ((z <= -1.36e-14) || !(z <= 1.6e-18)) tmp = t_1; else tmp = Float64(x + Float64(Float64(t - a) * Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -2.5e+144) tmp = t_1; elseif (z <= -8.8e+114) tmp = ((a - t) / y) - (x / z); elseif ((z <= -1.36e-14) || ~((z <= 1.6e-18))) tmp = t_1; else tmp = x + ((t - a) * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+144], t$95$1, If[LessEqual[z, -8.8e+114], N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.36e-14], N[Not[LessEqual[z, 1.6e-18]], $MachinePrecision]], t$95$1, N[(x + N[(N[(t - a), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{+114}:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\
\mathbf{elif}\;z \leq -1.36 \cdot 10^{-14} \lor \neg \left(z \leq 1.6 \cdot 10^{-18}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(t - a\right) \cdot \frac{z}{y}\\
\end{array}
\end{array}
if z < -2.5e144 or -8.8000000000000001e114 < z < -1.36e-14 or 1.6e-18 < z Initial program 42.6%
Taylor expanded in z around inf 74.0%
if -2.5e144 < z < -8.8000000000000001e114Initial program 39.8%
Taylor expanded in z around -inf 30.8%
+-commutative30.8%
associate--l+30.8%
Simplified32.0%
Taylor expanded in x around inf 40.0%
*-commutative40.0%
times-frac89.7%
Simplified89.7%
Taylor expanded in b around 0 90.2%
cancel-sign-sub-inv90.2%
+-commutative90.2%
metadata-eval90.2%
*-lft-identity90.2%
associate-+l+90.2%
associate-*r/90.2%
mul-1-neg90.2%
mul-1-neg90.2%
remove-double-neg90.2%
mul-1-neg90.2%
distribute-neg-in90.2%
mul-1-neg90.2%
sub-neg90.2%
div-sub90.2%
Simplified90.2%
if -1.36e-14 < z < 1.6e-18Initial program 93.0%
Taylor expanded in z around 0 73.1%
Taylor expanded in x around 0 79.8%
+-commutative79.8%
associate-/l*76.1%
Simplified76.1%
div-inv76.1%
clear-num76.1%
Applied egg-rr76.1%
Final simplification75.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4e-19)
t_1
(if (<= z -1.25e-62)
(/ (- t a) (/ y z))
(if (<= z 1.4e-47) (+ x (/ (* z t) y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4e-19) {
tmp = t_1;
} else if (z <= -1.25e-62) {
tmp = (t - a) / (y / z);
} else if (z <= 1.4e-47) {
tmp = x + ((z * t) / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-4d-19)) then
tmp = t_1
else if (z <= (-1.25d-62)) then
tmp = (t - a) / (y / z)
else if (z <= 1.4d-47) then
tmp = x + ((z * t) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4e-19) {
tmp = t_1;
} else if (z <= -1.25e-62) {
tmp = (t - a) / (y / z);
} else if (z <= 1.4e-47) {
tmp = x + ((z * t) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -4e-19: tmp = t_1 elif z <= -1.25e-62: tmp = (t - a) / (y / z) elif z <= 1.4e-47: tmp = x + ((z * t) / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4e-19) tmp = t_1; elseif (z <= -1.25e-62) tmp = Float64(Float64(t - a) / Float64(y / z)); elseif (z <= 1.4e-47) tmp = Float64(x + Float64(Float64(z * t) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -4e-19) tmp = t_1; elseif (z <= -1.25e-62) tmp = (t - a) / (y / z); elseif (z <= 1.4e-47) tmp = x + ((z * t) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e-19], t$95$1, If[LessEqual[z, -1.25e-62], N[(N[(t - a), $MachinePrecision] / N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-47], N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-62}:\\
\;\;\;\;\frac{t - a}{\frac{y}{z}}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-47}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.9999999999999999e-19 or 1.39999999999999996e-47 < z Initial program 44.5%
Taylor expanded in z around inf 70.4%
if -3.9999999999999999e-19 < z < -1.25e-62Initial program 99.7%
Taylor expanded in z around 0 83.7%
Taylor expanded in x around 0 83.7%
associate-/l*83.6%
Simplified83.6%
if -1.25e-62 < z < 1.39999999999999996e-47Initial program 92.0%
Taylor expanded in z around 0 73.4%
Taylor expanded in x around 0 81.1%
+-commutative81.1%
associate-/l*76.8%
Simplified76.8%
Taylor expanded in a around 0 73.3%
Final simplification72.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.4e-13) (not (<= z 1.85e-17))) (/ (- t a) (- b y)) (+ x (* (- t a) (/ z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.4e-13) || !(z <= 1.85e-17)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((t - a) * (z / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-8.4d-13)) .or. (.not. (z <= 1.85d-17))) then
tmp = (t - a) / (b - y)
else
tmp = x + ((t - a) * (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.4e-13) || !(z <= 1.85e-17)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((t - a) * (z / y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.4e-13) or not (z <= 1.85e-17): tmp = (t - a) / (b - y) else: tmp = x + ((t - a) * (z / y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.4e-13) || !(z <= 1.85e-17)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(t - a) * Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.4e-13) || ~((z <= 1.85e-17))) tmp = (t - a) / (b - y); else tmp = x + ((t - a) * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.4e-13], N[Not[LessEqual[z, 1.85e-17]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t - a), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.4 \cdot 10^{-13} \lor \neg \left(z \leq 1.85 \cdot 10^{-17}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t - a\right) \cdot \frac{z}{y}\\
\end{array}
\end{array}
if z < -8.39999999999999955e-13 or 1.8499999999999999e-17 < z Initial program 42.4%
Taylor expanded in z around inf 71.6%
if -8.39999999999999955e-13 < z < 1.8499999999999999e-17Initial program 93.0%
Taylor expanded in z around 0 73.1%
Taylor expanded in x around 0 79.8%
+-commutative79.8%
associate-/l*76.1%
Simplified76.1%
div-inv76.1%
clear-num76.1%
Applied egg-rr76.1%
Final simplification73.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.32e+222) (/ (- a) b) (if (or (<= z -2.2e-61) (not (<= z 0.0006))) (/ t (- b y)) (+ x (* z x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.32e+222) {
tmp = -a / b;
} else if ((z <= -2.2e-61) || !(z <= 0.0006)) {
tmp = t / (b - y);
} else {
tmp = x + (z * x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.32d+222)) then
tmp = -a / b
else if ((z <= (-2.2d-61)) .or. (.not. (z <= 0.0006d0))) then
tmp = t / (b - y)
else
tmp = x + (z * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.32e+222) {
tmp = -a / b;
} else if ((z <= -2.2e-61) || !(z <= 0.0006)) {
tmp = t / (b - y);
} else {
tmp = x + (z * x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.32e+222: tmp = -a / b elif (z <= -2.2e-61) or not (z <= 0.0006): tmp = t / (b - y) else: tmp = x + (z * x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.32e+222) tmp = Float64(Float64(-a) / b); elseif ((z <= -2.2e-61) || !(z <= 0.0006)) tmp = Float64(t / Float64(b - y)); else tmp = Float64(x + Float64(z * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.32e+222) tmp = -a / b; elseif ((z <= -2.2e-61) || ~((z <= 0.0006))) tmp = t / (b - y); else tmp = x + (z * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.32e+222], N[((-a) / b), $MachinePrecision], If[Or[LessEqual[z, -2.2e-61], N[Not[LessEqual[z, 0.0006]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+222}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-61} \lor \neg \left(z \leq 0.0006\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot x\\
\end{array}
\end{array}
if z < -1.31999999999999997e222Initial program 23.6%
Taylor expanded in z around -inf 72.5%
+-commutative72.5%
associate--l+72.5%
Simplified73.0%
Taylor expanded in x around inf 72.1%
*-commutative72.1%
times-frac99.8%
Simplified99.8%
Taylor expanded in a around inf 62.9%
associate-*r/62.9%
neg-mul-162.9%
Simplified62.9%
Taylor expanded in b around inf 50.5%
associate-*r/50.5%
neg-mul-150.5%
Simplified50.5%
if -1.31999999999999997e222 < z < -2.20000000000000009e-61 or 5.99999999999999947e-4 < z Initial program 49.0%
div-inv48.9%
fma-def48.9%
+-commutative48.9%
fma-def48.9%
Applied egg-rr48.9%
Taylor expanded in t around inf 26.1%
Taylor expanded in z around inf 36.0%
if -2.20000000000000009e-61 < z < 5.99999999999999947e-4Initial program 91.9%
Taylor expanded in y around inf 55.0%
+-commutative55.0%
mul-1-neg55.0%
unsub-neg55.0%
Simplified55.0%
Taylor expanded in z around 0 55.0%
Final simplification45.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5.6e+152) (/ (- a) b) (if (<= z -0.75) (/ (- x) z) (if (<= z 21.0) (+ x (* z x)) (/ t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.6e+152) {
tmp = -a / b;
} else if (z <= -0.75) {
tmp = -x / z;
} else if (z <= 21.0) {
tmp = x + (z * x);
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.6d+152)) then
tmp = -a / b
else if (z <= (-0.75d0)) then
tmp = -x / z
else if (z <= 21.0d0) then
tmp = x + (z * x)
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.6e+152) {
tmp = -a / b;
} else if (z <= -0.75) {
tmp = -x / z;
} else if (z <= 21.0) {
tmp = x + (z * x);
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5.6e+152: tmp = -a / b elif z <= -0.75: tmp = -x / z elif z <= 21.0: tmp = x + (z * x) else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.6e+152) tmp = Float64(Float64(-a) / b); elseif (z <= -0.75) tmp = Float64(Float64(-x) / z); elseif (z <= 21.0) tmp = Float64(x + Float64(z * x)); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5.6e+152) tmp = -a / b; elseif (z <= -0.75) tmp = -x / z; elseif (z <= 21.0) tmp = x + (z * x); else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.6e+152], N[((-a) / b), $MachinePrecision], If[LessEqual[z, -0.75], N[((-x) / z), $MachinePrecision], If[LessEqual[z, 21.0], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], N[(t / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+152}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq -0.75:\\
\;\;\;\;\frac{-x}{z}\\
\mathbf{elif}\;z \leq 21:\\
\;\;\;\;x + z \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -5.6000000000000004e152Initial program 34.9%
Taylor expanded in z around -inf 69.9%
+-commutative69.9%
associate--l+69.9%
Simplified76.4%
Taylor expanded in x around inf 70.3%
*-commutative70.3%
times-frac94.3%
Simplified94.3%
Taylor expanded in a around inf 53.9%
associate-*r/53.9%
neg-mul-153.9%
Simplified53.9%
Taylor expanded in b around inf 40.9%
associate-*r/40.9%
neg-mul-140.9%
Simplified40.9%
if -5.6000000000000004e152 < z < -0.75Initial program 49.5%
Taylor expanded in y around inf 38.1%
+-commutative38.1%
mul-1-neg38.1%
unsub-neg38.1%
Simplified38.1%
Taylor expanded in z around inf 36.3%
associate-*r/36.3%
mul-1-neg36.3%
Simplified36.3%
if -0.75 < z < 21Initial program 92.1%
Taylor expanded in y around inf 50.7%
+-commutative50.7%
mul-1-neg50.7%
unsub-neg50.7%
Simplified50.7%
Taylor expanded in z around 0 49.7%
if 21 < z Initial program 37.1%
div-inv37.1%
fma-def37.1%
+-commutative37.1%
fma-def37.1%
Applied egg-rr37.1%
Taylor expanded in t around inf 23.9%
Taylor expanded in b around inf 31.9%
Final simplification43.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.9e-61) (not (<= z 7e-48))) (/ (- t a) (- b y)) (+ x (/ (* z t) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.9e-61) || !(z <= 7e-48)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * t) / y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.9d-61)) .or. (.not. (z <= 7d-48))) then
tmp = (t - a) / (b - y)
else
tmp = x + ((z * t) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.9e-61) || !(z <= 7e-48)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * t) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.9e-61) or not (z <= 7e-48): tmp = (t - a) / (b - y) else: tmp = x + ((z * t) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.9e-61) || !(z <= 7e-48)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.9e-61) || ~((z <= 7e-48))) tmp = (t - a) / (b - y); else tmp = x + ((z * t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.9e-61], N[Not[LessEqual[z, 7e-48]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-61} \lor \neg \left(z \leq 7 \cdot 10^{-48}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\end{array}
\end{array}
if z < -1.8999999999999999e-61 or 6.99999999999999982e-48 < z Initial program 48.7%
Taylor expanded in z around inf 68.3%
if -1.8999999999999999e-61 < z < 6.99999999999999982e-48Initial program 92.1%
Taylor expanded in z around 0 73.6%
Taylor expanded in x around 0 81.3%
+-commutative81.3%
associate-/l*77.0%
Simplified77.0%
Taylor expanded in a around 0 72.7%
Final simplification70.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5.5e+149) (/ (- a) b) (if (<= z -1.0) (/ (- x) z) (if (<= z 21.0) x (/ t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.5e+149) {
tmp = -a / b;
} else if (z <= -1.0) {
tmp = -x / z;
} else if (z <= 21.0) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.5d+149)) then
tmp = -a / b
else if (z <= (-1.0d0)) then
tmp = -x / z
else if (z <= 21.0d0) then
tmp = x
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.5e+149) {
tmp = -a / b;
} else if (z <= -1.0) {
tmp = -x / z;
} else if (z <= 21.0) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5.5e+149: tmp = -a / b elif z <= -1.0: tmp = -x / z elif z <= 21.0: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.5e+149) tmp = Float64(Float64(-a) / b); elseif (z <= -1.0) tmp = Float64(Float64(-x) / z); elseif (z <= 21.0) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5.5e+149) tmp = -a / b; elseif (z <= -1.0) tmp = -x / z; elseif (z <= 21.0) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.5e+149], N[((-a) / b), $MachinePrecision], If[LessEqual[z, -1.0], N[((-x) / z), $MachinePrecision], If[LessEqual[z, 21.0], x, N[(t / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+149}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq -1:\\
\;\;\;\;\frac{-x}{z}\\
\mathbf{elif}\;z \leq 21:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -5.49999999999999999e149Initial program 34.9%
Taylor expanded in z around -inf 69.9%
+-commutative69.9%
associate--l+69.9%
Simplified76.4%
Taylor expanded in x around inf 70.3%
*-commutative70.3%
times-frac94.3%
Simplified94.3%
Taylor expanded in a around inf 53.9%
associate-*r/53.9%
neg-mul-153.9%
Simplified53.9%
Taylor expanded in b around inf 40.9%
associate-*r/40.9%
neg-mul-140.9%
Simplified40.9%
if -5.49999999999999999e149 < z < -1Initial program 49.5%
Taylor expanded in y around inf 38.1%
+-commutative38.1%
mul-1-neg38.1%
unsub-neg38.1%
Simplified38.1%
Taylor expanded in z around inf 36.3%
associate-*r/36.3%
mul-1-neg36.3%
Simplified36.3%
if -1 < z < 21Initial program 92.1%
Taylor expanded in z around 0 49.0%
if 21 < z Initial program 37.1%
div-inv37.1%
fma-def37.1%
+-commutative37.1%
fma-def37.1%
Applied egg-rr37.1%
Taylor expanded in t around inf 23.9%
Taylor expanded in b around inf 31.9%
Final simplification42.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.45e-55) (not (<= y 2.5e-125))) (/ x (- 1.0 z)) (/ (- a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.45e-55) || !(y <= 2.5e-125)) {
tmp = x / (1.0 - z);
} else {
tmp = -a / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.45d-55)) .or. (.not. (y <= 2.5d-125))) then
tmp = x / (1.0d0 - z)
else
tmp = -a / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.45e-55) || !(y <= 2.5e-125)) {
tmp = x / (1.0 - z);
} else {
tmp = -a / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.45e-55) or not (y <= 2.5e-125): tmp = x / (1.0 - z) else: tmp = -a / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.45e-55) || !(y <= 2.5e-125)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(-a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.45e-55) || ~((y <= 2.5e-125))) tmp = x / (1.0 - z); else tmp = -a / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.45e-55], N[Not[LessEqual[y, 2.5e-125]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[((-a) / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-55} \lor \neg \left(y \leq 2.5 \cdot 10^{-125}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{b}\\
\end{array}
\end{array}
if y < -1.45e-55 or 2.49999999999999983e-125 < y Initial program 58.8%
Taylor expanded in y around inf 53.0%
+-commutative53.0%
mul-1-neg53.0%
unsub-neg53.0%
Simplified53.0%
if -1.45e-55 < y < 2.49999999999999983e-125Initial program 84.2%
Taylor expanded in z around -inf 65.1%
+-commutative65.1%
associate--l+65.1%
Simplified66.3%
Taylor expanded in x around inf 75.8%
*-commutative75.8%
times-frac70.1%
Simplified70.1%
Taylor expanded in a around inf 48.6%
associate-*r/48.6%
neg-mul-148.6%
Simplified48.6%
Taylor expanded in b around inf 40.7%
associate-*r/40.7%
neg-mul-140.7%
Simplified40.7%
Final simplification48.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.4e-56) (not (<= y 4e-48))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.4e-56) || !(y <= 4e-48)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-5.4d-56)) .or. (.not. (y <= 4d-48))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.4e-56) || !(y <= 4e-48)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.4e-56) or not (y <= 4e-48): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.4e-56) || !(y <= 4e-48)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5.4e-56) || ~((y <= 4e-48))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.4e-56], N[Not[LessEqual[y, 4e-48]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-56} \lor \neg \left(y \leq 4 \cdot 10^{-48}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -5.3999999999999999e-56 or 3.9999999999999999e-48 < y Initial program 57.4%
Taylor expanded in y around inf 56.0%
+-commutative56.0%
mul-1-neg56.0%
unsub-neg56.0%
Simplified56.0%
if -5.3999999999999999e-56 < y < 3.9999999999999999e-48Initial program 82.0%
Taylor expanded in y around 0 64.9%
Final simplification59.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -8.2e-50) (/ a y) (if (<= z 1.0) x (/ a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8.2e-50) {
tmp = a / y;
} else if (z <= 1.0) {
tmp = x;
} else {
tmp = a / y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-8.2d-50)) then
tmp = a / y
else if (z <= 1.0d0) then
tmp = x
else
tmp = a / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8.2e-50) {
tmp = a / y;
} else if (z <= 1.0) {
tmp = x;
} else {
tmp = a / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -8.2e-50: tmp = a / y elif z <= 1.0: tmp = x else: tmp = a / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8.2e-50) tmp = Float64(a / y); elseif (z <= 1.0) tmp = x; else tmp = Float64(a / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -8.2e-50) tmp = a / y; elseif (z <= 1.0) tmp = x; else tmp = a / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.2e-50], N[(a / y), $MachinePrecision], If[LessEqual[z, 1.0], x, N[(a / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{a}{y}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{y}\\
\end{array}
\end{array}
if z < -8.19999999999999971e-50 or 1 < z Initial program 44.8%
Taylor expanded in z around -inf 61.0%
+-commutative61.0%
associate--l+61.0%
Simplified68.2%
Taylor expanded in x around inf 67.0%
*-commutative67.0%
times-frac86.9%
Simplified86.9%
Taylor expanded in a around inf 41.4%
associate-*r/41.4%
neg-mul-141.4%
Simplified41.4%
Taylor expanded in b around 0 20.1%
if -8.19999999999999971e-50 < z < 1Initial program 92.0%
Taylor expanded in z around 0 53.7%
Final simplification36.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.1e-62) (/ t b) (if (<= z 21.0) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-62) {
tmp = t / b;
} else if (z <= 21.0) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.1d-62)) then
tmp = t / b
else if (z <= 21.0d0) then
tmp = x
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-62) {
tmp = t / b;
} else if (z <= 21.0) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.1e-62: tmp = t / b elif z <= 21.0: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.1e-62) tmp = Float64(t / b); elseif (z <= 21.0) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.1e-62) tmp = t / b; elseif (z <= 21.0) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.1e-62], N[(t / b), $MachinePrecision], If[LessEqual[z, 21.0], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 21:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -2.0999999999999999e-62 or 21 < z Initial program 45.2%
div-inv45.2%
fma-def45.2%
+-commutative45.2%
fma-def45.2%
Applied egg-rr45.2%
Taylor expanded in t around inf 23.9%
Taylor expanded in b around inf 25.1%
if -2.0999999999999999e-62 < z < 21Initial program 92.0%
Taylor expanded in z around 0 54.0%
Final simplification38.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.9e+24) (/ (- a) b) (if (<= z 21.0) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e+24) {
tmp = -a / b;
} else if (z <= 21.0) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.9d+24)) then
tmp = -a / b
else if (z <= 21.0d0) then
tmp = x
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e+24) {
tmp = -a / b;
} else if (z <= 21.0) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.9e+24: tmp = -a / b elif z <= 21.0: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.9e+24) tmp = Float64(Float64(-a) / b); elseif (z <= 21.0) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.9e+24) tmp = -a / b; elseif (z <= 21.0) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.9e+24], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 21.0], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+24}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 21:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -1.90000000000000008e24Initial program 41.6%
Taylor expanded in z around -inf 60.0%
+-commutative60.0%
associate--l+60.0%
Simplified67.0%
Taylor expanded in x around inf 65.2%
*-commutative65.2%
times-frac90.8%
Simplified90.8%
Taylor expanded in a around inf 46.2%
associate-*r/46.2%
neg-mul-146.2%
Simplified46.2%
Taylor expanded in b around inf 32.8%
associate-*r/32.8%
neg-mul-132.8%
Simplified32.8%
if -1.90000000000000008e24 < z < 21Initial program 91.5%
Taylor expanded in z around 0 48.5%
if 21 < z Initial program 37.1%
div-inv37.1%
fma-def37.1%
+-commutative37.1%
fma-def37.1%
Applied egg-rr37.1%
Taylor expanded in t around inf 23.9%
Taylor expanded in b around inf 31.9%
Final simplification41.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 67.3%
Taylor expanded in z around 0 27.5%
Final simplification27.5%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2023240
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:herbie-target
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))