
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(-
(fma (/ x z) (/ y (- b y)) (/ t (- b y)))
(fma (/ y z) (/ (- t a) (pow (- b y) 2.0)) (/ a (- b y)))))
(t_2 (fma (- b y) z y))
(t_3 (/ (+ (* (- t a) z) (* y x)) (+ (* (- b y) z) y)))
(t_4 (* (fma (/ z x) (/ (- t a) t_2) (/ y t_2)) x)))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 -5e-260)
t_3
(if (<= t_3 0.0)
t_1
(if (<= t_3 5e+254) t_3 (if (<= t_3 INFINITY) t_4 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((x / z), (y / (b - y)), (t / (b - y))) - fma((y / z), ((t - a) / pow((b - y), 2.0)), (a / (b - y)));
double t_2 = fma((b - y), z, y);
double t_3 = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
double t_4 = fma((z / x), ((t - a) / t_2), (y / t_2)) * x;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= -5e-260) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = t_1;
} else if (t_3 <= 5e+254) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(x / z), Float64(y / Float64(b - y)), Float64(t / Float64(b - y))) - fma(Float64(y / z), Float64(Float64(t - a) / (Float64(b - y) ^ 2.0)), Float64(a / Float64(b - y)))) t_2 = fma(Float64(b - y), z, y) t_3 = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)) t_4 = Float64(fma(Float64(z / x), Float64(Float64(t - a) / t_2), Float64(y / t_2)) * x) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= -5e-260) tmp = t_3; elseif (t_3 <= 0.0) tmp = t_1; elseif (t_3 <= 5e+254) tmp = t_3; elseif (t_3 <= Inf) tmp = t_4; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y / z), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(z / x), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, -5e-260], t$95$3, If[LessEqual[t$95$3, 0.0], t$95$1, If[LessEqual[t$95$3, 5e+254], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{z}, \frac{y}{b - y}, \frac{t}{b - y}\right) - \mathsf{fma}\left(\frac{y}{z}, \frac{t - a}{{\left(b - y\right)}^{2}}, \frac{a}{b - y}\right)\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
t_3 := \frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
t_4 := \mathsf{fma}\left(\frac{z}{x}, \frac{t - a}{t\_2}, \frac{y}{t\_2}\right) \cdot x\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-260}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+254}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 4.99999999999999994e254 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 28.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6444.7
Applied rewrites44.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.5%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.0000000000000003e-260 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.99999999999999994e254Initial program 99.7%
if -5.0000000000000003e-260 < (/.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 8.7%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6423.2
Applied rewrites23.2%
Taylor expanded in z around inf
lower--.f64N/A
+-commutativeN/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites100.0%
Final simplification98.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(-
(/ (- t a) (- b y))
(/ (fma (- y) (/ x (- b y)) (* (/ y (pow (- b y) 2.0)) (- t a))) z)))
(t_2 (fma (- b y) z y))
(t_3 (/ (+ (* (- t a) z) (* y x)) (+ (* (- b y) z) y)))
(t_4 (* (fma (/ z x) (/ (- t a) t_2) (/ y t_2)) x)))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 -5e-260)
t_3
(if (<= t_3 0.0)
t_1
(if (<= t_3 5e+254) t_3 (if (<= t_3 INFINITY) t_4 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - a) / (b - y)) - (fma(-y, (x / (b - y)), ((y / pow((b - y), 2.0)) * (t - a))) / z);
double t_2 = fma((b - y), z, y);
double t_3 = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
double t_4 = fma((z / x), ((t - a) / t_2), (y / t_2)) * x;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= -5e-260) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = t_1;
} else if (t_3 <= 5e+254) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(fma(Float64(-y), Float64(x / Float64(b - y)), Float64(Float64(y / (Float64(b - y) ^ 2.0)) * Float64(t - a))) / z)) t_2 = fma(Float64(b - y), z, y) t_3 = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)) t_4 = Float64(fma(Float64(z / x), Float64(Float64(t - a) / t_2), Float64(y / t_2)) * x) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= -5e-260) tmp = t_3; elseif (t_3 <= 0.0) tmp = t_1; elseif (t_3 <= 5e+254) tmp = t_3; elseif (t_3 <= Inf) tmp = t_4; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(N[((-y) * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(z / x), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, -5e-260], t$95$3, If[LessEqual[t$95$3, 0.0], t$95$1, If[LessEqual[t$95$3, 5e+254], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y} - \frac{\mathsf{fma}\left(-y, \frac{x}{b - y}, \frac{y}{{\left(b - y\right)}^{2}} \cdot \left(t - a\right)\right)}{z}\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
t_3 := \frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
t_4 := \mathsf{fma}\left(\frac{z}{x}, \frac{t - a}{t\_2}, \frac{y}{t\_2}\right) \cdot x\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-260}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+254}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 4.99999999999999994e254 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 28.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6444.7
Applied rewrites44.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.5%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.0000000000000003e-260 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.99999999999999994e254Initial program 99.7%
if -5.0000000000000003e-260 < (/.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 8.7%
Taylor expanded in z around inf
Applied rewrites99.8%
Final simplification98.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (+ (* (- t a) z) (* y x)) (+ (* (- b y) z) y)))
(t_3 (* (fma (/ z x) (/ (- t a) t_1) (/ y t_1)) x)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 5e+254) t_2 (if (<= t_2 INFINITY) t_3 (/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - y), z, y);
double t_2 = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
double t_3 = fma((z / x), ((t - a) / t_1), (y / t_1)) * x;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 5e+254) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)) t_3 = Float64(fma(Float64(z / x), Float64(Float64(t - a) / t_1), Float64(y / t_1)) * x) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 5e+254) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(z / x), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 5e+254], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
t_3 := \mathsf{fma}\left(\frac{z}{x}, \frac{t - a}{t\_1}, \frac{y}{t\_1}\right) \cdot x\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+254}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 4.99999999999999994e254 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 28.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6444.7
Applied rewrites44.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.5%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.99999999999999994e254Initial program 93.7%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 0.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6472.5
Applied rewrites72.5%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* (- t a) z) (* y x)) (+ (* (- b y) z) y))))
(if (<= t_1 (- INFINITY))
(* (fma (/ z x) (/ (- t a) (fma (- b y) z y)) 1.0) x)
(if (<= t_1 5e+277) t_1 (/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma((z / x), ((t - a) / fma((b - y), z, y)), 1.0) * x;
} else if (t_1 <= 5e+277) {
tmp = t_1;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(Float64(z / x), Float64(Float64(t - a) / fma(Float64(b - y), z, y)), 1.0) * x); elseif (t_1 <= 5e+277) tmp = t_1; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(z / x), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 5e+277], t$95$1, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{x}, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, 1\right) \cdot x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+277}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 28.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6456.1
Applied rewrites56.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites95.1%
Taylor expanded in z around 0
Applied rewrites80.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.99999999999999982e277Initial program 93.7%
if 4.99999999999999982e277 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 9.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6469.5
Applied rewrites69.5%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.2e+25)
t_1
(if (<= z 1.1e+61)
(/ (+ (* (- t a) z) (* y x)) (+ (* (- b y) z) y))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.2e+25) {
tmp = t_1;
} else if (z <= 1.1e+61) {
tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-2.2d+25)) then
tmp = t_1
else if (z <= 1.1d+61) then
tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.2e+25) {
tmp = t_1;
} else if (z <= 1.1e+61) {
tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -2.2e+25: tmp = t_1 elif z <= 1.1e+61: tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.2e+25) tmp = t_1; elseif (z <= 1.1e+61) tmp = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -2.2e+25) tmp = t_1; elseif (z <= 1.1e+61) tmp = (((t - a) * z) + (y * x)) / (((b - y) * z) + y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+25], t$95$1, If[LessEqual[z, 1.1e+61], N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+61}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.2000000000000001e25 or 1.1e61 < z Initial program 34.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.0
Applied rewrites83.0%
if -2.2000000000000001e25 < z < 1.1e61Initial program 88.4%
Final simplification86.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4.6e-20)
t_1
(if (<= z 1.02e-125)
(fma (/ z y) (- t a) (/ x (- 1.0 z)))
(if (<= z 78000000000.0) (/ (* (- t a) z) (+ (* (- b y) z) y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4.6e-20) {
tmp = t_1;
} else if (z <= 1.02e-125) {
tmp = fma((z / y), (t - a), (x / (1.0 - z)));
} else if (z <= 78000000000.0) {
tmp = ((t - a) * z) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.6e-20) tmp = t_1; elseif (z <= 1.02e-125) tmp = fma(Float64(z / y), Float64(t - a), Float64(x / Float64(1.0 - z))); elseif (z <= 78000000000.0) tmp = Float64(Float64(Float64(t - a) * z) / Float64(Float64(Float64(b - y) * z) + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e-20], t$95$1, If[LessEqual[z, 1.02e-125], N[(N[(z / y), $MachinePrecision] * N[(t - a), $MachinePrecision] + N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 78000000000.0], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-125}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{y}, t - a, \frac{x}{1 - z}\right)\\
\mathbf{elif}\;z \leq 78000000000:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.5999999999999998e-20 or 7.8e10 < z Initial program 45.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.9
Applied rewrites78.9%
if -4.5999999999999998e-20 < z < 1.02e-125Initial program 86.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6462.8
Applied rewrites62.8%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6467.9
Applied rewrites67.9%
Taylor expanded in y around inf
Applied rewrites78.1%
Taylor expanded in z around 0
Applied rewrites78.1%
if 1.02e-125 < z < 7.8e10Initial program 92.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.2
Applied rewrites77.2%
Final simplification78.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4.6e-20)
t_1
(if (<= z 2.02e-100)
(fma (+ (/ (- t a) y) x) z x)
(if (<= z 78000000000.0) (/ (* (- t a) z) (+ (* (- b y) z) y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4.6e-20) {
tmp = t_1;
} else if (z <= 2.02e-100) {
tmp = fma((((t - a) / y) + x), z, x);
} else if (z <= 78000000000.0) {
tmp = ((t - a) * z) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.6e-20) tmp = t_1; elseif (z <= 2.02e-100) tmp = fma(Float64(Float64(Float64(t - a) / y) + x), z, x); elseif (z <= 78000000000.0) tmp = Float64(Float64(Float64(t - a) * z) / Float64(Float64(Float64(b - y) * z) + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e-20], t$95$1, If[LessEqual[z, 2.02e-100], N[(N[(N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[z, 78000000000.0], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.02 \cdot 10^{-100}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - a}{y} + x, z, x\right)\\
\mathbf{elif}\;z \leq 78000000000:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.5999999999999998e-20 or 7.8e10 < z Initial program 45.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.9
Applied rewrites78.9%
if -4.5999999999999998e-20 < z < 2.02000000000000005e-100Initial program 86.1%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6461.1
Applied rewrites61.1%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6467.7
Applied rewrites67.7%
Taylor expanded in y around inf
Applied rewrites77.5%
Taylor expanded in z around 0
Applied rewrites73.0%
if 2.02000000000000005e-100 < z < 7.8e10Initial program 94.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.5
Applied rewrites76.5%
Final simplification76.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4.2e-92)
t_1
(if (<= z 1e-125)
(fma z x x)
(if (<= z 1.1e-62) (/ (* (- t a) z) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4.2e-92) {
tmp = t_1;
} else if (z <= 1e-125) {
tmp = fma(z, x, x);
} else if (z <= 1.1e-62) {
tmp = ((t - a) * z) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.2e-92) tmp = t_1; elseif (z <= 1e-125) tmp = fma(z, x, x); elseif (z <= 1.1e-62) tmp = Float64(Float64(Float64(t - a) * z) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e-92], t$95$1, If[LessEqual[z, 1e-125], N[(z * x + x), $MachinePrecision], If[LessEqual[z, 1.1e-62], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-125}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.2e-92 or 1.10000000000000009e-62 < z Initial program 53.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6472.2
Applied rewrites72.2%
if -4.2e-92 < z < 1.00000000000000001e-125Initial program 85.7%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6466.1
Applied rewrites66.1%
Taylor expanded in z around 0
Applied rewrites66.1%
if 1.00000000000000001e-125 < z < 1.10000000000000009e-62Initial program 91.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6468.6
Applied rewrites68.6%
Taylor expanded in z around 0
Applied rewrites63.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4.6e-20)
t_1
(if (<= z 1.8e-9) (fma (+ (/ (- t a) y) x) z x) 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 <= -4.6e-20) {
tmp = t_1;
} else if (z <= 1.8e-9) {
tmp = fma((((t - a) / y) + x), z, x);
} 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 <= -4.6e-20) tmp = t_1; elseif (z <= 1.8e-9) tmp = fma(Float64(Float64(Float64(t - a) / y) + x), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e-20], t$95$1, If[LessEqual[z, 1.8e-9], N[(N[(N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - a}{y} + x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.5999999999999998e-20 or 1.8e-9 < z Initial program 47.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.8
Applied rewrites77.8%
if -4.5999999999999998e-20 < z < 1.8e-9Initial program 87.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6456.3
Applied rewrites56.3%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6466.1
Applied rewrites66.1%
Taylor expanded in y around inf
Applied rewrites74.7%
Taylor expanded in z around 0
Applied rewrites71.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -9.2e+67)
t_1
(if (<= z 7.8e+53)
(/ x (- 1.0 z))
(if (<= z 3.2e+157) (/ (- a t) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -9.2e+67) {
tmp = t_1;
} else if (z <= 7.8e+53) {
tmp = x / (1.0 - z);
} else if (z <= 3.2e+157) {
tmp = (a - t) / y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t / (b - y)
if (z <= (-9.2d+67)) then
tmp = t_1
else if (z <= 7.8d+53) then
tmp = x / (1.0d0 - z)
else if (z <= 3.2d+157) then
tmp = (a - t) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -9.2e+67) {
tmp = t_1;
} else if (z <= 7.8e+53) {
tmp = x / (1.0 - z);
} else if (z <= 3.2e+157) {
tmp = (a - t) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -9.2e+67: tmp = t_1 elif z <= 7.8e+53: tmp = x / (1.0 - z) elif z <= 3.2e+157: tmp = (a - t) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -9.2e+67) tmp = t_1; elseif (z <= 7.8e+53) tmp = Float64(x / Float64(1.0 - z)); elseif (z <= 3.2e+157) tmp = Float64(Float64(a - t) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -9.2e+67) tmp = t_1; elseif (z <= 7.8e+53) tmp = x / (1.0 - z); elseif (z <= 3.2e+157) tmp = (a - t) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+67], t$95$1, If[LessEqual[z, 7.8e+53], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+157], N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+53}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{a - t}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.1999999999999994e67 or 3.1999999999999999e157 < z Initial program 33.8%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6427.7
Applied rewrites27.7%
Taylor expanded in z around inf
Applied rewrites51.0%
if -9.1999999999999994e67 < z < 7.79999999999999952e53Initial program 85.6%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6452.8
Applied rewrites52.8%
if 7.79999999999999952e53 < z < 3.1999999999999999e157Initial program 64.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f645.5
Applied rewrites5.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6446.3
Applied rewrites46.3%
Taylor expanded in y around inf
Applied rewrites64.1%
Taylor expanded in z around inf
Applied rewrites56.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -4.2e-92) t_1 (if (<= z 2.02e-100) (* 1.0 x) 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 <= -4.2e-92) {
tmp = t_1;
} else if (z <= 2.02e-100) {
tmp = 1.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-4.2d-92)) then
tmp = t_1
else if (z <= 2.02d-100) then
tmp = 1.0d0 * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4.2e-92) {
tmp = t_1;
} else if (z <= 2.02e-100) {
tmp = 1.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -4.2e-92: tmp = t_1 elif z <= 2.02e-100: tmp = 1.0 * x 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 <= -4.2e-92) tmp = t_1; elseif (z <= 2.02e-100) tmp = Float64(1.0 * x); 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 <= -4.2e-92) tmp = t_1; elseif (z <= 2.02e-100) tmp = 1.0 * x; 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, -4.2e-92], t$95$1, If[LessEqual[z, 2.02e-100], N[(1.0 * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.02 \cdot 10^{-100}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.2e-92 or 2.02000000000000005e-100 < z Initial program 55.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6469.8
Applied rewrites69.8%
if -4.2e-92 < z < 2.02000000000000005e-100Initial program 85.4%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6464.0
Applied rewrites64.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.7%
Taylor expanded in z around 0
Applied rewrites64.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -1.45e-95) t_1 (if (<= y 2.6e-43) (/ (- t a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.45e-95) {
tmp = t_1;
} else if (y <= 2.6e-43) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-1.45d-95)) then
tmp = t_1
else if (y <= 2.6d-43) then
tmp = (t - a) / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.45e-95) {
tmp = t_1;
} else if (y <= 2.6e-43) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -1.45e-95: tmp = t_1 elif y <= 2.6e-43: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -1.45e-95) tmp = t_1; elseif (y <= 2.6e-43) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -1.45e-95) tmp = t_1; elseif (y <= 2.6e-43) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.45e-95], t$95$1, If[LessEqual[y, 2.6e-43], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{-95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-43}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.45000000000000001e-95 or 2.6e-43 < y Initial program 59.9%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6450.0
Applied rewrites50.0%
if -1.45000000000000001e-95 < y < 2.6e-43Initial program 81.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6462.1
Applied rewrites62.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -2.1e-30) t_1 (if (<= z 8.6e-17) (fma (fma z x x) z x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -2.1e-30) {
tmp = t_1;
} else if (z <= 8.6e-17) {
tmp = fma(fma(z, x, x), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -2.1e-30) tmp = t_1; elseif (z <= 8.6e-17) tmp = fma(fma(z, x, x), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e-30], t$95$1, If[LessEqual[z, 8.6e-17], N[(N[(z * x + x), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, x, x\right), z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.1000000000000002e-30 or 8.60000000000000046e-17 < z Initial program 48.8%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6425.8
Applied rewrites25.8%
Taylor expanded in z around inf
Applied rewrites40.9%
if -2.1000000000000002e-30 < z < 8.60000000000000046e-17Initial program 87.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6458.0
Applied rewrites58.0%
Taylor expanded in z around 0
Applied rewrites58.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.1e-30) (/ t b) (if (<= z 8.6e-17) (fma (fma z x x) z x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-30) {
tmp = t / b;
} else if (z <= 8.6e-17) {
tmp = fma(fma(z, x, x), z, x);
} else {
tmp = t / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.1e-30) tmp = Float64(t / b); elseif (z <= 8.6e-17) tmp = fma(fma(z, x, x), z, x); else tmp = Float64(t / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.1e-30], N[(t / b), $MachinePrecision], If[LessEqual[z, 8.6e-17], N[(N[(z * x + x), $MachinePrecision] * z + x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-30}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, x, x\right), z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -2.1000000000000002e-30 or 8.60000000000000046e-17 < z Initial program 48.8%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6425.8
Applied rewrites25.8%
Taylor expanded in b around inf
Applied rewrites28.0%
if -2.1000000000000002e-30 < z < 8.60000000000000046e-17Initial program 87.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6458.0
Applied rewrites58.0%
Taylor expanded in z around 0
Applied rewrites58.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.1e-30) (/ t b) (if (<= z 8.6e-17) (* 1.0 x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-30) {
tmp = t / b;
} else if (z <= 8.6e-17) {
tmp = 1.0 * x;
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.1d-30)) then
tmp = t / b
else if (z <= 8.6d-17) then
tmp = 1.0d0 * x
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-30) {
tmp = t / b;
} else if (z <= 8.6e-17) {
tmp = 1.0 * x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.1e-30: tmp = t / b elif z <= 8.6e-17: tmp = 1.0 * x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.1e-30) tmp = Float64(t / b); elseif (z <= 8.6e-17) tmp = Float64(1.0 * x); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.1e-30) tmp = t / b; elseif (z <= 8.6e-17) tmp = 1.0 * x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.1e-30], N[(t / b), $MachinePrecision], If[LessEqual[z, 8.6e-17], N[(1.0 * x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-30}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-17}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -2.1000000000000002e-30 or 8.60000000000000046e-17 < z Initial program 48.8%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6425.8
Applied rewrites25.8%
Taylor expanded in b around inf
Applied rewrites28.0%
if -2.1000000000000002e-30 < z < 8.60000000000000046e-17Initial program 87.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6458.0
Applied rewrites58.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.5%
Taylor expanded in z around 0
Applied rewrites58.0%
(FPCore (x y z t a b) :precision binary64 (fma z x x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(z, x, x);
}
function code(x, y, z, t, a, b) return fma(z, x, x) end
code[x_, y_, z_, t_, a_, b_] := N[(z * x + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, x, x\right)
\end{array}
Initial program 67.7%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6438.6
Applied rewrites38.6%
Taylor expanded in z around 0
Applied rewrites30.9%
(FPCore (x y z t a b) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * x;
}
def code(x, y, z, t, a, b): return 1.0 * x
function code(x, y, z, t, a, b) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a, b) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_, b_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 67.7%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6438.6
Applied rewrites38.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.0%
Taylor expanded in z around 0
Applied rewrites30.8%
(FPCore (x y z t a b) :precision binary64 (* z x))
double code(double x, double y, double z, double t, double a, double b) {
return z * 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 = z * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z * x;
}
def code(x, y, z, t, a, b): return z * x
function code(x, y, z, t, a, b) return Float64(z * x) end
function tmp = code(x, y, z, t, a, b) tmp = z * x; end
code[x_, y_, z_, t_, a_, b_] := N[(z * x), $MachinePrecision]
\begin{array}{l}
\\
z \cdot x
\end{array}
Initial program 67.7%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6438.6
Applied rewrites38.6%
Taylor expanded in z around 0
Applied rewrites30.9%
Taylor expanded in z around inf
Applied rewrites3.2%
(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 2024277
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))