
(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 17 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 -16000000000000.0) (not (<= z 4.8e+14)))
(+
(/ (+ (/ y (/ (- b y) x)) (/ (- a t) (/ (pow (- b y) 2.0) y))) z)
(/ (- t a) (- b y)))
(/ (fma x y (* z (- t a))) (fma z (- b y) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -16000000000000.0) || !(z <= 4.8e+14)) {
tmp = (((y / ((b - y) / x)) + ((a - t) / (pow((b - y), 2.0) / y))) / z) + ((t - a) / (b - y));
} else {
tmp = fma(x, y, (z * (t - a))) / fma(z, (b - y), y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -16000000000000.0) || !(z <= 4.8e+14)) tmp = Float64(Float64(Float64(Float64(y / Float64(Float64(b - y) / x)) + Float64(Float64(a - t) / Float64((Float64(b - y) ^ 2.0) / y))) / z) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / fma(z, Float64(b - y), y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -16000000000000.0], N[Not[LessEqual[z, 4.8e+14]], $MachinePrecision]], N[(N[(N[(N[(y / N[(N[(b - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(a - t), $MachinePrecision] / N[(N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -16000000000000 \lor \neg \left(z \leq 4.8 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{\frac{y}{\frac{b - y}{x}} + \frac{a - t}{\frac{{\left(b - y\right)}^{2}}{y}}}{z} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\end{array}
\end{array}
if z < -1.6e13 or 4.8e14 < z Initial program 42.0%
Taylor expanded in z around -inf 65.6%
+-commutative65.6%
associate--l+65.6%
Simplified95.8%
if -1.6e13 < z < 4.8e14Initial program 90.1%
fma-def90.1%
+-commutative90.1%
fma-def90.1%
Simplified90.1%
Final simplification92.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (or (<= z -1.25e+15) (not (<= z 10000000000000.0)))
(+
(/ (+ (/ y (/ (- b y) x)) (/ (- a t) (/ (pow (- b y) 2.0) y))) z)
(/ (- t a) (- b y)))
(- (/ (* y x) t_1) (/ (* z (- a t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -1.25e+15) || !(z <= 10000000000000.0)) {
tmp = (((y / ((b - y) / x)) + ((a - t) / (pow((b - y), 2.0) / y))) / z) + ((t - a) / (b - y));
} else {
tmp = ((y * x) / t_1) - ((z * (a - t)) / 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 * (b - y))
if ((z <= (-1.25d+15)) .or. (.not. (z <= 10000000000000.0d0))) then
tmp = (((y / ((b - y) / x)) + ((a - t) / (((b - y) ** 2.0d0) / y))) / z) + ((t - a) / (b - y))
else
tmp = ((y * x) / t_1) - ((z * (a - t)) / 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 * (b - y));
double tmp;
if ((z <= -1.25e+15) || !(z <= 10000000000000.0)) {
tmp = (((y / ((b - y) / x)) + ((a - t) / (Math.pow((b - y), 2.0) / y))) / z) + ((t - a) / (b - y));
} else {
tmp = ((y * x) / t_1) - ((z * (a - t)) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) tmp = 0 if (z <= -1.25e+15) or not (z <= 10000000000000.0): tmp = (((y / ((b - y) / x)) + ((a - t) / (math.pow((b - y), 2.0) / y))) / z) + ((t - a) / (b - y)) else: tmp = ((y * x) / t_1) - ((z * (a - t)) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) tmp = 0.0 if ((z <= -1.25e+15) || !(z <= 10000000000000.0)) tmp = Float64(Float64(Float64(Float64(y / Float64(Float64(b - y) / x)) + Float64(Float64(a - t) / Float64((Float64(b - y) ^ 2.0) / y))) / z) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(Float64(Float64(y * x) / t_1) - Float64(Float64(z * Float64(a - t)) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); tmp = 0.0; if ((z <= -1.25e+15) || ~((z <= 10000000000000.0))) tmp = (((y / ((b - y) / x)) + ((a - t) / (((b - y) ^ 2.0) / y))) / z) + ((t - a) / (b - y)); else tmp = ((y * x) / t_1) - ((z * (a - t)) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -1.25e+15], N[Not[LessEqual[z, 10000000000000.0]], $MachinePrecision]], N[(N[(N[(N[(y / N[(N[(b - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(a - t), $MachinePrecision] / N[(N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+15} \lor \neg \left(z \leq 10000000000000\right):\\
\;\;\;\;\frac{\frac{y}{\frac{b - y}{x}} + \frac{a - t}{\frac{{\left(b - y\right)}^{2}}{y}}}{z} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{t_1} - \frac{z \cdot \left(a - t\right)}{t_1}\\
\end{array}
\end{array}
if z < -1.25e15 or 1e13 < z Initial program 42.0%
Taylor expanded in z around -inf 65.6%
+-commutative65.6%
associate--l+65.6%
Simplified95.8%
if -1.25e15 < z < 1e13Initial program 90.1%
Taylor expanded in x around inf 90.1%
Final simplification92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (- x (/ (* z (- a t)) t_1)))
(t_3 (/ (- t a) (- b y))))
(if (<= z -270.0)
t_3
(if (<= z 3.8e-298)
t_2
(if (<= z 1.3e-209)
(/ (- (* y x) (* z a)) t_1)
(if (<= z 1.55) t_2 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = x - ((z * (a - t)) / t_1);
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -270.0) {
tmp = t_3;
} else if (z <= 3.8e-298) {
tmp = t_2;
} else if (z <= 1.3e-209) {
tmp = ((y * x) - (z * a)) / t_1;
} else if (z <= 1.55) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = y + (z * (b - y))
t_2 = x - ((z * (a - t)) / t_1)
t_3 = (t - a) / (b - y)
if (z <= (-270.0d0)) then
tmp = t_3
else if (z <= 3.8d-298) then
tmp = t_2
else if (z <= 1.3d-209) then
tmp = ((y * x) - (z * a)) / t_1
else if (z <= 1.55d0) then
tmp = t_2
else
tmp = t_3
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 * (b - y));
double t_2 = x - ((z * (a - t)) / t_1);
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -270.0) {
tmp = t_3;
} else if (z <= 3.8e-298) {
tmp = t_2;
} else if (z <= 1.3e-209) {
tmp = ((y * x) - (z * a)) / t_1;
} else if (z <= 1.55) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = x - ((z * (a - t)) / t_1) t_3 = (t - a) / (b - y) tmp = 0 if z <= -270.0: tmp = t_3 elif z <= 3.8e-298: tmp = t_2 elif z <= 1.3e-209: tmp = ((y * x) - (z * a)) / t_1 elif z <= 1.55: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(x - Float64(Float64(z * Float64(a - t)) / t_1)) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -270.0) tmp = t_3; elseif (z <= 3.8e-298) tmp = t_2; elseif (z <= 1.3e-209) tmp = Float64(Float64(Float64(y * x) - Float64(z * a)) / t_1); elseif (z <= 1.55) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = x - ((z * (a - t)) / t_1); t_3 = (t - a) / (b - y); tmp = 0.0; if (z <= -270.0) tmp = t_3; elseif (z <= 3.8e-298) tmp = t_2; elseif (z <= 1.3e-209) tmp = ((y * x) - (z * a)) / t_1; elseif (z <= 1.55) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -270.0], t$95$3, If[LessEqual[z, 3.8e-298], t$95$2, If[LessEqual[z, 1.3e-209], N[(N[(N[(y * x), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 1.55], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := x - \frac{z \cdot \left(a - t\right)}{t_1}\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -270:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-298}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-209}:\\
\;\;\;\;\frac{y \cdot x - z \cdot a}{t_1}\\
\mathbf{elif}\;z \leq 1.55:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -270 or 1.55000000000000004 < z Initial program 45.2%
Taylor expanded in z around inf 72.1%
if -270 < z < 3.8e-298 or 1.29999999999999992e-209 < z < 1.55000000000000004Initial program 88.1%
Taylor expanded in x around inf 88.2%
Taylor expanded in z around 0 77.0%
if 3.8e-298 < z < 1.29999999999999992e-209Initial program 99.7%
Taylor expanded in t around 0 94.2%
*-commutative94.2%
mul-1-neg94.2%
unsub-neg94.2%
*-commutative94.2%
Simplified94.2%
Final simplification75.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.6e+86) (not (<= z 1.26e+84))) (/ (- t a) (- b y)) (/ (+ (* y x) (- (* z t) (* z a))) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.6e+86) || !(z <= 1.26e+84)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) + ((z * t) - (z * 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 <= (-8.6d+86)) .or. (.not. (z <= 1.26d+84))) then
tmp = (t - a) / (b - y)
else
tmp = ((y * x) + ((z * t) - (z * 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 <= -8.6e+86) || !(z <= 1.26e+84)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) + ((z * t) - (z * a))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.6e+86) or not (z <= 1.26e+84): tmp = (t - a) / (b - y) else: tmp = ((y * x) + ((z * t) - (z * a))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.6e+86) || !(z <= 1.26e+84)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(y * x) + Float64(Float64(z * t) - Float64(z * 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 <= -8.6e+86) || ~((z <= 1.26e+84))) tmp = (t - a) / (b - y); else tmp = ((y * x) + ((z * t) - (z * a))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.6e+86], N[Not[LessEqual[z, 1.26e+84]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(z * 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 -8.6 \cdot 10^{+86} \lor \neg \left(z \leq 1.26 \cdot 10^{+84}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x + \left(z \cdot t - z \cdot a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -8.6000000000000004e86 or 1.26000000000000007e84 < z Initial program 31.4%
Taylor expanded in z around inf 75.4%
if -8.6000000000000004e86 < z < 1.26000000000000007e84Initial program 87.1%
sub-neg87.1%
distribute-lft-in87.1%
Applied egg-rr87.1%
Final simplification83.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.9e+86) (not (<= z 4.5e+84))) (/ (- t a) (- b y)) (/ (- (* y x) (* z (- a t))) (+ (* y (- 1.0 z)) (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.9e+86) || !(z <= 4.5e+84)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) - (z * (a - t))) / ((y * (1.0 - z)) + (z * 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 <= (-7.9d+86)) .or. (.not. (z <= 4.5d+84))) then
tmp = (t - a) / (b - y)
else
tmp = ((y * x) - (z * (a - t))) / ((y * (1.0d0 - z)) + (z * 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 <= -7.9e+86) || !(z <= 4.5e+84)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) - (z * (a - t))) / ((y * (1.0 - z)) + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.9e+86) or not (z <= 4.5e+84): tmp = (t - a) / (b - y) else: tmp = ((y * x) - (z * (a - t))) / ((y * (1.0 - z)) + (z * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.9e+86) || !(z <= 4.5e+84)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(y * x) - Float64(z * Float64(a - t))) / Float64(Float64(y * Float64(1.0 - z)) + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -7.9e+86) || ~((z <= 4.5e+84))) tmp = (t - a) / (b - y); else tmp = ((y * x) - (z * (a - t))) / ((y * (1.0 - z)) + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.9e+86], N[Not[LessEqual[z, 4.5e+84]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.9 \cdot 10^{+86} \lor \neg \left(z \leq 4.5 \cdot 10^{+84}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x - z \cdot \left(a - t\right)}{y \cdot \left(1 - z\right) + z \cdot b}\\
\end{array}
\end{array}
if z < -7.90000000000000025e86 or 4.4999999999999997e84 < z Initial program 31.4%
Taylor expanded in z around inf 75.4%
if -7.90000000000000025e86 < z < 4.4999999999999997e84Initial program 87.1%
Taylor expanded in y around 0 87.1%
Final simplification83.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.5e+86) (not (<= z 1.1e+85))) (/ (- t a) (- b y)) (/ (- (* y x) (* z (- a t))) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.5e+86) || !(z <= 1.1e+85)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) - (z * (a - t))) / (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 <= (-9.5d+86)) .or. (.not. (z <= 1.1d+85))) then
tmp = (t - a) / (b - y)
else
tmp = ((y * x) - (z * (a - t))) / (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 <= -9.5e+86) || !(z <= 1.1e+85)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) - (z * (a - t))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.5e+86) or not (z <= 1.1e+85): tmp = (t - a) / (b - y) else: tmp = ((y * x) - (z * (a - t))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.5e+86) || !(z <= 1.1e+85)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(y * x) - Float64(z * Float64(a - t))) / 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 <= -9.5e+86) || ~((z <= 1.1e+85))) tmp = (t - a) / (b - y); else tmp = ((y * x) - (z * (a - t))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.5e+86], N[Not[LessEqual[z, 1.1e+85]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+86} \lor \neg \left(z \leq 1.1 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x - z \cdot \left(a - t\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -9.50000000000000028e86 or 1.1000000000000001e85 < z Initial program 31.4%
Taylor expanded in z around inf 75.4%
if -9.50000000000000028e86 < z < 1.1000000000000001e85Initial program 87.1%
Final simplification83.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -125.0) (not (<= z 1.05))) (/ (- t a) (- b y)) (- x (/ (* z (- a t)) (+ y (* z (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -125.0) || !(z <= 1.05)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - ((z * (a - t)) / (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 <= (-125.0d0)) .or. (.not. (z <= 1.05d0))) then
tmp = (t - a) / (b - y)
else
tmp = x - ((z * (a - t)) / (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 <= -125.0) || !(z <= 1.05)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - ((z * (a - t)) / (y + (z * (b - y))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -125.0) or not (z <= 1.05): tmp = (t - a) / (b - y) else: tmp = x - ((z * (a - t)) / (y + (z * (b - y)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -125.0) || !(z <= 1.05)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x - Float64(Float64(z * Float64(a - t)) / 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 <= -125.0) || ~((z <= 1.05))) tmp = (t - a) / (b - y); else tmp = x - ((z * (a - t)) / (y + (z * (b - y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -125.0], N[Not[LessEqual[z, 1.05]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -125 \lor \neg \left(z \leq 1.05\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot \left(a - t\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -125 or 1.05000000000000004 < z Initial program 45.2%
Taylor expanded in z around inf 72.1%
if -125 < z < 1.05000000000000004Initial program 89.6%
Taylor expanded in x around inf 89.7%
Taylor expanded in z around 0 74.8%
Final simplification73.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -7.5e+90)
(/ (- a) b)
(if (<= z -5.3e+41)
(- (/ x z))
(if (or (<= z -110000000000.0) (not (<= z 5e-87))) (/ t (- b y)) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.5e+90) {
tmp = -a / b;
} else if (z <= -5.3e+41) {
tmp = -(x / z);
} else if ((z <= -110000000000.0) || !(z <= 5e-87)) {
tmp = t / (b - y);
} else {
tmp = 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 <= (-7.5d+90)) then
tmp = -a / b
else if (z <= (-5.3d+41)) then
tmp = -(x / z)
else if ((z <= (-110000000000.0d0)) .or. (.not. (z <= 5d-87))) then
tmp = t / (b - y)
else
tmp = 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 <= -7.5e+90) {
tmp = -a / b;
} else if (z <= -5.3e+41) {
tmp = -(x / z);
} else if ((z <= -110000000000.0) || !(z <= 5e-87)) {
tmp = t / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -7.5e+90: tmp = -a / b elif z <= -5.3e+41: tmp = -(x / z) elif (z <= -110000000000.0) or not (z <= 5e-87): tmp = t / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.5e+90) tmp = Float64(Float64(-a) / b); elseif (z <= -5.3e+41) tmp = Float64(-Float64(x / z)); elseif ((z <= -110000000000.0) || !(z <= 5e-87)) tmp = Float64(t / Float64(b - y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -7.5e+90) tmp = -a / b; elseif (z <= -5.3e+41) tmp = -(x / z); elseif ((z <= -110000000000.0) || ~((z <= 5e-87))) tmp = t / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.5e+90], N[((-a) / b), $MachinePrecision], If[LessEqual[z, -5.3e+41], (-N[(x / z), $MachinePrecision]), If[Or[LessEqual[z, -110000000000.0], N[Not[LessEqual[z, 5e-87]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq -5.3 \cdot 10^{+41}:\\
\;\;\;\;-\frac{x}{z}\\
\mathbf{elif}\;z \leq -110000000000 \lor \neg \left(z \leq 5 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.50000000000000014e90Initial program 39.7%
Taylor expanded in b around inf 24.5%
Taylor expanded in a around inf 34.8%
mul-1-neg34.8%
Simplified34.8%
if -7.50000000000000014e90 < z < -5.2999999999999997e41Initial program 41.4%
Taylor expanded in y around inf 54.8%
+-commutative54.8%
mul-1-neg54.8%
unsub-neg54.8%
Simplified54.8%
Taylor expanded in z around inf 54.8%
associate-*r/54.8%
mul-1-neg54.8%
Simplified54.8%
if -5.2999999999999997e41 < z < -1.1e11 or 5.00000000000000042e-87 < z Initial program 54.3%
sub-neg54.3%
distribute-lft-in54.3%
Applied egg-rr54.3%
Taylor expanded in t around inf 27.4%
*-commutative27.4%
Simplified27.4%
Taylor expanded in z around inf 40.3%
if -1.1e11 < z < 5.00000000000000042e-87Initial program 90.8%
Taylor expanded in z around 0 40.7%
Final simplification40.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -1.02e+30)
t_1
(if (<= y -3900000.0)
(/ (* y x) (* z b))
(if (<= y -7.5e-14) x (if (<= y 1.2e-7) (/ (- t a) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.02e+30) {
tmp = t_1;
} else if (y <= -3900000.0) {
tmp = (y * x) / (z * b);
} else if (y <= -7.5e-14) {
tmp = x;
} else if (y <= 1.2e-7) {
tmp = (t - a) / b;
} 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 = x / (1.0d0 - z)
if (y <= (-1.02d+30)) then
tmp = t_1
else if (y <= (-3900000.0d0)) then
tmp = (y * x) / (z * b)
else if (y <= (-7.5d-14)) then
tmp = x
else if (y <= 1.2d-7) then
tmp = (t - a) / b
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 = x / (1.0 - z);
double tmp;
if (y <= -1.02e+30) {
tmp = t_1;
} else if (y <= -3900000.0) {
tmp = (y * x) / (z * b);
} else if (y <= -7.5e-14) {
tmp = x;
} else if (y <= 1.2e-7) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -1.02e+30: tmp = t_1 elif y <= -3900000.0: tmp = (y * x) / (z * b) elif y <= -7.5e-14: tmp = x elif y <= 1.2e-7: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -1.02e+30) tmp = t_1; elseif (y <= -3900000.0) tmp = Float64(Float64(y * x) / Float64(z * b)); elseif (y <= -7.5e-14) tmp = x; elseif (y <= 1.2e-7) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -1.02e+30) tmp = t_1; elseif (y <= -3900000.0) tmp = (y * x) / (z * b); elseif (y <= -7.5e-14) tmp = x; elseif (y <= 1.2e-7) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+30], t$95$1, If[LessEqual[y, -3900000.0], N[(N[(y * x), $MachinePrecision] / N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.5e-14], x, If[LessEqual[y, 1.2e-7], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3900000:\\
\;\;\;\;\frac{y \cdot x}{z \cdot b}\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-7}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.02e30 or 1.19999999999999989e-7 < y Initial program 50.5%
Taylor expanded in y around inf 55.5%
+-commutative55.5%
mul-1-neg55.5%
unsub-neg55.5%
Simplified55.5%
if -1.02e30 < y < -3.9e6Initial program 99.7%
Taylor expanded in b around inf 79.6%
Taylor expanded in z around 0 79.8%
if -3.9e6 < y < -7.4999999999999996e-14Initial program 100.0%
Taylor expanded in z around 0 100.0%
if -7.4999999999999996e-14 < y < 1.19999999999999989e-7Initial program 83.4%
Taylor expanded in y around 0 54.9%
Final simplification56.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.7) (not (<= z 3.5e-6))) (/ (- t a) (- b y)) (- x (/ (* z (- a t)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.7) || !(z <= 3.5e-6)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - ((z * (a - 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 <= (-0.7d0)) .or. (.not. (z <= 3.5d-6))) then
tmp = (t - a) / (b - y)
else
tmp = x - ((z * (a - 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 <= -0.7) || !(z <= 3.5e-6)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - ((z * (a - t)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.7) or not (z <= 3.5e-6): tmp = (t - a) / (b - y) else: tmp = x - ((z * (a - t)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.7) || !(z <= 3.5e-6)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x - Float64(Float64(z * Float64(a - t)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.7) || ~((z <= 3.5e-6))) tmp = (t - a) / (b - y); else tmp = x - ((z * (a - t)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.7], N[Not[LessEqual[z, 3.5e-6]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.7 \lor \neg \left(z \leq 3.5 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot \left(a - t\right)}{y}\\
\end{array}
\end{array}
if z < -0.69999999999999996 or 3.49999999999999995e-6 < z Initial program 45.2%
Taylor expanded in z around inf 72.1%
if -0.69999999999999996 < z < 3.49999999999999995e-6Initial program 89.6%
+-commutative89.6%
*-commutative89.6%
add-cube-cbrt89.2%
associate-*l*89.2%
fma-def89.2%
pow289.2%
Applied egg-rr89.2%
Taylor expanded in y around inf 64.4%
Final simplification68.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -5.2e+40)
t_1
(if (<= y -6e-178) (/ t (- b y)) (if (<= y 6.8e-18) (/ (- a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -5.2e+40) {
tmp = t_1;
} else if (y <= -6e-178) {
tmp = t / (b - y);
} else if (y <= 6.8e-18) {
tmp = -a / b;
} 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 = x / (1.0d0 - z)
if (y <= (-5.2d+40)) then
tmp = t_1
else if (y <= (-6d-178)) then
tmp = t / (b - y)
else if (y <= 6.8d-18) then
tmp = -a / b
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 = x / (1.0 - z);
double tmp;
if (y <= -5.2e+40) {
tmp = t_1;
} else if (y <= -6e-178) {
tmp = t / (b - y);
} else if (y <= 6.8e-18) {
tmp = -a / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -5.2e+40: tmp = t_1 elif y <= -6e-178: tmp = t / (b - y) elif y <= 6.8e-18: tmp = -a / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -5.2e+40) tmp = t_1; elseif (y <= -6e-178) tmp = Float64(t / Float64(b - y)); elseif (y <= 6.8e-18) tmp = Float64(Float64(-a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -5.2e+40) tmp = t_1; elseif (y <= -6e-178) tmp = t / (b - y); elseif (y <= 6.8e-18) tmp = -a / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e+40], t$95$1, If[LessEqual[y, -6e-178], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e-18], N[((-a) / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-178}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-18}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.2000000000000001e40 or 6.80000000000000002e-18 < y Initial program 51.2%
Taylor expanded in y around inf 55.6%
+-commutative55.6%
mul-1-neg55.6%
unsub-neg55.6%
Simplified55.6%
if -5.2000000000000001e40 < y < -5.9999999999999997e-178Initial program 76.4%
sub-neg76.4%
distribute-lft-in76.3%
Applied egg-rr76.3%
Taylor expanded in t around inf 32.5%
*-commutative32.5%
Simplified32.5%
Taylor expanded in z around inf 30.4%
if -5.9999999999999997e-178 < y < 6.80000000000000002e-18Initial program 88.0%
Taylor expanded in b around inf 58.8%
Taylor expanded in a around inf 37.9%
mul-1-neg37.9%
Simplified37.9%
Final simplification45.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.7) (not (<= z 1.35e-69))) (/ (- 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 <= -0.7) || !(z <= 1.35e-69)) {
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 <= (-0.7d0)) .or. (.not. (z <= 1.35d-69))) 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 <= -0.7) || !(z <= 1.35e-69)) {
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 <= -0.7) or not (z <= 1.35e-69): 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 <= -0.7) || !(z <= 1.35e-69)) 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 <= -0.7) || ~((z <= 1.35e-69))) 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, -0.7], N[Not[LessEqual[z, 1.35e-69]], $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 -0.7 \lor \neg \left(z \leq 1.35 \cdot 10^{-69}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\end{array}
\end{array}
if z < -0.69999999999999996 or 1.3499999999999999e-69 < z Initial program 48.3%
Taylor expanded in z around inf 69.1%
if -0.69999999999999996 < z < 1.3499999999999999e-69Initial program 90.9%
Taylor expanded in z around 0 47.5%
Taylor expanded in t around inf 59.3%
*-commutative59.3%
Simplified59.3%
Final simplification64.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.2e+90) (/ (- a) b) (if (or (<= z -1.0) (not (<= z 1.8e-7))) (- (/ x z)) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.2e+90) {
tmp = -a / b;
} else if ((z <= -1.0) || !(z <= 1.8e-7)) {
tmp = -(x / z);
} else {
tmp = 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 <= (-2.2d+90)) then
tmp = -a / b
else if ((z <= (-1.0d0)) .or. (.not. (z <= 1.8d-7))) then
tmp = -(x / z)
else
tmp = 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 <= -2.2e+90) {
tmp = -a / b;
} else if ((z <= -1.0) || !(z <= 1.8e-7)) {
tmp = -(x / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.2e+90: tmp = -a / b elif (z <= -1.0) or not (z <= 1.8e-7): tmp = -(x / z) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.2e+90) tmp = Float64(Float64(-a) / b); elseif ((z <= -1.0) || !(z <= 1.8e-7)) tmp = Float64(-Float64(x / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.2e+90) tmp = -a / b; elseif ((z <= -1.0) || ~((z <= 1.8e-7))) tmp = -(x / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.2e+90], N[((-a) / b), $MachinePrecision], If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.8e-7]], $MachinePrecision]], (-N[(x / z), $MachinePrecision]), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+90}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq -1 \lor \neg \left(z \leq 1.8 \cdot 10^{-7}\right):\\
\;\;\;\;-\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.1999999999999999e90Initial program 39.7%
Taylor expanded in b around inf 24.5%
Taylor expanded in a around inf 34.8%
mul-1-neg34.8%
Simplified34.8%
if -2.1999999999999999e90 < z < -1 or 1.79999999999999997e-7 < z Initial program 48.9%
Taylor expanded in y around inf 25.5%
+-commutative25.5%
mul-1-neg25.5%
unsub-neg25.5%
Simplified25.5%
Taylor expanded in z around inf 25.1%
associate-*r/25.1%
mul-1-neg25.1%
Simplified25.1%
if -1 < z < 1.79999999999999997e-7Initial program 89.5%
Taylor expanded in z around 0 39.1%
Final simplification33.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.65e-5) (not (<= y 1.1e-6))) (/ 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 <= -1.65e-5) || !(y <= 1.1e-6)) {
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 <= (-1.65d-5)) .or. (.not. (y <= 1.1d-6))) 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 <= -1.65e-5) || !(y <= 1.1e-6)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.65e-5) or not (y <= 1.1e-6): 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 <= -1.65e-5) || !(y <= 1.1e-6)) 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 <= -1.65e-5) || ~((y <= 1.1e-6))) 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, -1.65e-5], N[Not[LessEqual[y, 1.1e-6]], $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 -1.65 \cdot 10^{-5} \lor \neg \left(y \leq 1.1 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -1.6500000000000001e-5 or 1.1000000000000001e-6 < y Initial program 53.1%
Taylor expanded in y around inf 53.5%
+-commutative53.5%
mul-1-neg53.5%
unsub-neg53.5%
Simplified53.5%
if -1.6500000000000001e-5 < y < 1.1000000000000001e-6Initial program 83.4%
Taylor expanded in y around 0 54.9%
Final simplification54.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.52e-9) x (if (<= y 140000000.0) (/ (- a) b) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.52e-9) {
tmp = x;
} else if (y <= 140000000.0) {
tmp = -a / b;
} else {
tmp = 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 (y <= (-1.52d-9)) then
tmp = x
else if (y <= 140000000.0d0) then
tmp = -a / b
else
tmp = 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 (y <= -1.52e-9) {
tmp = x;
} else if (y <= 140000000.0) {
tmp = -a / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.52e-9: tmp = x elif y <= 140000000.0: tmp = -a / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.52e-9) tmp = x; elseif (y <= 140000000.0) tmp = Float64(Float64(-a) / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.52e-9) tmp = x; elseif (y <= 140000000.0) tmp = -a / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.52e-9], x, If[LessEqual[y, 140000000.0], N[((-a) / b), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.52 \cdot 10^{-9}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 140000000:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.51999999999999992e-9 or 1.4e8 < y Initial program 51.6%
Taylor expanded in z around 0 32.8%
if -1.51999999999999992e-9 < y < 1.4e8Initial program 83.9%
Taylor expanded in b around inf 50.6%
Taylor expanded in a around inf 31.5%
mul-1-neg31.5%
Simplified31.5%
Final simplification32.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.8e+31) (/ t b) (if (<= z 5e-87) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.8e+31) {
tmp = t / b;
} else if (z <= 5e-87) {
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 <= (-3.8d+31)) then
tmp = t / b
else if (z <= 5d-87) 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 <= -3.8e+31) {
tmp = t / b;
} else if (z <= 5e-87) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.8e+31: tmp = t / b elif z <= 5e-87: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.8e+31) tmp = Float64(t / b); elseif (z <= 5e-87) 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 <= -3.8e+31) tmp = t / b; elseif (z <= 5e-87) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.8e+31], N[(t / b), $MachinePrecision], If[LessEqual[z, 5e-87], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+31}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-87}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -3.8000000000000001e31 or 5.00000000000000042e-87 < z Initial program 46.4%
Taylor expanded in b around inf 26.7%
Taylor expanded in t around inf 21.3%
if -3.8000000000000001e31 < z < 5.00000000000000042e-87Initial program 91.2%
Taylor expanded in z around 0 38.9%
Final simplification29.8%
(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.9%
Taylor expanded in z around 0 21.7%
Final simplification21.7%
(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 2023196
(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)))))