
(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
(-
(/ (- t a) (- b y))
(/
(fma (- y) (/ x (- b y)) (* (/ y (pow (- b y) 2.0)) (- t a)))
z))))
(if (<= z -35000000000000.0)
t_1
(if (<= z 21.0) (/ (+ (* y x) (* (- 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)) - (fma(-y, (x / (b - y)), ((y / pow((b - y), 2.0)) * (t - a))) / z);
double tmp;
if (z <= -35000000000000.0) {
tmp = t_1;
} else if (z <= 21.0) {
tmp = ((y * x) + ((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(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)) tmp = 0.0 if (z <= -35000000000000.0) tmp = t_1; elseif (z <= 21.0) tmp = Float64(Float64(Float64(y * x) + 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[(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]}, If[LessEqual[z, -35000000000000.0], t$95$1, If[LessEqual[z, 21.0], N[(N[(N[(y * x), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] * z), $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} - \frac{\mathsf{fma}\left(-y, \frac{x}{b - y}, \frac{y}{{\left(b - y\right)}^{2}} \cdot \left(t - a\right)\right)}{z}\\
\mathbf{if}\;z \leq -35000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 21:\\
\;\;\;\;\frac{y \cdot x + \left(t - a\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5e13 or 21 < z Initial program 43.6%
Taylor expanded in z around inf
Applied rewrites93.0%
if -3.5e13 < z < 21Initial program 85.4%
Final simplification89.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4e+85)
(- t_1 (/ (fma (- y) (/ x (- b y)) (/ (- t a) y)) z))
(if (<= z 2.25e+54)
(/ (+ (* y x) (* (- 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 <= -4e+85) {
tmp = t_1 - (fma(-y, (x / (b - y)), ((t - a) / y)) / z);
} else if (z <= 2.25e+54) {
tmp = ((y * x) + ((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 <= -4e+85) tmp = Float64(t_1 - Float64(fma(Float64(-y), Float64(x / Float64(b - y)), Float64(Float64(t - a) / y)) / z)); elseif (z <= 2.25e+54) tmp = Float64(Float64(Float64(y * x) + 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, -4e+85], N[(t$95$1 - N[(N[((-y) * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+54], N[(N[(N[(y * x), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] * z), $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 -4 \cdot 10^{+85}:\\
\;\;\;\;t\_1 - \frac{\mathsf{fma}\left(-y, \frac{x}{b - y}, \frac{t - a}{y}\right)}{z}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+54}:\\
\;\;\;\;\frac{y \cdot x + \left(t - a\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.0000000000000001e85Initial program 38.1%
Taylor expanded in z around inf
Applied rewrites93.7%
Taylor expanded in y around inf
Applied rewrites74.6%
if -4.0000000000000001e85 < z < 2.24999999999999992e54Initial program 83.1%
if 2.24999999999999992e54 < z Initial program 33.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6481.6
Applied rewrites81.6%
Final simplification81.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (/ (- t a) (- b y)))
(t_3 (* (/ y t_1) x)))
(if (<= z -45000000000000.0)
t_2
(if (<= z -4.2e-99)
(/ (* (- t a) z) t_1)
(if (<= z -3.95e-143)
t_3
(if (<= z 8.2e-289)
(/ (fma (- t a) z (* y x)) (* 1.0 y))
(if (<= z 1.8e-73)
t_3
(if (<= z 31500000000000.0) (* (/ z t_1) (- t a)) t_2))))))))
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) / (b - y);
double t_3 = (y / t_1) * x;
double tmp;
if (z <= -45000000000000.0) {
tmp = t_2;
} else if (z <= -4.2e-99) {
tmp = ((t - a) * z) / t_1;
} else if (z <= -3.95e-143) {
tmp = t_3;
} else if (z <= 8.2e-289) {
tmp = fma((t - a), z, (y * x)) / (1.0 * y);
} else if (z <= 1.8e-73) {
tmp = t_3;
} else if (z <= 31500000000000.0) {
tmp = (z / t_1) * (t - a);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = Float64(Float64(y / t_1) * x) tmp = 0.0 if (z <= -45000000000000.0) tmp = t_2; elseif (z <= -4.2e-99) tmp = Float64(Float64(Float64(t - a) * z) / t_1); elseif (z <= -3.95e-143) tmp = t_3; elseif (z <= 8.2e-289) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / Float64(1.0 * y)); elseif (z <= 1.8e-73) tmp = t_3; elseif (z <= 31500000000000.0) tmp = Float64(Float64(z / t_1) * Float64(t - a)); else tmp = t_2; 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -45000000000000.0], t$95$2, If[LessEqual[z, -4.2e-99], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, -3.95e-143], t$95$3, If[LessEqual[z, 8.2e-289], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-73], t$95$3, If[LessEqual[z, 31500000000000.0], N[(N[(z / t$95$1), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{t - a}{b - y}\\
t_3 := \frac{y}{t\_1} \cdot x\\
\mathbf{if}\;z \leq -45000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-99}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{t\_1}\\
\mathbf{elif}\;z \leq -3.95 \cdot 10^{-143}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-289}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{1 \cdot y}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-73}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 31500000000000:\\
\;\;\;\;\frac{z}{t\_1} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.5e13 or 3.15e13 < z Initial program 43.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6472.9
Applied rewrites72.9%
if -4.5e13 < z < -4.19999999999999968e-99Initial program 91.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.9
Applied rewrites79.9%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
Applied rewrites79.9%
if -4.19999999999999968e-99 < z < -3.95000000000000015e-143 or 8.1999999999999996e-289 < z < 1.8e-73Initial program 80.3%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6473.9
Applied rewrites73.9%
if -3.95000000000000015e-143 < z < 8.1999999999999996e-289Initial program 92.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
*-rgt-identityN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
distribute-lft-inN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6487.6
Applied rewrites87.6%
Taylor expanded in z around 0
Applied rewrites87.6%
if 1.8e-73 < z < 3.15e13Initial program 76.5%
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--.f6465.7
Applied rewrites65.7%
Final simplification75.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -1.5e-11)
t_2
(if (<= z 7.5e-193)
(/ (fma t z (* y x)) t_1)
(if (<= z 1.8e-73)
(* (/ y t_1) x)
(if (<= z 31500000000000.0) (* (/ z t_1) (- t a)) t_2))))))
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) / (b - y);
double tmp;
if (z <= -1.5e-11) {
tmp = t_2;
} else if (z <= 7.5e-193) {
tmp = fma(t, z, (y * x)) / t_1;
} else if (z <= 1.8e-73) {
tmp = (y / t_1) * x;
} else if (z <= 31500000000000.0) {
tmp = (z / t_1) * (t - a);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.5e-11) tmp = t_2; elseif (z <= 7.5e-193) tmp = Float64(fma(t, z, Float64(y * x)) / t_1); elseif (z <= 1.8e-73) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 31500000000000.0) tmp = Float64(Float64(z / t_1) * Float64(t - a)); else tmp = t_2; 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e-11], t$95$2, If[LessEqual[z, 7.5e-193], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 1.8e-73], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 31500000000000.0], N[(N[(z / t$95$1), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-11}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-193}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 31500000000000:\\
\;\;\;\;\frac{z}{t\_1} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.5e-11 or 3.15e13 < z Initial program 45.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6472.2
Applied rewrites72.2%
if -1.5e-11 < z < 7.4999999999999998e-193Initial program 91.5%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6481.6
Applied rewrites81.6%
if 7.4999999999999998e-193 < z < 1.8e-73Initial program 76.1%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6474.1
Applied rewrites74.1%
if 1.8e-73 < z < 3.15e13Initial program 76.5%
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--.f6465.7
Applied rewrites65.7%
Final simplification74.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -45000000000000.0)
t_2
(if (<= z -4.2e-99)
(/ (* (- t a) z) t_1)
(if (<= z 1.8e-73)
(* (/ y t_1) x)
(if (<= z 31500000000000.0) (* (/ z t_1) (- t a)) t_2))))))
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) / (b - y);
double tmp;
if (z <= -45000000000000.0) {
tmp = t_2;
} else if (z <= -4.2e-99) {
tmp = ((t - a) * z) / t_1;
} else if (z <= 1.8e-73) {
tmp = (y / t_1) * x;
} else if (z <= 31500000000000.0) {
tmp = (z / t_1) * (t - a);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -45000000000000.0) tmp = t_2; elseif (z <= -4.2e-99) tmp = Float64(Float64(Float64(t - a) * z) / t_1); elseif (z <= 1.8e-73) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 31500000000000.0) tmp = Float64(Float64(z / t_1) * Float64(t - a)); else tmp = t_2; 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -45000000000000.0], t$95$2, If[LessEqual[z, -4.2e-99], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 1.8e-73], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 31500000000000.0], N[(N[(z / t$95$1), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -45000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-99}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{t\_1}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 31500000000000:\\
\;\;\;\;\frac{z}{t\_1} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.5e13 or 3.15e13 < z Initial program 43.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6472.9
Applied rewrites72.9%
if -4.5e13 < z < -4.19999999999999968e-99Initial program 91.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.9
Applied rewrites79.9%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
Applied rewrites79.9%
if -4.19999999999999968e-99 < z < 1.8e-73Initial program 85.1%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6470.4
Applied rewrites70.4%
if 1.8e-73 < z < 3.15e13Initial program 76.5%
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--.f6465.7
Applied rewrites65.7%
Final simplification72.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (* (/ z t_1) (- t a)))
(t_3 (/ (- t a) (- b y))))
(if (<= z -1.3e+16)
t_3
(if (<= z -4.2e-99)
t_2
(if (<= z 1.8e-73)
(* (/ y t_1) x)
(if (<= z 31500000000000.0) t_2 t_3))))))
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 = (z / t_1) * (t - a);
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -1.3e+16) {
tmp = t_3;
} else if (z <= -4.2e-99) {
tmp = t_2;
} else if (z <= 1.8e-73) {
tmp = (y / t_1) * x;
} else if (z <= 31500000000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(z / t_1) * Float64(t - a)) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.3e+16) tmp = t_3; elseif (z <= -4.2e-99) tmp = t_2; elseif (z <= 1.8e-73) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 31500000000000.0) tmp = t_2; else tmp = t_3; 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[(z / t$95$1), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e+16], t$95$3, If[LessEqual[z, -4.2e-99], t$95$2, If[LessEqual[z, 1.8e-73], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 31500000000000.0], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{z}{t\_1} \cdot \left(t - a\right)\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+16}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 31500000000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -1.3e16 or 3.15e13 < z Initial program 43.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6474.2
Applied rewrites74.2%
if -1.3e16 < z < -4.19999999999999968e-99 or 1.8e-73 < z < 3.15e13Initial program 81.2%
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--.f6470.2
Applied rewrites70.2%
if -4.19999999999999968e-99 < z < 1.8e-73Initial program 85.1%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6470.4
Applied rewrites70.4%
Final simplification72.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -1.5e-11)
t_2
(if (<= z 4.2e-197)
(/ (fma t z (* y x)) t_1)
(if (<= z 2.4e+50) (/ (fma (- z) a (* y x)) t_1) t_2)))))
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) / (b - y);
double tmp;
if (z <= -1.5e-11) {
tmp = t_2;
} else if (z <= 4.2e-197) {
tmp = fma(t, z, (y * x)) / t_1;
} else if (z <= 2.4e+50) {
tmp = fma(-z, a, (y * x)) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.5e-11) tmp = t_2; elseif (z <= 4.2e-197) tmp = Float64(fma(t, z, Float64(y * x)) / t_1); elseif (z <= 2.4e+50) tmp = Float64(fma(Float64(-z), a, Float64(y * x)) / t_1); else tmp = t_2; 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e-11], t$95$2, If[LessEqual[z, 4.2e-197], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 2.4e+50], N[(N[((-z) * a + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-11}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-197}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+50}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-z, a, y \cdot x\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.5e-11 or 2.4000000000000002e50 < z Initial program 43.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.2
Applied rewrites73.2%
if -1.5e-11 < z < 4.2e-197Initial program 91.5%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6481.6
Applied rewrites81.6%
if 4.2e-197 < z < 2.4000000000000002e50Initial program 77.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6465.4
Applied rewrites65.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -6.8e+44)
t_1
(if (<= z 2.25e+54)
(/ (+ (* y x) (* (- 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 <= -6.8e+44) {
tmp = t_1;
} else if (z <= 2.25e+54) {
tmp = ((y * x) + ((t - a) * z)) / (((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 <= (-6.8d+44)) then
tmp = t_1
else if (z <= 2.25d+54) then
tmp = ((y * x) + ((t - a) * z)) / (((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 <= -6.8e+44) {
tmp = t_1;
} else if (z <= 2.25e+54) {
tmp = ((y * x) + ((t - a) * z)) / (((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 <= -6.8e+44: tmp = t_1 elif z <= 2.25e+54: tmp = ((y * x) + ((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 <= -6.8e+44) tmp = t_1; elseif (z <= 2.25e+54) tmp = Float64(Float64(Float64(y * x) + Float64(Float64(t - a) * z)) / 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 <= -6.8e+44) tmp = t_1; elseif (z <= 2.25e+54) tmp = ((y * x) + ((t - a) * z)) / (((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, -6.8e+44], t$95$1, If[LessEqual[z, 2.25e+54], N[(N[(N[(y * x), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] * z), $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 -6.8 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+54}:\\
\;\;\;\;\frac{y \cdot x + \left(t - a\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.8e44 or 2.24999999999999992e54 < z Initial program 37.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6474.9
Applied rewrites74.9%
if -6.8e44 < z < 2.24999999999999992e54Initial program 84.5%
Final simplification80.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -5.1e-99)
t_1
(if (<= z 1.15e+21) (* (/ y (fma (- b y) z y)) 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 <= -5.1e-99) {
tmp = t_1;
} else if (z <= 1.15e+21) {
tmp = (y / fma((b - y), z, y)) * 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 <= -5.1e-99) tmp = t_1; elseif (z <= 1.15e+21) tmp = Float64(Float64(y / fma(Float64(b - y), z, y)) * 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, -5.1e-99], t$95$1, If[LessEqual[z, 1.15e+21], N[(N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5.1 \cdot 10^{-99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+21}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.0999999999999999e-99 or 1.15e21 < z Initial program 51.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6470.6
Applied rewrites70.6%
if -5.0999999999999999e-99 < z < 1.15e21Initial program 82.9%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6464.8
Applied rewrites64.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -650000.0)
(/ x (- z))
(if (<= z -5.8e-126)
(/ t b)
(if (<= z 2.8e-8) (fma (fma x z x) z x) (/ t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -650000.0) {
tmp = x / -z;
} else if (z <= -5.8e-126) {
tmp = t / b;
} else if (z <= 2.8e-8) {
tmp = fma(fma(x, z, x), z, x);
} else {
tmp = t / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -650000.0) tmp = Float64(x / Float64(-z)); elseif (z <= -5.8e-126) tmp = Float64(t / b); elseif (z <= 2.8e-8) tmp = fma(fma(x, z, x), z, x); else tmp = Float64(t / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -650000.0], N[(x / (-z)), $MachinePrecision], If[LessEqual[z, -5.8e-126], N[(t / b), $MachinePrecision], If[LessEqual[z, 2.8e-8], N[(N[(x * z + x), $MachinePrecision] * z + x), $MachinePrecision], N[(t / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -650000:\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-126}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, z, x\right), z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -6.5e5Initial program 47.4%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6428.3
Applied rewrites28.3%
Taylor expanded in z around inf
Applied rewrites27.5%
if -6.5e5 < z < -5.79999999999999975e-126 or 2.7999999999999999e-8 < z Initial program 56.4%
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--.f6439.9
Applied rewrites39.9%
Taylor expanded in y around 0
Applied rewrites27.5%
if -5.79999999999999975e-126 < z < 2.7999999999999999e-8Initial program 84.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6453.6
Applied rewrites53.6%
Taylor expanded in z around 0
Applied rewrites53.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -3.3e-128) t_1 (if (<= z 8e-46) (/ x 1.0) 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 <= -3.3e-128) {
tmp = t_1;
} else if (z <= 8e-46) {
tmp = x / 1.0;
} 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 <= (-3.3d-128)) then
tmp = t_1
else if (z <= 8d-46) then
tmp = x / 1.0d0
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 <= -3.3e-128) {
tmp = t_1;
} else if (z <= 8e-46) {
tmp = x / 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -3.3e-128: tmp = t_1 elif z <= 8e-46: tmp = x / 1.0 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 <= -3.3e-128) tmp = t_1; elseif (z <= 8e-46) tmp = Float64(x / 1.0); 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 <= -3.3e-128) tmp = t_1; elseif (z <= 8e-46) tmp = x / 1.0; 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, -3.3e-128], t$95$1, If[LessEqual[z, 8e-46], N[(x / 1.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.3e-128 or 8.00000000000000018e-46 < z Initial program 53.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6466.5
Applied rewrites66.5%
if -3.3e-128 < z < 8.00000000000000018e-46Initial program 84.1%
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 z around 0
Applied rewrites56.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -1.15e+85) t_1 (if (<= y 7.8e-22) (/ (- 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.15e+85) {
tmp = t_1;
} else if (y <= 7.8e-22) {
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.15d+85)) then
tmp = t_1
else if (y <= 7.8d-22) 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.15e+85) {
tmp = t_1;
} else if (y <= 7.8e-22) {
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.15e+85: tmp = t_1 elif y <= 7.8e-22: 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.15e+85) tmp = t_1; elseif (y <= 7.8e-22) 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.15e+85) tmp = t_1; elseif (y <= 7.8e-22) 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.15e+85], t$95$1, If[LessEqual[y, 7.8e-22], 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.15 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-22}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.1499999999999999e85 or 7.79999999999999996e-22 < y Initial program 50.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6459.6
Applied rewrites59.6%
if -1.1499999999999999e85 < y < 7.79999999999999996e-22Initial program 80.2%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6452.4
Applied rewrites52.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -3e+35) t_1 (if (<= y 5.2e-17) (/ t (- b y)) 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 <= -3e+35) {
tmp = t_1;
} else if (y <= 5.2e-17) {
tmp = t / (b - 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 = x / (1.0d0 - z)
if (y <= (-3d+35)) then
tmp = t_1
else if (y <= 5.2d-17) then
tmp = t / (b - 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 = x / (1.0 - z);
double tmp;
if (y <= -3e+35) {
tmp = t_1;
} else if (y <= 5.2e-17) {
tmp = t / (b - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -3e+35: tmp = t_1 elif y <= 5.2e-17: tmp = t / (b - y) 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 <= -3e+35) tmp = t_1; elseif (y <= 5.2e-17) tmp = Float64(t / Float64(b - y)); 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 <= -3e+35) tmp = t_1; elseif (y <= 5.2e-17) tmp = t / (b - y); 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, -3e+35], t$95$1, If[LessEqual[y, 5.2e-17], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -3 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-17}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.99999999999999991e35 or 5.20000000000000006e-17 < y Initial program 51.7%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6457.8
Applied rewrites57.8%
if -2.99999999999999991e35 < y < 5.20000000000000006e-17Initial program 80.1%
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--.f6440.7
Applied rewrites40.7%
Taylor expanded in z around inf
Applied rewrites36.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -5.6e-126) t_1 (if (<= z 0.0135) (fma (fma x z 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 <= -5.6e-126) {
tmp = t_1;
} else if (z <= 0.0135) {
tmp = fma(fma(x, z, 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 <= -5.6e-126) tmp = t_1; elseif (z <= 0.0135) tmp = fma(fma(x, z, 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, -5.6e-126], t$95$1, If[LessEqual[z, 0.0135], N[(N[(x * z + x), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.0135:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, z, x\right), z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.59999999999999983e-126 or 0.0134999999999999998 < z Initial program 52.0%
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--.f6432.3
Applied rewrites32.3%
Taylor expanded in z around inf
Applied rewrites36.9%
if -5.59999999999999983e-126 < z < 0.0134999999999999998Initial program 84.4%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6453.1
Applied rewrites53.1%
Taylor expanded in z around 0
Applied rewrites53.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5.8e-126) (/ t b) (if (<= z 2.8e-8) (fma (fma x z x) z x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.8e-126) {
tmp = t / b;
} else if (z <= 2.8e-8) {
tmp = fma(fma(x, z, x), z, x);
} else {
tmp = t / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.8e-126) tmp = Float64(t / b); elseif (z <= 2.8e-8) tmp = fma(fma(x, z, x), z, x); else tmp = Float64(t / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.8e-126], N[(t / b), $MachinePrecision], If[LessEqual[z, 2.8e-8], N[(N[(x * z + x), $MachinePrecision] * z + x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-126}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, z, x\right), z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -5.79999999999999975e-126 or 2.7999999999999999e-8 < z Initial program 52.3%
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--.f6432.2
Applied rewrites32.2%
Taylor expanded in y around 0
Applied rewrites24.6%
if -5.79999999999999975e-126 < z < 2.7999999999999999e-8Initial program 84.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6453.6
Applied rewrites53.6%
Taylor expanded in z around 0
Applied rewrites53.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5.8e-126) (/ t b) (if (<= z 2.4e-8) (fma x z x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.8e-126) {
tmp = t / b;
} else if (z <= 2.4e-8) {
tmp = fma(x, z, x);
} else {
tmp = t / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.8e-126) tmp = Float64(t / b); elseif (z <= 2.4e-8) tmp = fma(x, z, x); else tmp = Float64(t / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.8e-126], N[(t / b), $MachinePrecision], If[LessEqual[z, 2.4e-8], N[(x * z + x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-126}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -5.79999999999999975e-126 or 2.39999999999999998e-8 < z Initial program 52.3%
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--.f6432.2
Applied rewrites32.2%
Taylor expanded in y around 0
Applied rewrites24.6%
if -5.79999999999999975e-126 < z < 2.39999999999999998e-8Initial program 84.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6453.6
Applied rewrites53.6%
Taylor expanded in z around 0
Applied rewrites53.6%
(FPCore (x y z t a b) :precision binary64 (fma x z x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(x, z, x);
}
function code(x, y, z, t, a, b) return fma(x, z, x) end
code[x_, y_, z_, t_, a_, b_] := N[(x * z + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, z, x\right)
\end{array}
Initial program 65.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6436.3
Applied rewrites36.3%
Taylor expanded in z around 0
Applied rewrites25.3%
(FPCore (x y z t a b) :precision binary64 (* x z))
double code(double x, double y, double z, double t, double a, double b) {
return x * 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 = x * z
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * z;
}
def code(x, y, z, t, a, b): return x * z
function code(x, y, z, t, a, b) return Float64(x * z) end
function tmp = code(x, y, z, t, a, b) tmp = x * z; end
code[x_, y_, z_, t_, a_, b_] := N[(x * z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot z
\end{array}
Initial program 65.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6436.3
Applied rewrites36.3%
Taylor expanded in z around 0
Applied rewrites25.3%
Taylor expanded in z around inf
Applied rewrites3.7%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024294
(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)))))