
(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 15 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
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.1e+17)
(+ (/ (+ (* x (/ y (- b y))) (* y (/ (- a t) (pow (- b y) 2.0)))) z) t_1)
(if (<= z 550000000.0)
(/ (fma x y (* z (- t a))) (+ y (* z (- b y))))
(- t_1 (/ x z))))))
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 <= -1.1e+17) {
tmp = (((x * (y / (b - y))) + (y * ((a - t) / pow((b - y), 2.0)))) / z) + t_1;
} else if (z <= 550000000.0) {
tmp = fma(x, y, (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = t_1 - (x / z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.1e+17) tmp = Float64(Float64(Float64(Float64(x * Float64(y / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / (Float64(b - y) ^ 2.0)))) / z) + t_1); elseif (z <= 550000000.0) tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(t_1 - Float64(x / z)); end return 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, -1.1e+17], N[(N[(N[(N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 550000000.0], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(x / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+17}:\\
\;\;\;\;\frac{x \cdot \frac{y}{b - y} + y \cdot \frac{a - t}{{\left(b - y\right)}^{2}}}{z} + t\_1\\
\mathbf{elif}\;z \leq 550000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \frac{x}{z}\\
\end{array}
\end{array}
if z < -1.1e17Initial program 40.8%
div-inv40.7%
fma-define40.7%
+-commutative40.7%
fma-define40.7%
Applied egg-rr40.7%
Taylor expanded in z around -inf 66.0%
associate--l+66.0%
mul-1-neg66.0%
distribute-lft-out--66.0%
associate-/l*76.5%
associate-/l*90.7%
div-sub90.7%
Simplified90.7%
if -1.1e17 < z < 5.5e8Initial program 89.9%
fma-define89.9%
Simplified89.9%
if 5.5e8 < z Initial program 36.2%
div-inv36.1%
fma-define36.1%
+-commutative36.1%
fma-define36.1%
Applied egg-rr36.1%
Taylor expanded in z around -inf 69.1%
associate--l+69.1%
mul-1-neg69.1%
distribute-lft-out--69.1%
associate-/l*74.1%
associate-/l*92.5%
div-sub92.5%
Simplified92.5%
Taylor expanded in y around inf 93.9%
Final simplification91.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.15e+15)
(+
(+ (+ (/ t (- b y)) (* (/ y (- b y)) (/ x z))) (/ a (- y b)))
(* (/ y z) (/ t_1 (- y b))))
(if (<= z 550000000.0)
(/ (fma x y (* z (- t a))) (+ y (* z (- b y))))
(- t_1 (/ x z))))))
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.15e+15) {
tmp = (((t / (b - y)) + ((y / (b - y)) * (x / z))) + (a / (y - b))) + ((y / z) * (t_1 / (y - b)));
} else if (z <= 550000000.0) {
tmp = fma(x, y, (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = t_1 - (x / z);
}
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.15e+15) tmp = Float64(Float64(Float64(Float64(t / Float64(b - y)) + Float64(Float64(y / Float64(b - y)) * Float64(x / z))) + Float64(a / Float64(y - b))) + Float64(Float64(y / z) * Float64(t_1 / Float64(y - b)))); elseif (z <= 550000000.0) tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(t_1 - Float64(x / z)); end return 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.15e+15], N[(N[(N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(t$95$1 / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 550000000.0], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(x / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(\frac{t}{b - y} + \frac{y}{b - y} \cdot \frac{x}{z}\right) + \frac{a}{y - b}\right) + \frac{y}{z} \cdot \frac{t\_1}{y - b}\\
\mathbf{elif}\;z \leq 550000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \frac{x}{z}\\
\end{array}
\end{array}
if z < -2.15e15Initial program 40.8%
Taylor expanded in z around inf 65.9%
associate--r+65.9%
associate-/r*69.1%
*-commutative69.1%
times-frac75.5%
Simplified75.5%
*-un-lft-identity75.5%
unpow275.5%
times-frac75.5%
Applied egg-rr75.5%
associate-*l/75.5%
*-lft-identity75.5%
Simplified75.5%
associate-/l/72.2%
times-frac89.1%
Applied egg-rr89.1%
if -2.15e15 < z < 5.5e8Initial program 89.9%
fma-define89.9%
Simplified89.9%
if 5.5e8 < z Initial program 36.2%
div-inv36.1%
fma-define36.1%
+-commutative36.1%
fma-define36.1%
Applied egg-rr36.1%
Taylor expanded in z around -inf 69.1%
associate--l+69.1%
mul-1-neg69.1%
distribute-lft-out--69.1%
associate-/l*74.1%
associate-/l*92.5%
div-sub92.5%
Simplified92.5%
Taylor expanded in y around inf 93.9%
Final simplification90.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9e+19)
(+
(+ (+ (/ t (- b y)) (* (/ y (- b y)) (/ x z))) (/ a (- y b)))
(* (/ y z) (/ t_1 (- y b))))
(if (<= z 550000000.0)
(/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))
(- t_1 (/ x z))))))
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 <= -9e+19) {
tmp = (((t / (b - y)) + ((y / (b - y)) * (x / z))) + (a / (y - b))) + ((y / z) * (t_1 / (y - b)));
} else if (z <= 550000000.0) {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
} else {
tmp = t_1 - (x / z);
}
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 <= (-9d+19)) then
tmp = (((t / (b - y)) + ((y / (b - y)) * (x / z))) + (a / (y - b))) + ((y / z) * (t_1 / (y - b)))
else if (z <= 550000000.0d0) then
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)))
else
tmp = t_1 - (x / z)
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 <= -9e+19) {
tmp = (((t / (b - y)) + ((y / (b - y)) * (x / z))) + (a / (y - b))) + ((y / z) * (t_1 / (y - b)));
} else if (z <= 550000000.0) {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
} else {
tmp = t_1 - (x / z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -9e+19: tmp = (((t / (b - y)) + ((y / (b - y)) * (x / z))) + (a / (y - b))) + ((y / z) * (t_1 / (y - b))) elif z <= 550000000.0: tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) else: tmp = t_1 - (x / z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -9e+19) tmp = Float64(Float64(Float64(Float64(t / Float64(b - y)) + Float64(Float64(y / Float64(b - y)) * Float64(x / z))) + Float64(a / Float64(y - b))) + Float64(Float64(y / z) * Float64(t_1 / Float64(y - b)))); elseif (z <= 550000000.0) tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(t_1 - Float64(x / z)); 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 <= -9e+19) tmp = (((t / (b - y)) + ((y / (b - y)) * (x / z))) + (a / (y - b))) + ((y / z) * (t_1 / (y - b))); elseif (z <= 550000000.0) tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); else tmp = t_1 - (x / z); 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, -9e+19], N[(N[(N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(t$95$1 / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 550000000.0], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(x / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(\frac{t}{b - y} + \frac{y}{b - y} \cdot \frac{x}{z}\right) + \frac{a}{y - b}\right) + \frac{y}{z} \cdot \frac{t\_1}{y - b}\\
\mathbf{elif}\;z \leq 550000000:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \frac{x}{z}\\
\end{array}
\end{array}
if z < -9e19Initial program 40.8%
Taylor expanded in z around inf 65.9%
associate--r+65.9%
associate-/r*69.1%
*-commutative69.1%
times-frac75.5%
Simplified75.5%
*-un-lft-identity75.5%
unpow275.5%
times-frac75.5%
Applied egg-rr75.5%
associate-*l/75.5%
*-lft-identity75.5%
Simplified75.5%
associate-/l/72.2%
times-frac89.1%
Applied egg-rr89.1%
if -9e19 < z < 5.5e8Initial program 89.9%
if 5.5e8 < z Initial program 36.2%
div-inv36.1%
fma-define36.1%
+-commutative36.1%
fma-define36.1%
Applied egg-rr36.1%
Taylor expanded in z around -inf 69.1%
associate--l+69.1%
mul-1-neg69.1%
distribute-lft-out--69.1%
associate-/l*74.1%
associate-/l*92.5%
div-sub92.5%
Simplified92.5%
Taylor expanded in y around inf 93.9%
Final simplification90.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t a) (- b y)) (/ x z))))
(if (<= z -1e+24)
t_1
(if (<= z -1e-140)
(/ -1.0 (/ (- (* z (- y b)) y) (* z (- t a))))
(if (<= z 115000.0)
(/ 1.0 (/ (+ y (* z b)) (+ (* x y) (* z t))))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - a) / (b - y)) - (x / z);
double tmp;
if (z <= -1e+24) {
tmp = t_1;
} else if (z <= -1e-140) {
tmp = -1.0 / (((z * (y - b)) - y) / (z * (t - a)));
} else if (z <= 115000.0) {
tmp = 1.0 / ((y + (z * b)) / ((x * y) + (z * t)));
} 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)) - (x / z)
if (z <= (-1d+24)) then
tmp = t_1
else if (z <= (-1d-140)) then
tmp = (-1.0d0) / (((z * (y - b)) - y) / (z * (t - a)))
else if (z <= 115000.0d0) then
tmp = 1.0d0 / ((y + (z * b)) / ((x * y) + (z * t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - a) / (b - y)) - (x / z);
double tmp;
if (z <= -1e+24) {
tmp = t_1;
} else if (z <= -1e-140) {
tmp = -1.0 / (((z * (y - b)) - y) / (z * (t - a)));
} else if (z <= 115000.0) {
tmp = 1.0 / ((y + (z * b)) / ((x * y) + (z * t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - a) / (b - y)) - (x / z) tmp = 0 if z <= -1e+24: tmp = t_1 elif z <= -1e-140: tmp = -1.0 / (((z * (y - b)) - y) / (z * (t - a))) elif z <= 115000.0: tmp = 1.0 / ((y + (z * b)) / ((x * y) + (z * t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(x / z)) tmp = 0.0 if (z <= -1e+24) tmp = t_1; elseif (z <= -1e-140) tmp = Float64(-1.0 / Float64(Float64(Float64(z * Float64(y - b)) - y) / Float64(z * Float64(t - a)))); elseif (z <= 115000.0) tmp = Float64(1.0 / Float64(Float64(y + Float64(z * b)) / Float64(Float64(x * y) + Float64(z * t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t - a) / (b - y)) - (x / z); tmp = 0.0; if (z <= -1e+24) tmp = t_1; elseif (z <= -1e-140) tmp = -1.0 / (((z * (y - b)) - y) / (z * (t - a))); elseif (z <= 115000.0) tmp = 1.0 / ((y + (z * b)) / ((x * y) + (z * t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+24], t$95$1, If[LessEqual[z, -1e-140], N[(-1.0 / N[(N[(N[(z * N[(y - b), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] / N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 115000.0], N[(1.0 / N[(N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y} - \frac{x}{z}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-140}:\\
\;\;\;\;\frac{-1}{\frac{z \cdot \left(y - b\right) - y}{z \cdot \left(t - a\right)}}\\
\mathbf{elif}\;z \leq 115000:\\
\;\;\;\;\frac{1}{\frac{y + z \cdot b}{x \cdot y + z \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.9999999999999998e23 or 115000 < z Initial program 38.1%
div-inv38.0%
fma-define38.0%
+-commutative38.0%
fma-define38.0%
Applied egg-rr38.0%
Taylor expanded in z around -inf 67.2%
associate--l+67.2%
mul-1-neg67.2%
distribute-lft-out--67.2%
associate-/l*75.2%
associate-/l*91.5%
div-sub91.5%
Simplified91.5%
Taylor expanded in y around inf 87.6%
if -9.9999999999999998e23 < z < -9.9999999999999998e-141Initial program 96.5%
clear-num96.2%
inv-pow96.2%
+-commutative96.2%
fma-define96.2%
fma-define96.2%
Applied egg-rr96.2%
unpow-196.2%
fma-define96.2%
+-commutative96.2%
fma-define96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in x around 0 79.8%
if -9.9999999999999998e-141 < z < 115000Initial program 88.1%
clear-num87.9%
inv-pow87.9%
+-commutative87.9%
fma-define87.9%
fma-define87.9%
Applied egg-rr87.9%
unpow-187.9%
fma-define87.9%
+-commutative87.9%
fma-define87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in a around 0 73.7%
Taylor expanded in b around inf 73.7%
*-commutative73.7%
Simplified73.7%
Final simplification80.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.2e+28) (not (<= z 170000000.0))) (- (/ (- t a) (- b y)) (/ x z)) (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.2e+28) || !(z <= 170000000.0)) {
tmp = ((t - a) / (b - y)) - (x / z);
} else {
tmp = ((z * (t - a)) + (x * y)) / (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 <= (-6.2d+28)) .or. (.not. (z <= 170000000.0d0))) then
tmp = ((t - a) / (b - y)) - (x / z)
else
tmp = ((z * (t - a)) + (x * y)) / (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 <= -6.2e+28) || !(z <= 170000000.0)) {
tmp = ((t - a) / (b - y)) - (x / z);
} else {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.2e+28) or not (z <= 170000000.0): tmp = ((t - a) / (b - y)) - (x / z) else: tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.2e+28) || !(z <= 170000000.0)) tmp = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(x / z)); else tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / 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 <= -6.2e+28) || ~((z <= 170000000.0))) tmp = ((t - a) / (b - y)) - (x / z); else tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.2e+28], N[Not[LessEqual[z, 170000000.0]], $MachinePrecision]], N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+28} \lor \neg \left(z \leq 170000000\right):\\
\;\;\;\;\frac{t - a}{b - y} - \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -6.2000000000000001e28 or 1.7e8 < z Initial program 38.1%
div-inv38.0%
fma-define38.0%
+-commutative38.0%
fma-define38.0%
Applied egg-rr38.0%
Taylor expanded in z around -inf 67.2%
associate--l+67.2%
mul-1-neg67.2%
distribute-lft-out--67.2%
associate-/l*75.2%
associate-/l*91.5%
div-sub91.5%
Simplified91.5%
Taylor expanded in y around inf 87.6%
if -6.2000000000000001e28 < z < 1.7e8Initial program 89.9%
Final simplification88.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t a) (- b y)) (/ x z))))
(if (<= z -8.2e+23)
t_1
(if (<= z -1.2e-96)
(/ (- (+ t (/ (* x y) z)) a) b)
(if (<= z 3.8e-20) (/ (+ (* z (- t a)) (* x y)) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - a) / (b - y)) - (x / z);
double tmp;
if (z <= -8.2e+23) {
tmp = t_1;
} else if (z <= -1.2e-96) {
tmp = ((t + ((x * y) / z)) - a) / b;
} else if (z <= 3.8e-20) {
tmp = ((z * (t - a)) + (x * y)) / 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)) - (x / z)
if (z <= (-8.2d+23)) then
tmp = t_1
else if (z <= (-1.2d-96)) then
tmp = ((t + ((x * y) / z)) - a) / b
else if (z <= 3.8d-20) then
tmp = ((z * (t - a)) + (x * y)) / 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)) - (x / z);
double tmp;
if (z <= -8.2e+23) {
tmp = t_1;
} else if (z <= -1.2e-96) {
tmp = ((t + ((x * y) / z)) - a) / b;
} else if (z <= 3.8e-20) {
tmp = ((z * (t - a)) + (x * y)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - a) / (b - y)) - (x / z) tmp = 0 if z <= -8.2e+23: tmp = t_1 elif z <= -1.2e-96: tmp = ((t + ((x * y) / z)) - a) / b elif z <= 3.8e-20: tmp = ((z * (t - a)) + (x * y)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(x / z)) tmp = 0.0 if (z <= -8.2e+23) tmp = t_1; elseif (z <= -1.2e-96) tmp = Float64(Float64(Float64(t + Float64(Float64(x * y) / z)) - a) / b); elseif (z <= 3.8e-20) tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / 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)) - (x / z); tmp = 0.0; if (z <= -8.2e+23) tmp = t_1; elseif (z <= -1.2e-96) tmp = ((t + ((x * y) / z)) - a) / b; elseif (z <= 3.8e-20) tmp = ((z * (t - a)) + (x * y)) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+23], t$95$1, If[LessEqual[z, -1.2e-96], N[(N[(N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[z, 3.8e-20], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y} - \frac{x}{z}\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-96}:\\
\;\;\;\;\frac{\left(t + \frac{x \cdot y}{z}\right) - a}{b}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-20}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.19999999999999992e23 or 3.7999999999999998e-20 < z Initial program 40.5%
div-inv40.5%
fma-define40.5%
+-commutative40.5%
fma-define40.5%
Applied egg-rr40.5%
Taylor expanded in z around -inf 68.5%
associate--l+68.5%
mul-1-neg68.5%
distribute-lft-out--68.5%
associate-/l*75.4%
associate-/l*91.0%
div-sub91.0%
Simplified91.0%
Taylor expanded in y around inf 86.3%
if -8.19999999999999992e23 < z < -1.2000000000000001e-96Initial program 95.4%
Taylor expanded in z around inf 64.7%
associate--r+64.7%
associate-/r*64.7%
*-commutative64.7%
times-frac61.1%
Simplified61.1%
*-un-lft-identity61.1%
unpow261.1%
times-frac61.1%
Applied egg-rr61.1%
associate-*l/61.1%
*-lft-identity61.1%
Simplified61.1%
Taylor expanded in b around inf 78.3%
if -1.2000000000000001e-96 < z < 3.7999999999999998e-20Initial program 88.4%
Taylor expanded in z around 0 65.2%
Final simplification76.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.23) (not (<= z 36000.0))) (- (/ (- t a) (- b y)) (/ x z)) (/ 1.0 (/ (+ y (* z b)) (+ (* x y) (* z t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.23) || !(z <= 36000.0)) {
tmp = ((t - a) / (b - y)) - (x / z);
} else {
tmp = 1.0 / ((y + (z * b)) / ((x * y) + (z * t)));
}
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.23d0)) .or. (.not. (z <= 36000.0d0))) then
tmp = ((t - a) / (b - y)) - (x / z)
else
tmp = 1.0d0 / ((y + (z * b)) / ((x * y) + (z * t)))
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.23) || !(z <= 36000.0)) {
tmp = ((t - a) / (b - y)) - (x / z);
} else {
tmp = 1.0 / ((y + (z * b)) / ((x * y) + (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.23) or not (z <= 36000.0): tmp = ((t - a) / (b - y)) - (x / z) else: tmp = 1.0 / ((y + (z * b)) / ((x * y) + (z * t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.23) || !(z <= 36000.0)) tmp = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(x / z)); else tmp = Float64(1.0 / Float64(Float64(y + Float64(z * b)) / Float64(Float64(x * y) + Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.23) || ~((z <= 36000.0))) tmp = ((t - a) / (b - y)) - (x / z); else tmp = 1.0 / ((y + (z * b)) / ((x * y) + (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.23], N[Not[LessEqual[z, 36000.0]], $MachinePrecision]], N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.23 \lor \neg \left(z \leq 36000\right):\\
\;\;\;\;\frac{t - a}{b - y} - \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y + z \cdot b}{x \cdot y + z \cdot t}}\\
\end{array}
\end{array}
if z < -0.23000000000000001 or 36000 < z Initial program 39.1%
div-inv39.1%
fma-define39.1%
+-commutative39.1%
fma-define39.1%
Applied egg-rr39.1%
Taylor expanded in z around -inf 67.8%
associate--l+67.8%
mul-1-neg67.8%
distribute-lft-out--67.8%
associate-/l*75.6%
associate-/l*91.6%
div-sub91.6%
Simplified91.6%
Taylor expanded in y around inf 87.0%
if -0.23000000000000001 < z < 36000Initial program 89.8%
clear-num89.6%
inv-pow89.6%
+-commutative89.6%
fma-define89.6%
fma-define89.6%
Applied egg-rr89.6%
unpow-189.6%
fma-define89.6%
+-commutative89.6%
fma-define89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in a around 0 71.7%
Taylor expanded in b around inf 71.7%
*-commutative71.7%
Simplified71.7%
Final simplification79.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ a (- b))))
(if (<= z -6.6e+240)
t_1
(if (<= z -3.5e-45)
(/ t b)
(if (or (<= z -1e-140) (not (<= z 2.8e-18))) t_1 x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / -b;
double tmp;
if (z <= -6.6e+240) {
tmp = t_1;
} else if (z <= -3.5e-45) {
tmp = t / b;
} else if ((z <= -1e-140) || !(z <= 2.8e-18)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a / -b
if (z <= (-6.6d+240)) then
tmp = t_1
else if (z <= (-3.5d-45)) then
tmp = t / b
else if ((z <= (-1d-140)) .or. (.not. (z <= 2.8d-18))) then
tmp = t_1
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 t_1 = a / -b;
double tmp;
if (z <= -6.6e+240) {
tmp = t_1;
} else if (z <= -3.5e-45) {
tmp = t / b;
} else if ((z <= -1e-140) || !(z <= 2.8e-18)) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / -b tmp = 0 if z <= -6.6e+240: tmp = t_1 elif z <= -3.5e-45: tmp = t / b elif (z <= -1e-140) or not (z <= 2.8e-18): tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(-b)) tmp = 0.0 if (z <= -6.6e+240) tmp = t_1; elseif (z <= -3.5e-45) tmp = Float64(t / b); elseif ((z <= -1e-140) || !(z <= 2.8e-18)) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a / -b; tmp = 0.0; if (z <= -6.6e+240) tmp = t_1; elseif (z <= -3.5e-45) tmp = t / b; elseif ((z <= -1e-140) || ~((z <= 2.8e-18))) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / (-b)), $MachinePrecision]}, If[LessEqual[z, -6.6e+240], t$95$1, If[LessEqual[z, -3.5e-45], N[(t / b), $MachinePrecision], If[Or[LessEqual[z, -1e-140], N[Not[LessEqual[z, 2.8e-18]], $MachinePrecision]], t$95$1, x]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{-b}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+240}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-45}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-140} \lor \neg \left(z \leq 2.8 \cdot 10^{-18}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.5999999999999997e240 or -3.5e-45 < z < -9.9999999999999998e-141 or 2.80000000000000012e-18 < z Initial program 48.0%
Taylor expanded in y around 0 51.4%
Taylor expanded in t around 0 35.7%
associate-*r/35.7%
mul-1-neg35.7%
Simplified35.7%
if -6.5999999999999997e240 < z < -3.5e-45Initial program 55.9%
Taylor expanded in t around inf 36.3%
*-commutative36.3%
Simplified36.3%
Taylor expanded in y around 0 41.8%
if -9.9999999999999998e-141 < z < 2.80000000000000012e-18Initial program 87.6%
Taylor expanded in z around 0 60.2%
Final simplification46.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.7e-98) (not (<= z 3.8e-16))) (/ (- t a) (- b y)) (/ (+ (* z (- t a)) (* x y)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.7e-98) || !(z <= 3.8e-16)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((z * (t - a)) + (x * y)) / 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.7d-98)) .or. (.not. (z <= 3.8d-16))) then
tmp = (t - a) / (b - y)
else
tmp = ((z * (t - a)) + (x * y)) / 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.7e-98) || !(z <= 3.8e-16)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((z * (t - a)) + (x * y)) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.7e-98) or not (z <= 3.8e-16): tmp = (t - a) / (b - y) else: tmp = ((z * (t - a)) + (x * y)) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.7e-98) || !(z <= 3.8e-16)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.7e-98) || ~((z <= 3.8e-16))) tmp = (t - a) / (b - y); else tmp = ((z * (t - a)) + (x * y)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.7e-98], N[Not[LessEqual[z, 3.8e-16]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-98} \lor \neg \left(z \leq 3.8 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y}\\
\end{array}
\end{array}
if z < -1.7000000000000001e-98 or 3.80000000000000012e-16 < z Initial program 48.7%
Taylor expanded in z around inf 76.4%
if -1.7000000000000001e-98 < z < 3.80000000000000012e-16Initial program 88.4%
Taylor expanded in z around 0 65.2%
Final simplification71.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -2.8e-45)
t_1
(if (<= z -1e-140) (/ a (- b)) (if (<= z 3.1e-5) x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -2.8e-45) {
tmp = t_1;
} else if (z <= -1e-140) {
tmp = a / -b;
} else if (z <= 3.1e-5) {
tmp = 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) :: tmp
t_1 = t / (b - y)
if (z <= (-2.8d-45)) then
tmp = t_1
else if (z <= (-1d-140)) then
tmp = a / -b
else if (z <= 3.1d-5) then
tmp = 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 tmp;
if (z <= -2.8e-45) {
tmp = t_1;
} else if (z <= -1e-140) {
tmp = a / -b;
} else if (z <= 3.1e-5) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -2.8e-45: tmp = t_1 elif z <= -1e-140: tmp = a / -b elif z <= 3.1e-5: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -2.8e-45) tmp = t_1; elseif (z <= -1e-140) tmp = Float64(a / Float64(-b)); elseif (z <= 3.1e-5) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -2.8e-45) tmp = t_1; elseif (z <= -1e-140) tmp = a / -b; elseif (z <= 3.1e-5) tmp = 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]}, If[LessEqual[z, -2.8e-45], t$95$1, If[LessEqual[z, -1e-140], N[(a / (-b)), $MachinePrecision], If[LessEqual[z, 3.1e-5], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-140}:\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8000000000000001e-45 or 3.10000000000000014e-5 < z Initial program 44.6%
Taylor expanded in t around inf 26.4%
*-commutative26.4%
Simplified26.4%
Taylor expanded in z around inf 44.5%
if -2.8000000000000001e-45 < z < -9.9999999999999998e-141Initial program 99.6%
Taylor expanded in y around 0 49.8%
Taylor expanded in t around 0 44.1%
associate-*r/44.1%
mul-1-neg44.1%
Simplified44.1%
if -9.9999999999999998e-141 < z < 3.10000000000000014e-5Initial program 87.7%
Taylor expanded in z around 0 59.7%
Final simplification50.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -2.5e-45)
t_1
(if (<= z -1e-140) (/ a (- b)) (if (<= z 4.6e+48) (/ x (- 1.0 z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -2.5e-45) {
tmp = t_1;
} else if (z <= -1e-140) {
tmp = a / -b;
} else if (z <= 4.6e+48) {
tmp = x / (1.0 - z);
} 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 / (b - y)
if (z <= (-2.5d-45)) then
tmp = t_1
else if (z <= (-1d-140)) then
tmp = a / -b
else if (z <= 4.6d+48) then
tmp = x / (1.0d0 - z)
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 tmp;
if (z <= -2.5e-45) {
tmp = t_1;
} else if (z <= -1e-140) {
tmp = a / -b;
} else if (z <= 4.6e+48) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -2.5e-45: tmp = t_1 elif z <= -1e-140: tmp = a / -b elif z <= 4.6e+48: tmp = x / (1.0 - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -2.5e-45) tmp = t_1; elseif (z <= -1e-140) tmp = Float64(a / Float64(-b)); elseif (z <= 4.6e+48) tmp = Float64(x / Float64(1.0 - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -2.5e-45) tmp = t_1; elseif (z <= -1e-140) tmp = a / -b; elseif (z <= 4.6e+48) tmp = x / (1.0 - z); 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]}, If[LessEqual[z, -2.5e-45], t$95$1, If[LessEqual[z, -1e-140], N[(a / (-b)), $MachinePrecision], If[LessEqual[z, 4.6e+48], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-140}:\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+48}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.49999999999999988e-45 or 4.6e48 < z Initial program 41.8%
Taylor expanded in t around inf 25.3%
*-commutative25.3%
Simplified25.3%
Taylor expanded in z around inf 45.7%
if -2.49999999999999988e-45 < z < -9.9999999999999998e-141Initial program 99.6%
Taylor expanded in y around 0 49.8%
Taylor expanded in t around 0 44.1%
associate-*r/44.1%
mul-1-neg44.1%
Simplified44.1%
if -9.9999999999999998e-141 < z < 4.6e48Initial program 85.1%
Taylor expanded in y around inf 57.5%
mul-1-neg57.5%
unsub-neg57.5%
Simplified57.5%
Final simplification50.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.5e-153) (not (<= z 1.15e-50))) (/ (- t a) (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.5e-153) || !(z <= 1.15e-50)) {
tmp = (t - a) / (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 <= (-2.5d-153)) .or. (.not. (z <= 1.15d-50))) then
tmp = (t - a) / (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 <= -2.5e-153) || !(z <= 1.15e-50)) {
tmp = (t - a) / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.5e-153) or not (z <= 1.15e-50): tmp = (t - a) / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.5e-153) || !(z <= 1.15e-50)) tmp = Float64(Float64(t - a) / 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 <= -2.5e-153) || ~((z <= 1.15e-50))) tmp = (t - a) / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.5e-153], N[Not[LessEqual[z, 1.15e-50]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-153} \lor \neg \left(z \leq 1.15 \cdot 10^{-50}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.50000000000000016e-153 or 1.1500000000000001e-50 < z Initial program 54.7%
Taylor expanded in z around inf 73.0%
if -2.50000000000000016e-153 < z < 1.1500000000000001e-50Initial program 85.8%
Taylor expanded in z around 0 64.2%
Final simplification70.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.2e-10) (not (<= y 4.7e+45))) (/ 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 <= -7.2e-10) || !(y <= 4.7e+45)) {
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 <= (-7.2d-10)) .or. (.not. (y <= 4.7d+45))) 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 <= -7.2e-10) || !(y <= 4.7e+45)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.2e-10) or not (y <= 4.7e+45): 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 <= -7.2e-10) || !(y <= 4.7e+45)) 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 <= -7.2e-10) || ~((y <= 4.7e+45))) 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, -7.2e-10], N[Not[LessEqual[y, 4.7e+45]], $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 -7.2 \cdot 10^{-10} \lor \neg \left(y \leq 4.7 \cdot 10^{+45}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -7.2e-10 or 4.70000000000000002e45 < y Initial program 56.2%
Taylor expanded in y around inf 57.4%
mul-1-neg57.4%
unsub-neg57.4%
Simplified57.4%
if -7.2e-10 < y < 4.70000000000000002e45Initial program 73.3%
Taylor expanded in y around 0 63.5%
Final simplification60.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.9e-64) (not (<= z 2e-8))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.9e-64) || !(z <= 2e-8)) {
tmp = t / 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 ((z <= (-4.9d-64)) .or. (.not. (z <= 2d-8))) then
tmp = t / 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 ((z <= -4.9e-64) || !(z <= 2e-8)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.9e-64) or not (z <= 2e-8): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.9e-64) || !(z <= 2e-8)) tmp = Float64(t / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.9e-64) || ~((z <= 2e-8))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.9e-64], N[Not[LessEqual[z, 2e-8]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{-64} \lor \neg \left(z \leq 2 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.9000000000000002e-64 or 2e-8 < z Initial program 46.2%
Taylor expanded in t around inf 26.4%
*-commutative26.4%
Simplified26.4%
Taylor expanded in y around 0 30.0%
if -4.9000000000000002e-64 < z < 2e-8Initial program 89.1%
Taylor expanded in z around 0 55.1%
Final simplification41.3%
(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 65.4%
Taylor expanded in z around 0 27.3%
Final simplification27.3%
(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 2024046
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))