
(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 16 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 -7.8e+40)
t_1
(if (<= z 1.05e+42)
(/ (+ (* (- 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)) - (fma(-y, (x / (b - y)), ((y / pow((b - y), 2.0)) * (t - a))) / z);
double tmp;
if (z <= -7.8e+40) {
tmp = t_1;
} else if (z <= 1.05e+42) {
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(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 <= -7.8e+40) tmp = t_1; elseif (z <= 1.05e+42) 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
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, -7.8e+40], t$95$1, If[LessEqual[z, 1.05e+42], 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} - \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 -7.8 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+42}:\\
\;\;\;\;\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 < -7.8000000000000002e40 or 1.04999999999999998e42 < z Initial program 39.1%
Taylor expanded in z around inf
Applied rewrites93.0%
if -7.8000000000000002e40 < z < 1.04999999999999998e42Initial program 90.2%
Final simplification91.5%
(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.26e+41)
t_3
(if (<= z -3.8e-143)
t_2
(if (<= z 5e-183)
(* (/ y t_1) x)
(if (<= z 54000000000000.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.26e+41) {
tmp = t_3;
} else if (z <= -3.8e-143) {
tmp = t_2;
} else if (z <= 5e-183) {
tmp = (y / t_1) * x;
} else if (z <= 54000000000000.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.26e+41) tmp = t_3; elseif (z <= -3.8e-143) tmp = t_2; elseif (z <= 5e-183) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 54000000000000.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.26e+41], t$95$3, If[LessEqual[z, -3.8e-143], t$95$2, If[LessEqual[z, 5e-183], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 54000000000000.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.26 \cdot 10^{+41}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-143}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-183}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 54000000000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -1.26000000000000001e41 or 5.4e13 < z Initial program 41.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.6
Applied rewrites83.6%
if -1.26000000000000001e41 < z < -3.79999999999999981e-143 or 5.0000000000000002e-183 < z < 5.4e13Initial program 91.6%
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%
if -3.79999999999999981e-143 < z < 5.0000000000000002e-183Initial program 88.0%
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.9
Applied rewrites64.9%
Final simplification74.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (- t a) (fma z (- b y) y)) z)) (t_2 (/ (- t a) (- b y))))
(if (<= z -2.15e+15)
t_2
(if (<= z -3.8e-143)
t_1
(if (<= z 4e-129)
(* (/ y (fma (- b y) z y)) x)
(if (<= z 54000000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - a) / fma(z, (b - y), y)) * z;
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -2.15e+15) {
tmp = t_2;
} else if (z <= -3.8e-143) {
tmp = t_1;
} else if (z <= 4e-129) {
tmp = (y / fma((b - y), z, y)) * x;
} else if (z <= 54000000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - a) / fma(z, Float64(b - y), y)) * z) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.15e+15) tmp = t_2; elseif (z <= -3.8e-143) tmp = t_1; elseif (z <= 4e-129) tmp = Float64(Float64(y / fma(Float64(b - y), z, y)) * x); elseif (z <= 54000000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - a), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.15e+15], t$95$2, If[LessEqual[z, -3.8e-143], t$95$1, If[LessEqual[z, 4e-129], N[(N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 54000000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{\mathsf{fma}\left(z, b - y, y\right)} \cdot z\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-129}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{elif}\;z \leq 54000000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.15e15 or 5.4e13 < z Initial program 44.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.6
Applied rewrites83.6%
if -2.15e15 < z < -3.79999999999999981e-143 or 3.9999999999999997e-129 < z < 5.4e13Initial program 89.4%
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--.f6469.3
Applied rewrites69.3%
Applied rewrites62.9%
if -3.79999999999999981e-143 < z < 3.9999999999999997e-129Initial program 89.6%
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--.f6463.1
Applied rewrites63.1%
Final simplification73.0%
(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 -3000000000.0)
t_2
(if (<= z 2.7e-226)
(/ (fma t z (* y x)) t_1)
(if (<= z 1.2e+53) (/ (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 <= -3000000000.0) {
tmp = t_2;
} else if (z <= 2.7e-226) {
tmp = fma(t, z, (y * x)) / t_1;
} else if (z <= 1.2e+53) {
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 <= -3000000000.0) tmp = t_2; elseif (z <= 2.7e-226) tmp = Float64(fma(t, z, Float64(y * x)) / t_1); elseif (z <= 1.2e+53) 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, -3000000000.0], t$95$2, If[LessEqual[z, 2.7e-226], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 1.2e+53], 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 -3000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-226}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+53}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-z, a, y \cdot x\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3e9 or 1.2e53 < z Initial program 40.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.1
Applied rewrites85.1%
if -3e9 < z < 2.70000000000000014e-226Initial program 93.4%
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--.f6473.0
Applied rewrites73.0%
if 2.70000000000000014e-226 < z < 1.2e53Initial program 85.3%
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--.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -7.2e+34)
t_1
(if (<= z 3.2e+55)
(/ (+ (* (- 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 <= -7.2e+34) {
tmp = t_1;
} else if (z <= 3.2e+55) {
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 <= (-7.2d+34)) then
tmp = t_1
else if (z <= 3.2d+55) 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 <= -7.2e+34) {
tmp = t_1;
} else if (z <= 3.2e+55) {
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 <= -7.2e+34: tmp = t_1 elif z <= 3.2e+55: 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 <= -7.2e+34) tmp = t_1; elseif (z <= 3.2e+55) 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 <= -7.2e+34) tmp = t_1; elseif (z <= 3.2e+55) 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, -7.2e+34], t$95$1, If[LessEqual[z, 3.2e+55], 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 -7.2 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+55}:\\
\;\;\;\;\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 < -7.2000000000000001e34 or 3.2000000000000003e55 < z Initial program 38.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.5
Applied rewrites85.5%
if -7.2000000000000001e34 < z < 3.2000000000000003e55Initial program 90.2%
Final simplification88.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 -3000000000.0)
t_2
(if (<= z 5.9e-130)
(/ (fma t z (* y x)) t_1)
(if (<= z 54000000000000.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 <= -3000000000.0) {
tmp = t_2;
} else if (z <= 5.9e-130) {
tmp = fma(t, z, (y * x)) / t_1;
} else if (z <= 54000000000000.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 <= -3000000000.0) tmp = t_2; elseif (z <= 5.9e-130) tmp = Float64(fma(t, z, Float64(y * x)) / t_1); elseif (z <= 54000000000000.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, -3000000000.0], t$95$2, If[LessEqual[z, 5.9e-130], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 54000000000000.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 -3000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{-130}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{elif}\;z \leq 54000000000000:\\
\;\;\;\;\frac{z}{t\_1} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3e9 or 5.4e13 < z Initial program 44.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.7
Applied rewrites83.7%
if -3e9 < z < 5.9000000000000003e-130Initial program 90.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--.f6469.1
Applied rewrites69.1%
if 5.9000000000000003e-130 < z < 5.4e13Initial program 85.4%
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.8
Applied rewrites65.8%
Final simplification75.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.2e-66)
t_1
(if (<= z 6.5e-66) (* (/ 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 <= -2.2e-66) {
tmp = t_1;
} else if (z <= 6.5e-66) {
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 <= -2.2e-66) tmp = t_1; elseif (z <= 6.5e-66) 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, -2.2e-66], t$95$1, If[LessEqual[z, 6.5e-66], 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 -2.2 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.2000000000000001e-66 or 6.50000000000000024e-66 < z Initial program 54.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6475.0
Applied rewrites75.0%
if -2.2000000000000001e-66 < z < 6.50000000000000024e-66Initial program 88.0%
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--.f6457.6
Applied rewrites57.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -1.95e+189)
(/ (- a) b)
(if (<= z -2.2e+16) t_1 (if (<= z 2.15e+51) (/ x (- 1.0 z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -1.95e+189) {
tmp = -a / b;
} else if (z <= -2.2e+16) {
tmp = t_1;
} else if (z <= 2.15e+51) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t / (b - y)
if (z <= (-1.95d+189)) then
tmp = -a / b
else if (z <= (-2.2d+16)) then
tmp = t_1
else if (z <= 2.15d+51) then
tmp = x / (1.0d0 - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -1.95e+189) {
tmp = -a / b;
} else if (z <= -2.2e+16) {
tmp = t_1;
} else if (z <= 2.15e+51) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -1.95e+189: tmp = -a / b elif z <= -2.2e+16: tmp = t_1 elif z <= 2.15e+51: tmp = x / (1.0 - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -1.95e+189) tmp = Float64(Float64(-a) / b); elseif (z <= -2.2e+16) tmp = t_1; elseif (z <= 2.15e+51) tmp = Float64(x / Float64(1.0 - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -1.95e+189) tmp = -a / b; elseif (z <= -2.2e+16) tmp = t_1; elseif (z <= 2.15e+51) tmp = x / (1.0 - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.95e+189], N[((-a) / b), $MachinePrecision], If[LessEqual[z, -2.2e+16], t$95$1, If[LessEqual[z, 2.15e+51], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{+189}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.95e189Initial program 24.9%
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--.f6420.6
Applied rewrites20.6%
Taylor expanded in y around 0
Applied rewrites49.4%
if -1.95e189 < z < -2.2e16 or 2.1499999999999999e51 < z Initial program 43.6%
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--.f6431.6
Applied rewrites31.6%
Taylor expanded in z around inf
Applied rewrites46.8%
if -2.2e16 < z < 2.1499999999999999e51Initial program 90.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6443.4
Applied rewrites43.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -1.95e+189)
(/ (- a) b)
(if (<= z -7e-11) t_1 (if (<= z 3.2e-8) (fma 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 <= -1.95e+189) {
tmp = -a / b;
} else if (z <= -7e-11) {
tmp = t_1;
} else if (z <= 3.2e-8) {
tmp = fma(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 <= -1.95e+189) tmp = Float64(Float64(-a) / b); elseif (z <= -7e-11) tmp = t_1; elseif (z <= 3.2e-8) tmp = fma(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, -1.95e+189], N[((-a) / b), $MachinePrecision], If[LessEqual[z, -7e-11], t$95$1, If[LessEqual[z, 3.2e-8], N[(x * z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{+189}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.95e189Initial program 24.9%
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--.f6420.6
Applied rewrites20.6%
Taylor expanded in y around 0
Applied rewrites49.4%
if -1.95e189 < z < -7.00000000000000038e-11 or 3.2000000000000002e-8 < z Initial program 51.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--.f6430.1
Applied rewrites30.1%
Taylor expanded in z around inf
Applied rewrites41.9%
if -7.00000000000000038e-11 < z < 3.2000000000000002e-8Initial program 89.6%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
Applied rewrites46.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -3.4e-67) t_1 (if (<= z 2.95e-67) (/ x (- 1.0 z)) 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.4e-67) {
tmp = t_1;
} else if (z <= 2.95e-67) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-3.4d-67)) then
tmp = t_1
else if (z <= 2.95d-67) then
tmp = x / (1.0d0 - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3.4e-67) {
tmp = t_1;
} else if (z <= 2.95e-67) {
tmp = x / (1.0 - z);
} 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.4e-67: tmp = t_1 elif z <= 2.95e-67: tmp = x / (1.0 - z) 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.4e-67) tmp = t_1; elseif (z <= 2.95e-67) tmp = Float64(x / Float64(1.0 - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -3.4e-67) tmp = t_1; elseif (z <= 2.95e-67) tmp = x / (1.0 - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e-67], t$95$1, If[LessEqual[z, 2.95e-67], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{-67}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.4000000000000001e-67 or 2.95e-67 < z Initial program 54.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6475.0
Applied rewrites75.0%
if -3.4000000000000001e-67 < z < 2.95e-67Initial program 88.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -6e+81) t_1 (if (<= y 1.2e+139) (/ (- 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 <= -6e+81) {
tmp = t_1;
} else if (y <= 1.2e+139) {
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 <= (-6d+81)) then
tmp = t_1
else if (y <= 1.2d+139) 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 <= -6e+81) {
tmp = t_1;
} else if (y <= 1.2e+139) {
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 <= -6e+81: tmp = t_1 elif y <= 1.2e+139: 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 <= -6e+81) tmp = t_1; elseif (y <= 1.2e+139) 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 <= -6e+81) tmp = t_1; elseif (y <= 1.2e+139) 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, -6e+81], t$95$1, If[LessEqual[y, 1.2e+139], 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 -6 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+139}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.99999999999999995e81 or 1.20000000000000004e139 < y Initial program 42.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6463.3
Applied rewrites63.3%
if -5.99999999999999995e81 < y < 1.20000000000000004e139Initial program 77.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6449.0
Applied rewrites49.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- a) b))) (if (<= z -1.18e-61) t_1 (if (<= z 7.5e-66) (* 1.0 x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a / b;
double tmp;
if (z <= -1.18e-61) {
tmp = t_1;
} else if (z <= 7.5e-66) {
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 = -a / b
if (z <= (-1.18d-61)) then
tmp = t_1
else if (z <= 7.5d-66) 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 = -a / b;
double tmp;
if (z <= -1.18e-61) {
tmp = t_1;
} else if (z <= 7.5e-66) {
tmp = 1.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -a / b tmp = 0 if z <= -1.18e-61: tmp = t_1 elif z <= 7.5e-66: tmp = 1.0 * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-a) / b) tmp = 0.0 if (z <= -1.18e-61) tmp = t_1; elseif (z <= 7.5e-66) 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 = -a / b; tmp = 0.0; if (z <= -1.18e-61) tmp = t_1; elseif (z <= 7.5e-66) 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[((-a) / b), $MachinePrecision]}, If[LessEqual[z, -1.18e-61], t$95$1, If[LessEqual[z, 7.5e-66], N[(1.0 * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-a}{b}\\
\mathbf{if}\;z \leq -1.18 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-66}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1800000000000001e-61 or 7.49999999999999995e-66 < z Initial program 54.1%
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--.f6435.5
Applied rewrites35.5%
Taylor expanded in y around 0
Applied rewrites32.2%
if -1.1800000000000001e-61 < z < 7.49999999999999995e-66Initial program 88.2%
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--.f6456.5
Applied rewrites56.5%
Taylor expanded in z around 0
Applied rewrites50.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -7e-11) (/ t b) (if (<= z 3.2e-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 <= -7e-11) {
tmp = t / b;
} else if (z <= 3.2e-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 <= -7e-11) tmp = Float64(t / b); elseif (z <= 3.2e-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, -7e-11], N[(t / b), $MachinePrecision], If[LessEqual[z, 3.2e-8], N[(x * z + x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-11}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -7.00000000000000038e-11 or 3.2000000000000002e-8 < z Initial program 47.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--.f6427.6
Applied rewrites27.6%
Taylor expanded in b around inf
Applied rewrites25.6%
if -7.00000000000000038e-11 < z < 3.2000000000000002e-8Initial program 89.6%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
Applied rewrites46.5%
(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 67.5%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6430.7
Applied rewrites30.7%
Taylor expanded in z around 0
Applied rewrites24.3%
(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.5%
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--.f6431.0
Applied rewrites31.0%
Taylor expanded in z around 0
Applied rewrites24.0%
(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 67.5%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6430.7
Applied rewrites30.7%
Taylor expanded in z around 0
Applied rewrites24.3%
Taylor expanded in z around inf
Applied rewrites4.0%
Final simplification4.0%
(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 2024276
(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)))))