
(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 (+ (* x y) (* z (- t a))))
(t_2 (/ (- t a) (- b y)))
(t_3 (+ (/ x (- 1.0 z)) t_2))
(t_4 (/ t_1 (+ y (* z (- b y)))))
(t_5 (+ t_2 (* (/ x z) (/ y (- b y))))))
(if (<= t_4 -5e+267)
t_3
(if (<= t_4 -5e-282)
(/ t_1 (- (* z b) (* y (+ z -1.0))))
(if (<= t_4 0.0)
t_5
(if (<= t_4 2e+290) t_4 (if (<= t_4 INFINITY) t_3 t_5)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * y) + (z * (t - a));
double t_2 = (t - a) / (b - y);
double t_3 = (x / (1.0 - z)) + t_2;
double t_4 = t_1 / (y + (z * (b - y)));
double t_5 = t_2 + ((x / z) * (y / (b - y)));
double tmp;
if (t_4 <= -5e+267) {
tmp = t_3;
} else if (t_4 <= -5e-282) {
tmp = t_1 / ((z * b) - (y * (z + -1.0)));
} else if (t_4 <= 0.0) {
tmp = t_5;
} else if (t_4 <= 2e+290) {
tmp = t_4;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = t_5;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * y) + (z * (t - a));
double t_2 = (t - a) / (b - y);
double t_3 = (x / (1.0 - z)) + t_2;
double t_4 = t_1 / (y + (z * (b - y)));
double t_5 = t_2 + ((x / z) * (y / (b - y)));
double tmp;
if (t_4 <= -5e+267) {
tmp = t_3;
} else if (t_4 <= -5e-282) {
tmp = t_1 / ((z * b) - (y * (z + -1.0)));
} else if (t_4 <= 0.0) {
tmp = t_5;
} else if (t_4 <= 2e+290) {
tmp = t_4;
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = t_5;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * y) + (z * (t - a)) t_2 = (t - a) / (b - y) t_3 = (x / (1.0 - z)) + t_2 t_4 = t_1 / (y + (z * (b - y))) t_5 = t_2 + ((x / z) * (y / (b - y))) tmp = 0 if t_4 <= -5e+267: tmp = t_3 elif t_4 <= -5e-282: tmp = t_1 / ((z * b) - (y * (z + -1.0))) elif t_4 <= 0.0: tmp = t_5 elif t_4 <= 2e+290: tmp = t_4 elif t_4 <= math.inf: tmp = t_3 else: tmp = t_5 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * y) + Float64(z * Float64(t - a))) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = Float64(Float64(x / Float64(1.0 - z)) + t_2) t_4 = Float64(t_1 / Float64(y + Float64(z * Float64(b - y)))) t_5 = Float64(t_2 + Float64(Float64(x / z) * Float64(y / Float64(b - y)))) tmp = 0.0 if (t_4 <= -5e+267) tmp = t_3; elseif (t_4 <= -5e-282) tmp = Float64(t_1 / Float64(Float64(z * b) - Float64(y * Float64(z + -1.0)))); elseif (t_4 <= 0.0) tmp = t_5; elseif (t_4 <= 2e+290) tmp = t_4; elseif (t_4 <= Inf) tmp = t_3; else tmp = t_5; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * y) + (z * (t - a)); t_2 = (t - a) / (b - y); t_3 = (x / (1.0 - z)) + t_2; t_4 = t_1 / (y + (z * (b - y))); t_5 = t_2 + ((x / z) * (y / (b - y))); tmp = 0.0; if (t_4 <= -5e+267) tmp = t_3; elseif (t_4 <= -5e-282) tmp = t_1 / ((z * b) - (y * (z + -1.0))); elseif (t_4 <= 0.0) tmp = t_5; elseif (t_4 <= 2e+290) tmp = t_4; elseif (t_4 <= Inf) tmp = t_3; else tmp = t_5; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -5e+267], t$95$3, If[LessEqual[t$95$4, -5e-282], N[(t$95$1 / N[(N[(z * b), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 0.0], t$95$5, If[LessEqual[t$95$4, 2e+290], t$95$4, If[LessEqual[t$95$4, Infinity], t$95$3, t$95$5]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot \left(t - a\right)\\
t_2 := \frac{t - a}{b - y}\\
t_3 := \frac{x}{1 - z} + t\_2\\
t_4 := \frac{t\_1}{y + z \cdot \left(b - y\right)}\\
t_5 := t\_2 + \frac{x}{z} \cdot \frac{y}{b - y}\\
\mathbf{if}\;t\_4 \leq -5 \cdot 10^{+267}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-282}:\\
\;\;\;\;\frac{t\_1}{z \cdot b - y \cdot \left(z + -1\right)}\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+290}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999999e267 or 2.00000000000000012e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 27.0%
Taylor expanded in x around 0 27.0%
Taylor expanded in z around inf 59.9%
Taylor expanded in y around inf 98.5%
mul-1-neg98.5%
unsub-neg98.5%
Simplified98.5%
if -4.9999999999999999e267 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.0000000000000001e-282Initial program 99.5%
Taylor expanded in y around -inf 99.5%
+-commutative99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
if -5.0000000000000001e-282 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 12.4%
Taylor expanded in x around 0 12.4%
Taylor expanded in z around inf 67.7%
Taylor expanded in z around inf 67.7%
times-frac100.0%
Simplified100.0%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000012e290Initial program 99.7%
Final simplification99.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_2 (/ (- t a) (- b y)))
(t_3 (+ t_2 (* (/ x z) (/ y (- b y)))))
(t_4 (+ (/ x (- 1.0 z)) t_2)))
(if (<= t_1 -5e+267)
t_4
(if (<= t_1 -5e-282)
t_1
(if (<= t_1 0.0)
t_3
(if (<= t_1 2e+290) t_1 (if (<= t_1 INFINITY) t_4 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = (t - a) / (b - y);
double t_3 = t_2 + ((x / z) * (y / (b - y)));
double t_4 = (x / (1.0 - z)) + t_2;
double tmp;
if (t_1 <= -5e+267) {
tmp = t_4;
} else if (t_1 <= -5e-282) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = t_3;
} else if (t_1 <= 2e+290) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = (t - a) / (b - y);
double t_3 = t_2 + ((x / z) * (y / (b - y)));
double t_4 = (x / (1.0 - z)) + t_2;
double tmp;
if (t_1 <= -5e+267) {
tmp = t_4;
} else if (t_1 <= -5e-282) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = t_3;
} else if (t_1 <= 2e+290) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) t_2 = (t - a) / (b - y) t_3 = t_2 + ((x / z) * (y / (b - y))) t_4 = (x / (1.0 - z)) + t_2 tmp = 0 if t_1 <= -5e+267: tmp = t_4 elif t_1 <= -5e-282: tmp = t_1 elif t_1 <= 0.0: tmp = t_3 elif t_1 <= 2e+290: tmp = t_1 elif t_1 <= math.inf: tmp = t_4 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = Float64(t_2 + Float64(Float64(x / z) * Float64(y / Float64(b - y)))) t_4 = Float64(Float64(x / Float64(1.0 - z)) + t_2) tmp = 0.0 if (t_1 <= -5e+267) tmp = t_4; elseif (t_1 <= -5e-282) tmp = t_1; elseif (t_1 <= 0.0) tmp = t_3; elseif (t_1 <= 2e+290) tmp = t_1; elseif (t_1 <= Inf) tmp = t_4; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); t_2 = (t - a) / (b - y); t_3 = t_2 + ((x / z) * (y / (b - y))); t_4 = (x / (1.0 - z)) + t_2; tmp = 0.0; if (t_1 <= -5e+267) tmp = t_4; elseif (t_1 <= -5e-282) tmp = t_1; elseif (t_1 <= 0.0) tmp = t_3; elseif (t_1 <= 2e+290) tmp = t_1; elseif (t_1 <= Inf) tmp = t_4; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+267], t$95$4, If[LessEqual[t$95$1, -5e-282], t$95$1, If[LessEqual[t$95$1, 0.0], t$95$3, If[LessEqual[t$95$1, 2e+290], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \frac{t - a}{b - y}\\
t_3 := t\_2 + \frac{x}{z} \cdot \frac{y}{b - y}\\
t_4 := \frac{x}{1 - z} + t\_2\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+267}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+290}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999999e267 or 2.00000000000000012e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 27.0%
Taylor expanded in x around 0 27.0%
Taylor expanded in z around inf 59.9%
Taylor expanded in y around inf 98.5%
mul-1-neg98.5%
unsub-neg98.5%
Simplified98.5%
if -4.9999999999999999e267 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.0000000000000001e-282 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000012e290Initial program 99.6%
if -5.0000000000000001e-282 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 12.4%
Taylor expanded in x around 0 12.4%
Taylor expanded in z around inf 67.7%
Taylor expanded in z around inf 67.7%
times-frac100.0%
Simplified100.0%
Final simplification99.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ z (/ y (- t (+ a (* x b)))))))
(t_2 (+ (/ (- t a) (- b y)) (* (/ x z) (/ y (- b y))))))
(if (<= z -0.000122)
t_2
(if (<= z -2.9e-100)
t_1
(if (<= z -9.5e-146)
(- (+ (/ t b) (/ (* x y) (* z b))) (/ a b))
(if (<= z 1.2e-273)
(- x (/ (* z a) y))
(if (<= z 3.2e-48) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z / (y / (t - (a + (x * b)))));
double t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y)));
double tmp;
if (z <= -0.000122) {
tmp = t_2;
} else if (z <= -2.9e-100) {
tmp = t_1;
} else if (z <= -9.5e-146) {
tmp = ((t / b) + ((x * y) / (z * b))) - (a / b);
} else if (z <= 1.2e-273) {
tmp = x - ((z * a) / y);
} else if (z <= 3.2e-48) {
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 = x + (z / (y / (t - (a + (x * b)))))
t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y)))
if (z <= (-0.000122d0)) then
tmp = t_2
else if (z <= (-2.9d-100)) then
tmp = t_1
else if (z <= (-9.5d-146)) then
tmp = ((t / b) + ((x * y) / (z * b))) - (a / b)
else if (z <= 1.2d-273) then
tmp = x - ((z * a) / y)
else if (z <= 3.2d-48) 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 = x + (z / (y / (t - (a + (x * b)))));
double t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y)));
double tmp;
if (z <= -0.000122) {
tmp = t_2;
} else if (z <= -2.9e-100) {
tmp = t_1;
} else if (z <= -9.5e-146) {
tmp = ((t / b) + ((x * y) / (z * b))) - (a / b);
} else if (z <= 1.2e-273) {
tmp = x - ((z * a) / y);
} else if (z <= 3.2e-48) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z / (y / (t - (a + (x * b))))) t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y))) tmp = 0 if z <= -0.000122: tmp = t_2 elif z <= -2.9e-100: tmp = t_1 elif z <= -9.5e-146: tmp = ((t / b) + ((x * y) / (z * b))) - (a / b) elif z <= 1.2e-273: tmp = x - ((z * a) / y) elif z <= 3.2e-48: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z / Float64(y / Float64(t - Float64(a + Float64(x * b)))))) t_2 = Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(Float64(x / z) * Float64(y / Float64(b - y)))) tmp = 0.0 if (z <= -0.000122) tmp = t_2; elseif (z <= -2.9e-100) tmp = t_1; elseif (z <= -9.5e-146) tmp = Float64(Float64(Float64(t / b) + Float64(Float64(x * y) / Float64(z * b))) - Float64(a / b)); elseif (z <= 1.2e-273) tmp = Float64(x - Float64(Float64(z * a) / y)); elseif (z <= 3.2e-48) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z / (y / (t - (a + (x * b))))); t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y))); tmp = 0.0; if (z <= -0.000122) tmp = t_2; elseif (z <= -2.9e-100) tmp = t_1; elseif (z <= -9.5e-146) tmp = ((t / b) + ((x * y) / (z * b))) - (a / b); elseif (z <= 1.2e-273) tmp = x - ((z * a) / y); elseif (z <= 3.2e-48) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z / N[(y / N[(t - N[(a + N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.000122], t$95$2, If[LessEqual[z, -2.9e-100], t$95$1, If[LessEqual[z, -9.5e-146], N[(N[(N[(t / b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-273], N[(x - N[(N[(z * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-48], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{\frac{y}{t - \left(a + x \cdot b\right)}}\\
t_2 := \frac{t - a}{b - y} + \frac{x}{z} \cdot \frac{y}{b - y}\\
\mathbf{if}\;z \leq -0.000122:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-146}:\\
\;\;\;\;\left(\frac{t}{b} + \frac{x \cdot y}{z \cdot b}\right) - \frac{a}{b}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-273}:\\
\;\;\;\;x - \frac{z \cdot a}{y}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.21999999999999997e-4 or 3.1999999999999998e-48 < z Initial program 51.7%
Taylor expanded in x around 0 51.7%
Taylor expanded in z around inf 83.9%
Taylor expanded in z around inf 83.0%
times-frac95.8%
Simplified95.8%
if -1.21999999999999997e-4 < z < -2.89999999999999975e-100 or 1.19999999999999991e-273 < z < 3.1999999999999998e-48Initial program 84.1%
Taylor expanded in z around 0 57.6%
Taylor expanded in y around 0 76.8%
associate-/l*74.3%
Simplified74.3%
if -2.89999999999999975e-100 < z < -9.5000000000000005e-146Initial program 77.1%
Taylor expanded in y around 0 63.8%
*-commutative63.8%
Simplified63.8%
Taylor expanded in x around 0 75.0%
if -9.5000000000000005e-146 < z < 1.19999999999999991e-273Initial program 79.2%
Taylor expanded in z around 0 49.7%
Taylor expanded in a around inf 76.9%
mul-1-neg76.9%
*-commutative76.9%
Simplified76.9%
Final simplification86.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ z (/ y (- t (+ a (* x b)))))))
(t_2 (+ (/ (- t a) (- b y)) (* (/ x z) (/ y (- b y))))))
(if (<= z -0.000122)
t_2
(if (<= z -4.7e-101)
t_1
(if (<= z -9.5e-146)
(+ (/ (* x y) (+ y (* z (- b y)))) (/ (- t a) b))
(if (<= z 2.1e-272)
(- x (/ (* z a) y))
(if (<= z 2.7e-48) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z / (y / (t - (a + (x * b)))));
double t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y)));
double tmp;
if (z <= -0.000122) {
tmp = t_2;
} else if (z <= -4.7e-101) {
tmp = t_1;
} else if (z <= -9.5e-146) {
tmp = ((x * y) / (y + (z * (b - y)))) + ((t - a) / b);
} else if (z <= 2.1e-272) {
tmp = x - ((z * a) / y);
} else if (z <= 2.7e-48) {
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 = x + (z / (y / (t - (a + (x * b)))))
t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y)))
if (z <= (-0.000122d0)) then
tmp = t_2
else if (z <= (-4.7d-101)) then
tmp = t_1
else if (z <= (-9.5d-146)) then
tmp = ((x * y) / (y + (z * (b - y)))) + ((t - a) / b)
else if (z <= 2.1d-272) then
tmp = x - ((z * a) / y)
else if (z <= 2.7d-48) 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 = x + (z / (y / (t - (a + (x * b)))));
double t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y)));
double tmp;
if (z <= -0.000122) {
tmp = t_2;
} else if (z <= -4.7e-101) {
tmp = t_1;
} else if (z <= -9.5e-146) {
tmp = ((x * y) / (y + (z * (b - y)))) + ((t - a) / b);
} else if (z <= 2.1e-272) {
tmp = x - ((z * a) / y);
} else if (z <= 2.7e-48) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z / (y / (t - (a + (x * b))))) t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y))) tmp = 0 if z <= -0.000122: tmp = t_2 elif z <= -4.7e-101: tmp = t_1 elif z <= -9.5e-146: tmp = ((x * y) / (y + (z * (b - y)))) + ((t - a) / b) elif z <= 2.1e-272: tmp = x - ((z * a) / y) elif z <= 2.7e-48: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z / Float64(y / Float64(t - Float64(a + Float64(x * b)))))) t_2 = Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(Float64(x / z) * Float64(y / Float64(b - y)))) tmp = 0.0 if (z <= -0.000122) tmp = t_2; elseif (z <= -4.7e-101) tmp = t_1; elseif (z <= -9.5e-146) tmp = Float64(Float64(Float64(x * y) / Float64(y + Float64(z * Float64(b - y)))) + Float64(Float64(t - a) / b)); elseif (z <= 2.1e-272) tmp = Float64(x - Float64(Float64(z * a) / y)); elseif (z <= 2.7e-48) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z / (y / (t - (a + (x * b))))); t_2 = ((t - a) / (b - y)) + ((x / z) * (y / (b - y))); tmp = 0.0; if (z <= -0.000122) tmp = t_2; elseif (z <= -4.7e-101) tmp = t_1; elseif (z <= -9.5e-146) tmp = ((x * y) / (y + (z * (b - y)))) + ((t - a) / b); elseif (z <= 2.1e-272) tmp = x - ((z * a) / y); elseif (z <= 2.7e-48) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z / N[(y / N[(t - N[(a + N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.000122], t$95$2, If[LessEqual[z, -4.7e-101], t$95$1, If[LessEqual[z, -9.5e-146], N[(N[(N[(x * y), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-272], N[(x - N[(N[(z * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-48], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{\frac{y}{t - \left(a + x \cdot b\right)}}\\
t_2 := \frac{t - a}{b - y} + \frac{x}{z} \cdot \frac{y}{b - y}\\
\mathbf{if}\;z \leq -0.000122:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-146}:\\
\;\;\;\;\frac{x \cdot y}{y + z \cdot \left(b - y\right)} + \frac{t - a}{b}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-272}:\\
\;\;\;\;x - \frac{z \cdot a}{y}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.21999999999999997e-4 or 2.70000000000000011e-48 < z Initial program 51.7%
Taylor expanded in x around 0 51.7%
Taylor expanded in z around inf 83.9%
Taylor expanded in z around inf 83.0%
times-frac95.8%
Simplified95.8%
if -1.21999999999999997e-4 < z < -4.6999999999999999e-101 or 2.09999999999999987e-272 < z < 2.70000000000000011e-48Initial program 84.1%
Taylor expanded in z around 0 57.6%
Taylor expanded in y around 0 76.8%
associate-/l*74.3%
Simplified74.3%
if -4.6999999999999999e-101 < z < -9.5000000000000005e-146Initial program 77.1%
Taylor expanded in x around 0 77.1%
Taylor expanded in y around 0 76.1%
if -9.5000000000000005e-146 < z < 2.09999999999999987e-272Initial program 79.2%
Taylor expanded in z around 0 49.7%
Taylor expanded in a around inf 76.9%
mul-1-neg76.9%
*-commutative76.9%
Simplified76.9%
Final simplification86.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.75e+80) (not (<= y 2.7e+87))) (+ (/ x (- 1.0 z)) (/ (- t a) (- b y))) (/ (- t a) (- (+ b (/ y z)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.75e+80) || !(y <= 2.7e+87)) {
tmp = (x / (1.0 - z)) + ((t - a) / (b - y));
} else {
tmp = (t - a) / ((b + (y / 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 ((y <= (-1.75d+80)) .or. (.not. (y <= 2.7d+87))) then
tmp = (x / (1.0d0 - z)) + ((t - a) / (b - y))
else
tmp = (t - a) / ((b + (y / 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 ((y <= -1.75e+80) || !(y <= 2.7e+87)) {
tmp = (x / (1.0 - z)) + ((t - a) / (b - y));
} else {
tmp = (t - a) / ((b + (y / z)) - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.75e+80) or not (y <= 2.7e+87): tmp = (x / (1.0 - z)) + ((t - a) / (b - y)) else: tmp = (t - a) / ((b + (y / z)) - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.75e+80) || !(y <= 2.7e+87)) tmp = Float64(Float64(x / Float64(1.0 - z)) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(Float64(t - a) / Float64(Float64(b + Float64(y / z)) - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.75e+80) || ~((y <= 2.7e+87))) tmp = (x / (1.0 - z)) + ((t - a) / (b - y)); else tmp = (t - a) / ((b + (y / z)) - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.75e+80], N[Not[LessEqual[y, 2.7e+87]], $MachinePrecision]], N[(N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(N[(b + N[(y / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+80} \lor \neg \left(y \leq 2.7 \cdot 10^{+87}\right):\\
\;\;\;\;\frac{x}{1 - z} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{\left(b + \frac{y}{z}\right) - y}\\
\end{array}
\end{array}
if y < -1.74999999999999997e80 or 2.70000000000000007e87 < y Initial program 47.6%
Taylor expanded in x around 0 47.6%
Taylor expanded in z around inf 47.0%
Taylor expanded in y around inf 79.1%
mul-1-neg79.1%
unsub-neg79.1%
Simplified79.1%
if -1.74999999999999997e80 < y < 2.70000000000000007e87Initial program 78.1%
Taylor expanded in x around 0 60.1%
*-commutative60.1%
+-commutative60.1%
fma-udef60.1%
associate-/l*70.6%
Simplified70.6%
Taylor expanded in z around 0 81.2%
Final simplification80.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -0.000122)
t_1
(if (<= z -1.08e-305)
(- x (/ (* z a) y))
(if (<= z 2.5e-77) (+ x (/ z (/ y t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -0.000122) {
tmp = t_1;
} else if (z <= -1.08e-305) {
tmp = x - ((z * a) / y);
} else if (z <= 2.5e-77) {
tmp = x + (z / (y / 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)
if (z <= (-0.000122d0)) then
tmp = t_1
else if (z <= (-1.08d-305)) then
tmp = x - ((z * a) / y)
else if (z <= 2.5d-77) then
tmp = x + (z / (y / 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);
double tmp;
if (z <= -0.000122) {
tmp = t_1;
} else if (z <= -1.08e-305) {
tmp = x - ((z * a) / y);
} else if (z <= 2.5e-77) {
tmp = x + (z / (y / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -0.000122: tmp = t_1 elif z <= -1.08e-305: tmp = x - ((z * a) / y) elif z <= 2.5e-77: tmp = x + (z / (y / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -0.000122) tmp = t_1; elseif (z <= -1.08e-305) tmp = Float64(x - Float64(Float64(z * a) / y)); elseif (z <= 2.5e-77) tmp = Float64(x + Float64(z / Float64(y / 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); tmp = 0.0; if (z <= -0.000122) tmp = t_1; elseif (z <= -1.08e-305) tmp = x - ((z * a) / y); elseif (z <= 2.5e-77) tmp = x + (z / (y / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.000122], t$95$1, If[LessEqual[z, -1.08e-305], N[(x - N[(N[(z * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-77], N[(x + N[(z / N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -0.000122:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.08 \cdot 10^{-305}:\\
\;\;\;\;x - \frac{z \cdot a}{y}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-77}:\\
\;\;\;\;x + \frac{z}{\frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.21999999999999997e-4 or 2.49999999999999982e-77 < z Initial program 52.8%
Taylor expanded in z around inf 80.1%
if -1.21999999999999997e-4 < z < -1.08000000000000004e-305Initial program 81.2%
Taylor expanded in z around 0 46.9%
Taylor expanded in a around inf 66.2%
mul-1-neg66.2%
*-commutative66.2%
Simplified66.2%
if -1.08000000000000004e-305 < z < 2.49999999999999982e-77Initial program 82.2%
Taylor expanded in z around 0 60.1%
Taylor expanded in y around 0 81.9%
associate-/l*75.5%
Simplified75.5%
Taylor expanded in t around inf 75.6%
Final simplification75.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.86e+80) (not (<= y 2.55e+81))) (/ x (- 1.0 z)) (/ (- t a) (- (+ b (/ y z)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.86e+80) || !(y <= 2.55e+81)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / ((b + (y / 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 ((y <= (-1.86d+80)) .or. (.not. (y <= 2.55d+81))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / ((b + (y / 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 ((y <= -1.86e+80) || !(y <= 2.55e+81)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / ((b + (y / z)) - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.86e+80) or not (y <= 2.55e+81): tmp = x / (1.0 - z) else: tmp = (t - a) / ((b + (y / z)) - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.86e+80) || !(y <= 2.55e+81)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / Float64(Float64(b + Float64(y / z)) - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.86e+80) || ~((y <= 2.55e+81))) tmp = x / (1.0 - z); else tmp = (t - a) / ((b + (y / z)) - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.86e+80], N[Not[LessEqual[y, 2.55e+81]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(N[(b + N[(y / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.86 \cdot 10^{+80} \lor \neg \left(y \leq 2.55 \cdot 10^{+81}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{\left(b + \frac{y}{z}\right) - y}\\
\end{array}
\end{array}
if y < -1.8599999999999999e80 or 2.5500000000000001e81 < y Initial program 48.6%
Taylor expanded in y around inf 66.6%
mul-1-neg66.6%
unsub-neg66.6%
Simplified66.6%
if -1.8599999999999999e80 < y < 2.5500000000000001e81Initial program 77.8%
Taylor expanded in x around 0 60.8%
*-commutative60.8%
+-commutative60.8%
fma-udef60.8%
associate-/l*71.5%
Simplified71.5%
Taylor expanded in z around 0 82.2%
Final simplification75.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.22e-27) (not (<= z 5e-77))) (/ (- t a) (- b y)) (+ x (/ z (/ y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.22e-27) || !(z <= 5e-77)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + (z / (y / 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 <= (-1.22d-27)) .or. (.not. (z <= 5d-77))) then
tmp = (t - a) / (b - y)
else
tmp = x + (z / (y / 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 <= -1.22e-27) || !(z <= 5e-77)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + (z / (y / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.22e-27) or not (z <= 5e-77): tmp = (t - a) / (b - y) else: tmp = x + (z / (y / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.22e-27) || !(z <= 5e-77)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(z / Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.22e-27) || ~((z <= 5e-77))) tmp = (t - a) / (b - y); else tmp = x + (z / (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.22e-27], N[Not[LessEqual[z, 5e-77]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{-27} \lor \neg \left(z \leq 5 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{y}{t}}\\
\end{array}
\end{array}
if z < -1.22e-27 or 4.99999999999999963e-77 < z Initial program 54.9%
Taylor expanded in z around inf 76.6%
if -1.22e-27 < z < 4.99999999999999963e-77Initial program 81.5%
Taylor expanded in z around 0 54.4%
Taylor expanded in y around 0 73.7%
associate-/l*66.6%
Simplified66.6%
Taylor expanded in t around inf 68.3%
Final simplification73.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.5e-9) (not (<= z 1.15e-79))) (/ (- a) b) (+ x (* x z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.5e-9) || !(z <= 1.15e-79)) {
tmp = -a / b;
} else {
tmp = x + (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 <= (-9.5d-9)) .or. (.not. (z <= 1.15d-79))) then
tmp = -a / b
else
tmp = x + (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 <= -9.5e-9) || !(z <= 1.15e-79)) {
tmp = -a / b;
} else {
tmp = x + (x * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.5e-9) or not (z <= 1.15e-79): tmp = -a / b else: tmp = x + (x * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.5e-9) || !(z <= 1.15e-79)) tmp = Float64(Float64(-a) / b); else tmp = Float64(x + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -9.5e-9) || ~((z <= 1.15e-79))) tmp = -a / b; else tmp = x + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.5e-9], N[Not[LessEqual[z, 1.15e-79]], $MachinePrecision]], N[((-a) / b), $MachinePrecision], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-9} \lor \neg \left(z \leq 1.15 \cdot 10^{-79}\right):\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot z\\
\end{array}
\end{array}
if z < -9.5000000000000007e-9 or 1.15000000000000006e-79 < z Initial program 53.4%
Taylor expanded in y around 0 46.2%
Taylor expanded in t around 0 30.1%
neg-mul-130.1%
distribute-neg-frac30.1%
Simplified30.1%
if -9.5000000000000007e-9 < z < 1.15000000000000006e-79Initial program 81.2%
Taylor expanded in z around 0 52.2%
Taylor expanded in y around inf 56.2%
*-commutative56.2%
Simplified56.2%
Final simplification41.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.1e-8) (not (<= z 2.5e-77))) (/ t (- b y)) (+ x (* x z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.1e-8) || !(z <= 2.5e-77)) {
tmp = t / (b - y);
} else {
tmp = x + (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 <= (-4.1d-8)) .or. (.not. (z <= 2.5d-77))) then
tmp = t / (b - y)
else
tmp = x + (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 <= -4.1e-8) || !(z <= 2.5e-77)) {
tmp = t / (b - y);
} else {
tmp = x + (x * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.1e-8) or not (z <= 2.5e-77): tmp = t / (b - y) else: tmp = x + (x * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.1e-8) || !(z <= 2.5e-77)) tmp = Float64(t / Float64(b - y)); else tmp = Float64(x + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.1e-8) || ~((z <= 2.5e-77))) tmp = t / (b - y); else tmp = x + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.1e-8], N[Not[LessEqual[z, 2.5e-77]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{-8} \lor \neg \left(z \leq 2.5 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot z\\
\end{array}
\end{array}
if z < -4.10000000000000032e-8 or 2.49999999999999982e-77 < z Initial program 53.4%
Taylor expanded in t around inf 25.8%
*-commutative25.8%
Simplified25.8%
Taylor expanded in z around inf 39.2%
if -4.10000000000000032e-8 < z < 2.49999999999999982e-77Initial program 81.2%
Taylor expanded in z around 0 52.2%
Taylor expanded in y around inf 56.2%
*-commutative56.2%
Simplified56.2%
Final simplification46.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.56e+55) (not (<= z 5e-77))) (/ t (- b y)) (/ x (- 1.0 z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.56e+55) || !(z <= 5e-77)) {
tmp = t / (b - y);
} else {
tmp = x / (1.0 - 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.56d+55)) .or. (.not. (z <= 5d-77))) then
tmp = t / (b - y)
else
tmp = x / (1.0d0 - 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.56e+55) || !(z <= 5e-77)) {
tmp = t / (b - y);
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.56e+55) or not (z <= 5e-77): tmp = t / (b - y) else: tmp = x / (1.0 - z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.56e+55) || !(z <= 5e-77)) tmp = Float64(t / Float64(b - y)); else tmp = Float64(x / Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.56e+55) || ~((z <= 5e-77))) tmp = t / (b - y); else tmp = x / (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.56e+55], N[Not[LessEqual[z, 5e-77]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.56 \cdot 10^{+55} \lor \neg \left(z \leq 5 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - z}\\
\end{array}
\end{array}
if z < -1.5600000000000001e55 or 4.99999999999999963e-77 < z Initial program 47.7%
Taylor expanded in t around inf 26.2%
*-commutative26.2%
Simplified26.2%
Taylor expanded in z around inf 42.5%
if -1.5600000000000001e55 < z < 4.99999999999999963e-77Initial program 82.5%
Taylor expanded in y around inf 52.3%
mul-1-neg52.3%
unsub-neg52.3%
Simplified52.3%
Final simplification47.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.6e+74) (not (<= y 2.6e+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 <= -5.6e+74) || !(y <= 2.6e+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 <= (-5.6d+74)) .or. (.not. (y <= 2.6d+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 <= -5.6e+74) || !(y <= 2.6e+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 <= -5.6e+74) or not (y <= 2.6e+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 <= -5.6e+74) || !(y <= 2.6e+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 <= -5.6e+74) || ~((y <= 2.6e+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, -5.6e+74], N[Not[LessEqual[y, 2.6e+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 -5.6 \cdot 10^{+74} \lor \neg \left(y \leq 2.6 \cdot 10^{+45}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -5.60000000000000003e74 or 2.60000000000000007e45 < y Initial program 50.5%
Taylor expanded in y around inf 62.0%
mul-1-neg62.0%
unsub-neg62.0%
Simplified62.0%
if -5.60000000000000003e74 < y < 2.60000000000000007e45Initial program 78.3%
Taylor expanded in y around 0 52.7%
Final simplification56.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.2e-8) (not (<= z 5e-77))) (/ (- a) b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.2e-8) || !(z <= 5e-77)) {
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 <= (-3.2d-8)) .or. (.not. (z <= 5d-77))) 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 <= -3.2e-8) || !(z <= 5e-77)) {
tmp = -a / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.2e-8) or not (z <= 5e-77): tmp = -a / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.2e-8) || !(z <= 5e-77)) 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 <= -3.2e-8) || ~((z <= 5e-77))) tmp = -a / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.2e-8], N[Not[LessEqual[z, 5e-77]], $MachinePrecision]], N[((-a) / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-8} \lor \neg \left(z \leq 5 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.2000000000000002e-8 or 4.99999999999999963e-77 < z Initial program 53.4%
Taylor expanded in y around 0 46.2%
Taylor expanded in t around 0 30.1%
neg-mul-130.1%
distribute-neg-frac30.1%
Simplified30.1%
if -3.2000000000000002e-8 < z < 4.99999999999999963e-77Initial program 81.2%
Taylor expanded in z around 0 55.6%
Final simplification41.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.5e-9) (not (<= z 5e-77))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.5e-9) || !(z <= 5e-77)) {
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.5d-9)) .or. (.not. (z <= 5d-77))) 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.5e-9) || !(z <= 5e-77)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.5e-9) or not (z <= 5e-77): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.5e-9) || !(z <= 5e-77)) 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.5e-9) || ~((z <= 5e-77))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.5e-9], N[Not[LessEqual[z, 5e-77]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-9} \lor \neg \left(z \leq 5 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.49999999999999976e-9 or 4.99999999999999963e-77 < z Initial program 53.4%
Taylor expanded in t around inf 25.8%
*-commutative25.8%
Simplified25.8%
Taylor expanded in y around 0 22.5%
if -4.49999999999999976e-9 < z < 4.99999999999999963e-77Initial program 81.2%
Taylor expanded in z around 0 55.6%
Final simplification37.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 66.0%
Taylor expanded in z around 0 27.1%
Final simplification27.1%
(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 2024031
(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)))))