
(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 13 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 -2.15e+52) (not (<= z 68000000.0)))
(+
(/ (+ (/ y (/ (- b y) x)) (/ (- a t) (/ (pow (- b y) 2.0) y))) z)
(/ (- t a) (- b y)))
(/ (- (* y x) (* z (- a t))) (+ y (- (* z b) (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.15e+52) || !(z <= 68000000.0)) {
tmp = (((y / ((b - y) / x)) + ((a - t) / (pow((b - y), 2.0) / y))) / z) + ((t - a) / (b - y));
} else {
tmp = ((y * x) - (z * (a - t))) / (y + ((z * b) - (z * y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.15d+52)) .or. (.not. (z <= 68000000.0d0))) then
tmp = (((y / ((b - y) / x)) + ((a - t) / (((b - y) ** 2.0d0) / y))) / z) + ((t - a) / (b - y))
else
tmp = ((y * x) - (z * (a - t))) / (y + ((z * b) - (z * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.15e+52) || !(z <= 68000000.0)) {
tmp = (((y / ((b - y) / x)) + ((a - t) / (Math.pow((b - y), 2.0) / y))) / z) + ((t - a) / (b - y));
} else {
tmp = ((y * x) - (z * (a - t))) / (y + ((z * b) - (z * y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.15e+52) or not (z <= 68000000.0): tmp = (((y / ((b - y) / x)) + ((a - t) / (math.pow((b - y), 2.0) / y))) / z) + ((t - a) / (b - y)) else: tmp = ((y * x) - (z * (a - t))) / (y + ((z * b) - (z * y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.15e+52) || !(z <= 68000000.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) - Float64(z * Float64(a - t))) / Float64(y + Float64(Float64(z * b) - Float64(z * y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.15e+52) || ~((z <= 68000000.0))) tmp = (((y / ((b - y) / x)) + ((a - t) / (((b - y) ^ 2.0) / y))) / z) + ((t - a) / (b - y)); else tmp = ((y * x) - (z * (a - t))) / (y + ((z * b) - (z * y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.15e+52], N[Not[LessEqual[z, 68000000.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] - N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(N[(z * b), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+52} \lor \neg \left(z \leq 68000000\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 - z \cdot \left(a - t\right)}{y + \left(z \cdot b - z \cdot y\right)}\\
\end{array}
\end{array}
if z < -2.15e52 or 6.8e7 < z Initial program 43.7%
Taylor expanded in z around -inf 73.5%
+-commutative73.5%
associate--l+73.5%
Simplified95.9%
if -2.15e52 < z < 6.8e7Initial program 90.1%
sub-neg90.1%
distribute-lft-in90.1%
Applied egg-rr90.1%
Final simplification92.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (* y x) (* z (- a t))) (+ y (* z (- b y)))))
(t_2 (/ (- t a) (- b y))))
(if (<= z -4.2e+34)
t_2
(if (<= z 3.6e+50)
t_1
(if (<= z 3.2e+89)
(- (/ (- a t) y) (/ x z))
(if (<= z 1.3e+136) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * x) - (z * (a - t))) / (y + (z * (b - y)));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -4.2e+34) {
tmp = t_2;
} else if (z <= 3.6e+50) {
tmp = t_1;
} else if (z <= 3.2e+89) {
tmp = ((a - t) / y) - (x / z);
} else if (z <= 1.3e+136) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((y * x) - (z * (a - t))) / (y + (z * (b - y)))
t_2 = (t - a) / (b - y)
if (z <= (-4.2d+34)) then
tmp = t_2
else if (z <= 3.6d+50) then
tmp = t_1
else if (z <= 3.2d+89) then
tmp = ((a - t) / y) - (x / z)
else if (z <= 1.3d+136) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * x) - (z * (a - t))) / (y + (z * (b - y)));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -4.2e+34) {
tmp = t_2;
} else if (z <= 3.6e+50) {
tmp = t_1;
} else if (z <= 3.2e+89) {
tmp = ((a - t) / y) - (x / z);
} else if (z <= 1.3e+136) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((y * x) - (z * (a - t))) / (y + (z * (b - y))) t_2 = (t - a) / (b - y) tmp = 0 if z <= -4.2e+34: tmp = t_2 elif z <= 3.6e+50: tmp = t_1 elif z <= 3.2e+89: tmp = ((a - t) / y) - (x / z) elif z <= 1.3e+136: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * x) - Float64(z * Float64(a - t))) / Float64(y + Float64(z * Float64(b - y)))) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.2e+34) tmp = t_2; elseif (z <= 3.6e+50) tmp = t_1; elseif (z <= 3.2e+89) tmp = Float64(Float64(Float64(a - t) / y) - Float64(x / z)); elseif (z <= 1.3e+136) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((y * x) - (z * (a - t))) / (y + (z * (b - y))); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -4.2e+34) tmp = t_2; elseif (z <= 3.6e+50) tmp = t_1; elseif (z <= 3.2e+89) tmp = ((a - t) / y) - (x / z); elseif (z <= 1.3e+136) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+34], t$95$2, If[LessEqual[z, 3.6e+50], t$95$1, If[LessEqual[z, 3.2e+89], N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+136], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot x - z \cdot \left(a - t\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+89}:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.20000000000000035e34 or 1.3000000000000001e136 < z Initial program 37.0%
Taylor expanded in z around inf 85.8%
if -4.20000000000000035e34 < z < 3.59999999999999986e50 or 3.19999999999999987e89 < z < 1.3000000000000001e136Initial program 88.1%
if 3.59999999999999986e50 < z < 3.19999999999999987e89Initial program 51.2%
Taylor expanded in z around inf 50.0%
Taylor expanded in y around -inf 90.2%
+-commutative90.2%
mul-1-neg90.2%
unsub-neg90.2%
associate-*r/90.2%
mul-1-neg90.2%
associate--l+90.2%
associate-/l*99.8%
mul-1-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
Final simplification87.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (* y x) (* z (- a t)))) (t_2 (/ (- t a) (- b y))))
(if (<= z -2.2e+34)
t_2
(if (<= z 3.9e+50)
(/ t_1 (+ y (- (* z b) (* z y))))
(if (<= z 5e+89)
(- (/ (- a t) y) (/ x z))
(if (<= z 1.3e+136) (/ t_1 (+ y (* z (- b y)))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * x) - (z * (a - t));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -2.2e+34) {
tmp = t_2;
} else if (z <= 3.9e+50) {
tmp = t_1 / (y + ((z * b) - (z * y)));
} else if (z <= 5e+89) {
tmp = ((a - t) / y) - (x / z);
} else if (z <= 1.3e+136) {
tmp = t_1 / (y + (z * (b - y)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * x) - (z * (a - t))
t_2 = (t - a) / (b - y)
if (z <= (-2.2d+34)) then
tmp = t_2
else if (z <= 3.9d+50) then
tmp = t_1 / (y + ((z * b) - (z * y)))
else if (z <= 5d+89) then
tmp = ((a - t) / y) - (x / z)
else if (z <= 1.3d+136) then
tmp = t_1 / (y + (z * (b - y)))
else
tmp = t_2
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 * x) - (z * (a - t));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -2.2e+34) {
tmp = t_2;
} else if (z <= 3.9e+50) {
tmp = t_1 / (y + ((z * b) - (z * y)));
} else if (z <= 5e+89) {
tmp = ((a - t) / y) - (x / z);
} else if (z <= 1.3e+136) {
tmp = t_1 / (y + (z * (b - y)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * x) - (z * (a - t)) t_2 = (t - a) / (b - y) tmp = 0 if z <= -2.2e+34: tmp = t_2 elif z <= 3.9e+50: tmp = t_1 / (y + ((z * b) - (z * y))) elif z <= 5e+89: tmp = ((a - t) / y) - (x / z) elif z <= 1.3e+136: tmp = t_1 / (y + (z * (b - y))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * x) - Float64(z * Float64(a - t))) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.2e+34) tmp = t_2; elseif (z <= 3.9e+50) tmp = Float64(t_1 / Float64(y + Float64(Float64(z * b) - Float64(z * y)))); elseif (z <= 5e+89) tmp = Float64(Float64(Float64(a - t) / y) - Float64(x / z)); elseif (z <= 1.3e+136) tmp = Float64(t_1 / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * x) - (z * (a - t)); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -2.2e+34) tmp = t_2; elseif (z <= 3.9e+50) tmp = t_1 / (y + ((z * b) - (z * y))); elseif (z <= 5e+89) tmp = ((a - t) / y) - (x / z); elseif (z <= 1.3e+136) tmp = t_1 / (y + (z * (b - y))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] - N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+34], t$95$2, If[LessEqual[z, 3.9e+50], N[(t$95$1 / N[(y + N[(N[(z * b), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+89], N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+136], N[(t$95$1 / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot x - z \cdot \left(a - t\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+50}:\\
\;\;\;\;\frac{t_1}{y + \left(z \cdot b - z \cdot y\right)}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+89}:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+136}:\\
\;\;\;\;\frac{t_1}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.2000000000000002e34 or 1.3000000000000001e136 < z Initial program 37.0%
Taylor expanded in z around inf 85.8%
if -2.2000000000000002e34 < z < 3.89999999999999967e50Initial program 90.2%
sub-neg90.2%
distribute-lft-in90.2%
Applied egg-rr90.2%
if 3.89999999999999967e50 < z < 4.99999999999999983e89Initial program 51.2%
Taylor expanded in z around inf 50.0%
Taylor expanded in y around -inf 90.2%
+-commutative90.2%
mul-1-neg90.2%
unsub-neg90.2%
associate-*r/90.2%
mul-1-neg90.2%
associate--l+90.2%
associate-/l*99.8%
mul-1-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
if 4.99999999999999983e89 < z < 1.3000000000000001e136Initial program 67.3%
Final simplification87.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (* y x) (* z (- a t))) y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -8.2e+24)
t_2
(if (<= z -4.3e-76)
t_1
(if (<= z -3.6e-189) x (if (<= z 0.36) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * x) - (z * (a - t))) / y;
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -8.2e+24) {
tmp = t_2;
} else if (z <= -4.3e-76) {
tmp = t_1;
} else if (z <= -3.6e-189) {
tmp = x;
} else if (z <= 0.36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((y * x) - (z * (a - t))) / y
t_2 = (t - a) / (b - y)
if (z <= (-8.2d+24)) then
tmp = t_2
else if (z <= (-4.3d-76)) then
tmp = t_1
else if (z <= (-3.6d-189)) then
tmp = x
else if (z <= 0.36d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * x) - (z * (a - t))) / y;
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -8.2e+24) {
tmp = t_2;
} else if (z <= -4.3e-76) {
tmp = t_1;
} else if (z <= -3.6e-189) {
tmp = x;
} else if (z <= 0.36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((y * x) - (z * (a - t))) / y t_2 = (t - a) / (b - y) tmp = 0 if z <= -8.2e+24: tmp = t_2 elif z <= -4.3e-76: tmp = t_1 elif z <= -3.6e-189: tmp = x elif z <= 0.36: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * x) - Float64(z * Float64(a - t))) / y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -8.2e+24) tmp = t_2; elseif (z <= -4.3e-76) tmp = t_1; elseif (z <= -3.6e-189) tmp = x; elseif (z <= 0.36) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((y * x) - (z * (a - t))) / y; t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -8.2e+24) tmp = t_2; elseif (z <= -4.3e-76) tmp = t_1; elseif (z <= -3.6e-189) tmp = x; elseif (z <= 0.36) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * x), $MachinePrecision] - N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+24], t$95$2, If[LessEqual[z, -4.3e-76], t$95$1, If[LessEqual[z, -3.6e-189], x, If[LessEqual[z, 0.36], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot x - z \cdot \left(a - t\right)}{y}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-189}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 0.36:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -8.2000000000000002e24 or 0.35999999999999999 < z Initial program 47.7%
Taylor expanded in z around inf 77.3%
if -8.2000000000000002e24 < z < -4.2999999999999999e-76 or -3.60000000000000017e-189 < z < 0.35999999999999999Initial program 94.4%
Taylor expanded in z around 0 61.5%
if -4.2999999999999999e-76 < z < -3.60000000000000017e-189Initial program 75.3%
Taylor expanded in z around 0 60.9%
Final simplification68.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))) (t_2 (/ (- a) b)) (t_3 (/ x (- 1.0 z))))
(if (<= y -5.2e-97)
t_3
(if (<= y -4.2e-248)
t_1
(if (<= y 2.5e-306)
t_2
(if (<= y 3.4e-217) t_1 (if (<= y 4.7e+14) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double t_2 = -a / b;
double t_3 = x / (1.0 - z);
double tmp;
if (y <= -5.2e-97) {
tmp = t_3;
} else if (y <= -4.2e-248) {
tmp = t_1;
} else if (y <= 2.5e-306) {
tmp = t_2;
} else if (y <= 3.4e-217) {
tmp = t_1;
} else if (y <= 4.7e+14) {
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 = t / (b - y)
t_2 = -a / b
t_3 = x / (1.0d0 - z)
if (y <= (-5.2d-97)) then
tmp = t_3
else if (y <= (-4.2d-248)) then
tmp = t_1
else if (y <= 2.5d-306) then
tmp = t_2
else if (y <= 3.4d-217) then
tmp = t_1
else if (y <= 4.7d+14) 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 = t / (b - y);
double t_2 = -a / b;
double t_3 = x / (1.0 - z);
double tmp;
if (y <= -5.2e-97) {
tmp = t_3;
} else if (y <= -4.2e-248) {
tmp = t_1;
} else if (y <= 2.5e-306) {
tmp = t_2;
} else if (y <= 3.4e-217) {
tmp = t_1;
} else if (y <= 4.7e+14) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) t_2 = -a / b t_3 = x / (1.0 - z) tmp = 0 if y <= -5.2e-97: tmp = t_3 elif y <= -4.2e-248: tmp = t_1 elif y <= 2.5e-306: tmp = t_2 elif y <= 3.4e-217: tmp = t_1 elif y <= 4.7e+14: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) t_2 = Float64(Float64(-a) / b) t_3 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -5.2e-97) tmp = t_3; elseif (y <= -4.2e-248) tmp = t_1; elseif (y <= 2.5e-306) tmp = t_2; elseif (y <= 3.4e-217) tmp = t_1; elseif (y <= 4.7e+14) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); t_2 = -a / b; t_3 = x / (1.0 - z); tmp = 0.0; if (y <= -5.2e-97) tmp = t_3; elseif (y <= -4.2e-248) tmp = t_1; elseif (y <= 2.5e-306) tmp = t_2; elseif (y <= 3.4e-217) tmp = t_1; elseif (y <= 4.7e+14) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-a) / b), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e-97], t$95$3, If[LessEqual[y, -4.2e-248], t$95$1, If[LessEqual[y, 2.5e-306], t$95$2, If[LessEqual[y, 3.4e-217], t$95$1, If[LessEqual[y, 4.7e+14], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
t_2 := \frac{-a}{b}\\
t_3 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{-97}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-248}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-306}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-217}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+14}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -5.20000000000000014e-97 or 4.7e14 < y Initial program 59.8%
Taylor expanded in y around inf 48.1%
+-commutative48.1%
mul-1-neg48.1%
unsub-neg48.1%
Simplified48.1%
if -5.20000000000000014e-97 < y < -4.2e-248 or 2.49999999999999999e-306 < y < 3.40000000000000016e-217Initial program 90.0%
Taylor expanded in z around inf 66.2%
Taylor expanded in t around inf 49.5%
if -4.2e-248 < y < 2.49999999999999999e-306 or 3.40000000000000016e-217 < y < 4.7e14Initial program 79.7%
Taylor expanded in a around inf 38.1%
mul-1-neg38.1%
distribute-rgt-neg-in38.1%
Simplified38.1%
Taylor expanded in y around 0 47.3%
associate-*r/47.3%
mul-1-neg47.3%
Simplified47.3%
Final simplification48.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.55e+264)
(- (/ (- a t) y) (/ x z))
(if (or (<= y -2.9e+71) (not (<= y 6.5e+90)))
(/ x (- 1.0 z))
(/ (- t a) (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.55e+264) {
tmp = ((a - t) / y) - (x / z);
} else if ((y <= -2.9e+71) || !(y <= 6.5e+90)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.55d+264)) then
tmp = ((a - t) / y) - (x / z)
else if ((y <= (-2.9d+71)) .or. (.not. (y <= 6.5d+90))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / (b - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.55e+264) {
tmp = ((a - t) / y) - (x / z);
} else if ((y <= -2.9e+71) || !(y <= 6.5e+90)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.55e+264: tmp = ((a - t) / y) - (x / z) elif (y <= -2.9e+71) or not (y <= 6.5e+90): tmp = x / (1.0 - z) else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.55e+264) tmp = Float64(Float64(Float64(a - t) / y) - Float64(x / z)); elseif ((y <= -2.9e+71) || !(y <= 6.5e+90)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.55e+264) tmp = ((a - t) / y) - (x / z); elseif ((y <= -2.9e+71) || ~((y <= 6.5e+90))) tmp = x / (1.0 - z); else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.55e+264], N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -2.9e+71], N[Not[LessEqual[y, 6.5e+90]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+264}:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{+71} \lor \neg \left(y \leq 6.5 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if y < -1.54999999999999991e264Initial program 27.1%
Taylor expanded in z around inf 11.0%
Taylor expanded in y around -inf 71.0%
+-commutative71.0%
mul-1-neg71.0%
unsub-neg71.0%
associate-*r/71.0%
mul-1-neg71.0%
associate--l+71.0%
associate-/l*71.0%
mul-1-neg71.0%
unsub-neg71.0%
Simplified71.0%
Taylor expanded in z around inf 71.7%
if -1.54999999999999991e264 < y < -2.90000000000000007e71 or 6.5000000000000001e90 < y Initial program 56.0%
Taylor expanded in y around inf 59.7%
+-commutative59.7%
mul-1-neg59.7%
unsub-neg59.7%
Simplified59.7%
if -2.90000000000000007e71 < y < 6.5000000000000001e90Initial program 81.4%
Taylor expanded in z around inf 62.9%
Final simplification62.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.6e+71) (not (<= y 1.5e+91))) (/ x (- 1.0 z)) (/ (- t a) (- b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.6e+71) || !(y <= 1.5e+91)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-4.6d+71)) .or. (.not. (y <= 1.5d+91))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / (b - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.6e+71) || !(y <= 1.5e+91)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.6e+71) or not (y <= 1.5e+91): tmp = x / (1.0 - z) else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.6e+71) || !(y <= 1.5e+91)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.6e+71) || ~((y <= 1.5e+91))) tmp = x / (1.0 - z); else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.6e+71], N[Not[LessEqual[y, 1.5e+91]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+71} \lor \neg \left(y \leq 1.5 \cdot 10^{+91}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if y < -4.6000000000000005e71 or 1.50000000000000003e91 < y Initial program 53.0%
Taylor expanded in y around inf 56.7%
+-commutative56.7%
mul-1-neg56.7%
unsub-neg56.7%
Simplified56.7%
if -4.6000000000000005e71 < y < 1.50000000000000003e91Initial program 81.4%
Taylor expanded in z around inf 62.9%
Final simplification60.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.5e+71) (not (<= y 2100.0))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.5e+71) || !(y <= 2100.0)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-5.5d+71)) .or. (.not. (y <= 2100.0d0))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.5e+71) || !(y <= 2100.0)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.5e+71) or not (y <= 2100.0): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.5e+71) || !(y <= 2100.0)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5.5e+71) || ~((y <= 2100.0))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.5e+71], N[Not[LessEqual[y, 2100.0]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+71} \lor \neg \left(y \leq 2100\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -5.5e71 or 2100 < y Initial program 54.6%
Taylor expanded in y around inf 53.5%
+-commutative53.5%
mul-1-neg53.5%
unsub-neg53.5%
Simplified53.5%
if -5.5e71 < y < 2100Initial program 82.5%
Taylor expanded in y around 0 57.2%
Final simplification55.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.2e-8) (/ (- a) b) (if (<= z 3.6e-5) (+ x (* z x)) (/ (- x) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.2e-8) {
tmp = -a / b;
} else if (z <= 3.6e-5) {
tmp = x + (z * x);
} else {
tmp = -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) :: tmp
if (z <= (-1.2d-8)) then
tmp = -a / b
else if (z <= 3.6d-5) then
tmp = x + (z * x)
else
tmp = -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 tmp;
if (z <= -1.2e-8) {
tmp = -a / b;
} else if (z <= 3.6e-5) {
tmp = x + (z * x);
} else {
tmp = -x / z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.2e-8: tmp = -a / b elif z <= 3.6e-5: tmp = x + (z * x) else: tmp = -x / z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.2e-8) tmp = Float64(Float64(-a) / b); elseif (z <= 3.6e-5) tmp = Float64(x + Float64(z * x)); else tmp = Float64(Float64(-x) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.2e-8) tmp = -a / b; elseif (z <= 3.6e-5) tmp = x + (z * x); else tmp = -x / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.2e-8], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 3.6e-5], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], N[((-x) / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-5}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{z}\\
\end{array}
\end{array}
if z < -1.19999999999999999e-8Initial program 46.5%
Taylor expanded in a around inf 24.4%
mul-1-neg24.4%
distribute-rgt-neg-in24.4%
Simplified24.4%
Taylor expanded in y around 0 41.1%
associate-*r/41.1%
mul-1-neg41.1%
Simplified41.1%
if -1.19999999999999999e-8 < z < 3.60000000000000009e-5Initial program 90.4%
Taylor expanded in y around inf 41.7%
+-commutative41.7%
mul-1-neg41.7%
unsub-neg41.7%
Simplified41.7%
Taylor expanded in z around 0 41.5%
if 3.60000000000000009e-5 < z Initial program 51.7%
Taylor expanded in y around inf 24.9%
+-commutative24.9%
mul-1-neg24.9%
unsub-neg24.9%
Simplified24.9%
Taylor expanded in z around inf 24.2%
associate-*r/24.2%
mul-1-neg24.2%
Simplified24.2%
Final simplification36.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.7e-7) (/ (- a) b) (if (<= z 1.32e+14) (+ x (* z x)) (/ t (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.7e-7) {
tmp = -a / b;
} else if (z <= 1.32e+14) {
tmp = x + (z * x);
} else {
tmp = t / (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 <= (-3.7d-7)) then
tmp = -a / b
else if (z <= 1.32d+14) then
tmp = x + (z * x)
else
tmp = t / (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 <= -3.7e-7) {
tmp = -a / b;
} else if (z <= 1.32e+14) {
tmp = x + (z * x);
} else {
tmp = t / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.7e-7: tmp = -a / b elif z <= 1.32e+14: tmp = x + (z * x) else: tmp = t / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.7e-7) tmp = Float64(Float64(-a) / b); elseif (z <= 1.32e+14) tmp = Float64(x + Float64(z * x)); else tmp = Float64(t / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.7e-7) tmp = -a / b; elseif (z <= 1.32e+14) tmp = x + (z * x); else tmp = t / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.7e-7], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 1.32e+14], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+14}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y}\\
\end{array}
\end{array}
if z < -3.70000000000000004e-7Initial program 46.5%
Taylor expanded in a around inf 24.4%
mul-1-neg24.4%
distribute-rgt-neg-in24.4%
Simplified24.4%
Taylor expanded in y around 0 41.1%
associate-*r/41.1%
mul-1-neg41.1%
Simplified41.1%
if -3.70000000000000004e-7 < z < 1.32e14Initial program 90.6%
Taylor expanded in y around inf 41.2%
+-commutative41.2%
mul-1-neg41.2%
unsub-neg41.2%
Simplified41.2%
Taylor expanded in z around 0 40.3%
if 1.32e14 < z Initial program 48.7%
Taylor expanded in z around inf 74.3%
Taylor expanded in t around inf 44.1%
Final simplification41.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.8e+20) (not (<= z 6e-74))) (/ (- a) b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.8e+20) || !(z <= 6e-74)) {
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 ((z <= (-1.8d+20)) .or. (.not. (z <= 6d-74))) 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 ((z <= -1.8e+20) || !(z <= 6e-74)) {
tmp = -a / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.8e+20) or not (z <= 6e-74): tmp = -a / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.8e+20) || !(z <= 6e-74)) 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 ((z <= -1.8e+20) || ~((z <= 6e-74))) tmp = -a / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.8e+20], N[Not[LessEqual[z, 6e-74]], $MachinePrecision]], N[((-a) / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+20} \lor \neg \left(z \leq 6 \cdot 10^{-74}\right):\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.8e20 or 6.00000000000000014e-74 < z Initial program 52.7%
Taylor expanded in a around inf 26.0%
mul-1-neg26.0%
distribute-rgt-neg-in26.0%
Simplified26.0%
Taylor expanded in y around 0 30.0%
associate-*r/30.0%
mul-1-neg30.0%
Simplified30.0%
if -1.8e20 < z < 6.00000000000000014e-74Initial program 91.6%
Taylor expanded in z around 0 42.9%
Final simplification35.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.8e+15) (/ (- a) b) (if (<= z 3.4e-5) x (/ (- x) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.8e+15) {
tmp = -a / b;
} else if (z <= 3.4e-5) {
tmp = x;
} else {
tmp = -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) :: tmp
if (z <= (-3.8d+15)) then
tmp = -a / b
else if (z <= 3.4d-5) then
tmp = x
else
tmp = -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 tmp;
if (z <= -3.8e+15) {
tmp = -a / b;
} else if (z <= 3.4e-5) {
tmp = x;
} else {
tmp = -x / z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.8e+15: tmp = -a / b elif z <= 3.4e-5: tmp = x else: tmp = -x / z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.8e+15) tmp = Float64(Float64(-a) / b); elseif (z <= 3.4e-5) tmp = x; else tmp = Float64(Float64(-x) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.8e+15) tmp = -a / b; elseif (z <= 3.4e-5) tmp = x; else tmp = -x / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.8e+15], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 3.4e-5], x, N[((-x) / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+15}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{z}\\
\end{array}
\end{array}
if z < -3.8e15Initial program 45.5%
Taylor expanded in a around inf 24.7%
mul-1-neg24.7%
distribute-rgt-neg-in24.7%
Simplified24.7%
Taylor expanded in y around 0 41.8%
associate-*r/41.8%
mul-1-neg41.8%
Simplified41.8%
if -3.8e15 < z < 3.4e-5Initial program 90.4%
Taylor expanded in z around 0 40.7%
if 3.4e-5 < z Initial program 51.7%
Taylor expanded in y around inf 24.9%
+-commutative24.9%
mul-1-neg24.9%
unsub-neg24.9%
Simplified24.9%
Taylor expanded in z around inf 24.2%
associate-*r/24.2%
mul-1-neg24.2%
Simplified24.2%
Final simplification36.5%
(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 70.5%
Taylor expanded in z around 0 22.7%
Final simplification22.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 2023195
(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)))))