
(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
(-
(/ (- a t) (- y b))
(/ (fma (- y) (/ x (- b y)) (* (/ y (pow (- b y) 2.0)) (- t a))) z)))
(t_2 (/ (- (* y x) (* (- a t) z)) (+ (* (- b y) z) y)))
(t_3 (fma (- b y) z y))
(t_4 (fma (/ y t_3) x (* (/ z t_3) (- t a)))))
(if (<= t_2 -2e-184)
t_4
(if (<= t_2 0.0) t_1 (if (<= t_2 INFINITY) t_4 t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a - t) / (y - b)) - (fma(-y, (x / (b - y)), ((y / pow((b - y), 2.0)) * (t - a))) / z);
double t_2 = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y);
double t_3 = fma((b - y), z, y);
double t_4 = fma((y / t_3), x, ((z / t_3) * (t - a)));
double tmp;
if (t_2 <= -2e-184) {
tmp = t_4;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a - t) / Float64(y - b)) - Float64(fma(Float64(-y), Float64(x / Float64(b - y)), Float64(Float64(y / (Float64(b - y) ^ 2.0)) * Float64(t - a))) / z)) t_2 = Float64(Float64(Float64(y * x) - Float64(Float64(a - t) * z)) / Float64(Float64(Float64(b - y) * z) + y)) t_3 = fma(Float64(b - y), z, y) t_4 = fma(Float64(y / t_3), x, Float64(Float64(z / t_3) * Float64(t - a))) tmp = 0.0 if (t_2 <= -2e-184) tmp = t_4; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 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[(a - t), $MachinePrecision] / N[(y - b), $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[(N[(y * x), $MachinePrecision] - N[(N[(a - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y / t$95$3), $MachinePrecision] * x + N[(N[(z / t$95$3), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-184], t$95$4, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, Infinity], t$95$4, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b} - \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 := \frac{y \cdot x - \left(a - t\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
t_3 := \mathsf{fma}\left(b - y, z, y\right)\\
t_4 := \mathsf{fma}\left(\frac{y}{t\_3}, x, \frac{z}{t\_3} \cdot \left(t - a\right)\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-184}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \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)))) < -2.0000000000000001e-184 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 77.1%
Taylor expanded in a around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*l/N/A
mul-1-negN/A
unsub-negN/A
div-subN/A
Applied rewrites97.7%
if -2.0000000000000001e-184 < (/.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 9.2%
Taylor expanded in z around inf
Applied rewrites96.0%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b)))
(t_2 (fma z (- b y) y))
(t_3 (/ (- (* y x) (* (- a t) z)) (+ (* (- b y) z) y)))
(t_4 (fma y (/ x t_2) (* (/ z t_2) (- t a)))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 -5e-273)
t_3
(if (<= t_3 0.0)
t_1
(if (<= t_3 1e+300) 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 = (a - t) / (y - b);
double t_2 = fma(z, (b - y), y);
double t_3 = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y);
double t_4 = fma(y, (x / t_2), ((z / t_2) * (t - a)));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= -5e-273) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = t_1;
} else if (t_3 <= 1e+300) {
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(a - t) / Float64(y - b)) t_2 = fma(z, Float64(b - y), y) t_3 = Float64(Float64(Float64(y * x) - Float64(Float64(a - t) * z)) / Float64(Float64(Float64(b - y) * z) + y)) t_4 = fma(y, Float64(x / t_2), Float64(Float64(z / t_2) * Float64(t - a))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= -5e-273) tmp = t_3; elseif (t_3 <= 0.0) tmp = t_1; elseif (t_3 <= 1e+300) 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[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(y * x), $MachinePrecision] - N[(N[(a - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(y * N[(x / t$95$2), $MachinePrecision] + N[(N[(z / t$95$2), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, -5e-273], t$95$3, If[LessEqual[t$95$3, 0.0], t$95$1, If[LessEqual[t$95$3, 1e+300], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
t_2 := \mathsf{fma}\left(z, b - y, y\right)\\
t_3 := \frac{y \cdot x - \left(a - t\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
t_4 := \mathsf{fma}\left(y, \frac{x}{t\_2}, \frac{z}{t\_2} \cdot \left(t - a\right)\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-273}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 10^{+300}:\\
\;\;\;\;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 1.0000000000000001e300 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 24.2%
Taylor expanded in a around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*l/N/A
mul-1-negN/A
unsub-negN/A
div-subN/A
Applied rewrites99.8%
Applied rewrites97.9%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.99999999999999965e-273 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.0000000000000001e300Initial program 99.6%
if -4.99999999999999965e-273 < (/.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 7.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6467.6
Applied rewrites67.6%
Final simplification91.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- a t) (- y b))))
(if (<= z -9.6e+69)
t_2
(if (<= z 7.2e+163) (fma (/ y t_1) x (* (/ 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 = (a - t) / (y - b);
double tmp;
if (z <= -9.6e+69) {
tmp = t_2;
} else if (z <= 7.2e+163) {
tmp = fma((y / t_1), x, ((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(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -9.6e+69) tmp = t_2; elseif (z <= 7.2e+163) tmp = fma(Float64(y / t_1), x, 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[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e+69], t$95$2, If[LessEqual[z, 7.2e+163], N[(N[(y / t$95$1), $MachinePrecision] * x + N[(N[(z / t$95$1), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{+69}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+163}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t\_1}, x, \frac{z}{t\_1} \cdot \left(t - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -9.6000000000000007e69 or 7.19999999999999955e163 < z Initial program 18.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.3
Applied rewrites84.3%
if -9.6000000000000007e69 < z < 7.19999999999999955e163Initial program 78.7%
Taylor expanded in a around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*l/N/A
mul-1-negN/A
unsub-negN/A
div-subN/A
Applied rewrites93.7%
Final simplification90.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -5.2e+68)
t_1
(if (<= z 9.5e+46)
(/ (- (* y x) (* (- a t) z)) (+ (* (- b y) z) y))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -5.2e+68) {
tmp = t_1;
} else if (z <= 9.5e+46) {
tmp = ((y * x) - ((a - t) * 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 = (a - t) / (y - b)
if (z <= (-5.2d+68)) then
tmp = t_1
else if (z <= 9.5d+46) then
tmp = ((y * x) - ((a - t) * 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 = (a - t) / (y - b);
double tmp;
if (z <= -5.2e+68) {
tmp = t_1;
} else if (z <= 9.5e+46) {
tmp = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - t) / (y - b) tmp = 0 if z <= -5.2e+68: tmp = t_1 elif z <= 9.5e+46: tmp = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -5.2e+68) tmp = t_1; elseif (z <= 9.5e+46) tmp = Float64(Float64(Float64(y * x) - Float64(Float64(a - t) * 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 = (a - t) / (y - b); tmp = 0.0; if (z <= -5.2e+68) tmp = t_1; elseif (z <= 9.5e+46) tmp = ((y * x) - ((a - t) * 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[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+68], t$95$1, If[LessEqual[z, 9.5e+46], N[(N[(N[(y * x), $MachinePrecision] - N[(N[(a - t), $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{a - t}{y - b}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{y \cdot x - \left(a - t\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.1999999999999996e68 or 9.5000000000000008e46 < z Initial program 27.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.6
Applied rewrites80.6%
if -5.1999999999999996e68 < z < 9.5000000000000008e46Initial program 83.8%
Final simplification82.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- a t) (- y b))))
(if (<= z -1.15e+17)
t_2
(if (<= z -1.24e-253)
(/ (fma (- z) a (* y x)) t_1)
(if (<= z 4.2e-20) (/ (fma t z (* 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 = (a - t) / (y - b);
double tmp;
if (z <= -1.15e+17) {
tmp = t_2;
} else if (z <= -1.24e-253) {
tmp = fma(-z, a, (y * x)) / t_1;
} else if (z <= 4.2e-20) {
tmp = fma(t, z, (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(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -1.15e+17) tmp = t_2; elseif (z <= -1.24e-253) tmp = Float64(fma(Float64(-z), a, Float64(y * x)) / t_1); elseif (z <= 4.2e-20) tmp = Float64(fma(t, z, 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[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+17], t$95$2, If[LessEqual[z, -1.24e-253], N[(N[((-z) * a + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 4.2e-20], N[(N[(t * z + 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{a - t}{y - b}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.24 \cdot 10^{-253}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-z, a, y \cdot x\right)}{t\_1}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-20}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.15e17 or 4.1999999999999998e-20 < z Initial program 36.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.2
Applied rewrites79.2%
if -1.15e17 < z < -1.23999999999999995e-253Initial program 83.6%
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
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6471.4
Applied rewrites71.4%
if -1.23999999999999995e-253 < z < 4.1999999999999998e-20Initial program 83.3%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6468.4
Applied rewrites68.4%
Final simplification74.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- a t) (- y b))))
(if (<= z -1.1e+17)
t_2
(if (<= z 4.2e-262)
(* (/ y t_1) x)
(if (<= z 4.2e-20) (/ (fma t z (* 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 = (a - t) / (y - b);
double tmp;
if (z <= -1.1e+17) {
tmp = t_2;
} else if (z <= 4.2e-262) {
tmp = (y / t_1) * x;
} else if (z <= 4.2e-20) {
tmp = fma(t, z, (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(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -1.1e+17) tmp = t_2; elseif (z <= 4.2e-262) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 4.2e-20) tmp = Float64(fma(t, z, 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[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+17], t$95$2, If[LessEqual[z, 4.2e-262], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 4.2e-20], N[(N[(t * z + 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{a - t}{y - b}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-262}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-20}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.1e17 or 4.1999999999999998e-20 < z Initial program 36.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.2
Applied rewrites79.2%
if -1.1e17 < z < 4.1999999999999999e-262Initial program 81.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--.f6467.2
Applied rewrites67.2%
if 4.1999999999999999e-262 < z < 4.1999999999999998e-20Initial program 86.2%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6467.0
Applied rewrites67.0%
Final simplification73.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -1.1e+17)
t_1
(if (<= z 1.2e-22) (* (/ 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 = (a - t) / (y - b);
double tmp;
if (z <= -1.1e+17) {
tmp = t_1;
} else if (z <= 1.2e-22) {
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(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -1.1e+17) tmp = t_1; elseif (z <= 1.2e-22) 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[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+17], t$95$1, If[LessEqual[z, 1.2e-22], 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{a - t}{y - b}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-22}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1e17 or 1.20000000000000001e-22 < z Initial program 36.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.2
Applied rewrites79.2%
if -1.1e17 < z < 1.20000000000000001e-22Initial program 83.4%
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--.f6460.1
Applied rewrites60.1%
Final simplification69.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -1.15e+125)
t_1
(if (<= y -2600000000.0)
(/ a (- y b))
(if (<= y 6.8e+61) (/ (- 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+125) {
tmp = t_1;
} else if (y <= -2600000000.0) {
tmp = a / (y - b);
} else if (y <= 6.8e+61) {
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+125)) then
tmp = t_1
else if (y <= (-2600000000.0d0)) then
tmp = a / (y - b)
else if (y <= 6.8d+61) 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+125) {
tmp = t_1;
} else if (y <= -2600000000.0) {
tmp = a / (y - b);
} else if (y <= 6.8e+61) {
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+125: tmp = t_1 elif y <= -2600000000.0: tmp = a / (y - b) elif y <= 6.8e+61: 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+125) tmp = t_1; elseif (y <= -2600000000.0) tmp = Float64(a / Float64(y - b)); elseif (y <= 6.8e+61) 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+125) tmp = t_1; elseif (y <= -2600000000.0) tmp = a / (y - b); elseif (y <= 6.8e+61) 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+125], t$95$1, If[LessEqual[y, -2600000000.0], N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+61], 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^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2600000000:\\
\;\;\;\;\frac{a}{y - b}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+61}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.15000000000000006e125 or 6.80000000000000051e61 < y Initial program 41.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6464.7
Applied rewrites64.7%
if -1.15000000000000006e125 < y < -2.6e9Initial program 42.3%
Taylor expanded in a around inf
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6429.7
Applied rewrites29.7%
Taylor expanded in z around inf
Applied rewrites52.0%
if -2.6e9 < y < 6.80000000000000051e61Initial program 75.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6458.1
Applied rewrites58.1%
Final simplification60.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -1.45e-77)
t_1
(if (<= y -5.7e-269) (/ (- a) b) (if (<= y 5.4e+18) (/ t 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-77) {
tmp = t_1;
} else if (y <= -5.7e-269) {
tmp = -a / b;
} else if (y <= 5.4e+18) {
tmp = t / 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-77)) then
tmp = t_1
else if (y <= (-5.7d-269)) then
tmp = -a / b
else if (y <= 5.4d+18) then
tmp = t / 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-77) {
tmp = t_1;
} else if (y <= -5.7e-269) {
tmp = -a / b;
} else if (y <= 5.4e+18) {
tmp = t / 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-77: tmp = t_1 elif y <= -5.7e-269: tmp = -a / b elif y <= 5.4e+18: tmp = t / 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-77) tmp = t_1; elseif (y <= -5.7e-269) tmp = Float64(Float64(-a) / b); elseif (y <= 5.4e+18) tmp = Float64(t / 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-77) tmp = t_1; elseif (y <= -5.7e-269) tmp = -a / b; elseif (y <= 5.4e+18) tmp = t / 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-77], t$95$1, If[LessEqual[y, -5.7e-269], N[((-a) / b), $MachinePrecision], If[LessEqual[y, 5.4e+18], N[(t / 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^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.7 \cdot 10^{-269}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+18}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.4499999999999999e-77 or 5.4e18 < y Initial program 45.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6449.6
Applied rewrites49.6%
if -1.4499999999999999e-77 < y < -5.69999999999999969e-269Initial program 77.3%
Taylor expanded in a around inf
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6446.8
Applied rewrites46.8%
Taylor expanded in b around inf
Applied rewrites46.6%
if -5.69999999999999969e-269 < y < 5.4e18Initial program 77.7%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6477.8
Applied rewrites77.8%
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--.f6453.7
Applied rewrites53.7%
Taylor expanded in y around 0
Applied rewrites40.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -1.16e+125) t_1 (if (<= y 3.1e+73) (/ (- a t) (- y 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.16e+125) {
tmp = t_1;
} else if (y <= 3.1e+73) {
tmp = (a - t) / (y - 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.16d+125)) then
tmp = t_1
else if (y <= 3.1d+73) then
tmp = (a - t) / (y - 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.16e+125) {
tmp = t_1;
} else if (y <= 3.1e+73) {
tmp = (a - t) / (y - 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.16e+125: tmp = t_1 elif y <= 3.1e+73: tmp = (a - t) / (y - 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.16e+125) tmp = t_1; elseif (y <= 3.1e+73) tmp = Float64(Float64(a - t) / Float64(y - 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.16e+125) tmp = t_1; elseif (y <= 3.1e+73) tmp = (a - t) / (y - 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.16e+125], t$95$1, If[LessEqual[y, 3.1e+73], N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.16 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+73}:\\
\;\;\;\;\frac{a - t}{y - b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.16000000000000009e125 or 3.1e73 < y Initial program 41.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6464.7
Applied rewrites64.7%
if -1.16000000000000009e125 < y < 3.1e73Initial program 70.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6466.6
Applied rewrites66.6%
Final simplification65.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -2.2e+91) t_1 (if (<= y 6.8e+61) (/ (- 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 <= -2.2e+91) {
tmp = t_1;
} else if (y <= 6.8e+61) {
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 <= (-2.2d+91)) then
tmp = t_1
else if (y <= 6.8d+61) 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 <= -2.2e+91) {
tmp = t_1;
} else if (y <= 6.8e+61) {
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 <= -2.2e+91: tmp = t_1 elif y <= 6.8e+61: 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 <= -2.2e+91) tmp = t_1; elseif (y <= 6.8e+61) 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 <= -2.2e+91) tmp = t_1; elseif (y <= 6.8e+61) 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, -2.2e+91], t$95$1, If[LessEqual[y, 6.8e+61], 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 -2.2 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+61}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.19999999999999999e91 or 6.80000000000000051e61 < y Initial program 42.9%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6461.3
Applied rewrites61.3%
if -2.19999999999999999e91 < y < 6.80000000000000051e61Initial program 71.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6456.4
Applied rewrites56.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.1e-9) (/ (- a) b) (if (<= z 4.6e-20) (fma z x x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-9) {
tmp = -a / b;
} else if (z <= 4.6e-20) {
tmp = fma(z, x, x);
} else {
tmp = t / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.1e-9) tmp = Float64(Float64(-a) / b); elseif (z <= 4.6e-20) tmp = fma(z, x, x); else tmp = Float64(t / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.1e-9], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 4.6e-20], N[(z * x + x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-9}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -2.10000000000000019e-9Initial program 31.8%
Taylor expanded in a around inf
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6431.2
Applied rewrites31.2%
Taylor expanded in b around inf
Applied rewrites24.1%
if -2.10000000000000019e-9 < z < 4.5999999999999998e-20Initial program 83.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6448.6
Applied rewrites48.6%
Taylor expanded in z around 0
Applied rewrites48.6%
if 4.5999999999999998e-20 < z Initial program 43.3%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6443.3
Applied rewrites43.3%
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--.f6426.7
Applied rewrites26.7%
Taylor expanded in y around 0
Applied rewrites33.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.25) (/ t b) (if (<= z 4.6e-20) (fma z x x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.25) {
tmp = t / b;
} else if (z <= 4.6e-20) {
tmp = fma(z, x, x);
} else {
tmp = t / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.25) tmp = Float64(t / b); elseif (z <= 4.6e-20) tmp = fma(z, x, x); else tmp = Float64(t / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.25], N[(t / b), $MachinePrecision], If[LessEqual[z, 4.6e-20], N[(z * x + x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -2.25 or 4.5999999999999998e-20 < z Initial program 37.4%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6437.4
Applied rewrites37.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--.f6424.0
Applied rewrites24.0%
Taylor expanded in y around 0
Applied rewrites29.2%
if -2.25 < z < 4.5999999999999998e-20Initial program 83.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6447.9
Applied rewrites47.9%
Taylor expanded in z around 0
Applied rewrites47.9%
(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 59.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6433.0
Applied rewrites33.0%
Taylor expanded in z around 0
Applied rewrites25.1%
(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 59.8%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6459.8
Applied rewrites59.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.0%
Taylor expanded in z around 0
Applied rewrites24.9%
(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 59.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6433.0
Applied rewrites33.0%
Taylor expanded in z around 0
Applied rewrites25.1%
Taylor expanded in z around inf
Applied rewrites3.5%
(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 2024255
(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)))))