
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (* y (/ x t_1)))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* x y) t_3) (+ y (* z (- b y))))))
(if (<= t_4 -5e+266)
(fma (- t a) (pow (- b y) -1.0) t_2)
(if (<= t_4 1e+269)
(/ (fma x y t_3) t_1)
(if (<= t_4 INFINITY)
(fma (- t a) (/ z t_1) t_2)
(-
(/ (fma (/ x z) y (- t a)) (- b y))
(* (/ y (pow (- b y) 2.0)) (/ (- t a) z))))))))
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 = y * (x / t_1);
double t_3 = z * (t - a);
double t_4 = ((x * y) + t_3) / (y + (z * (b - y)));
double tmp;
if (t_4 <= -5e+266) {
tmp = fma((t - a), pow((b - y), -1.0), t_2);
} else if (t_4 <= 1e+269) {
tmp = fma(x, y, t_3) / t_1;
} else if (t_4 <= ((double) INFINITY)) {
tmp = fma((t - a), (z / t_1), t_2);
} else {
tmp = (fma((x / z), y, (t - a)) / (b - y)) - ((y / pow((b - y), 2.0)) * ((t - a) / z));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(y * Float64(x / t_1)) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(x * y) + t_3) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_4 <= -5e+266) tmp = fma(Float64(t - a), (Float64(b - y) ^ -1.0), t_2); elseif (t_4 <= 1e+269) tmp = Float64(fma(x, y, t_3) / t_1); elseif (t_4 <= Inf) tmp = fma(Float64(t - a), Float64(z / t_1), t_2); else tmp = Float64(Float64(fma(Float64(x / z), y, Float64(t - a)) / Float64(b - y)) - Float64(Float64(y / (Float64(b - y) ^ 2.0)) * Float64(Float64(t - a) / z))); 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[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + t$95$3), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -5e+266], N[(N[(t - a), $MachinePrecision] * N[Power[N[(b - y), $MachinePrecision], -1.0], $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t$95$4, 1e+269], N[(N[(x * y + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(t - a), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[(N[(N[(x / z), $MachinePrecision] * y + N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := y \cdot \frac{x}{t\_1}\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{x \cdot y + t\_3}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t\_4 \leq -5 \cdot 10^{+266}:\\
\;\;\;\;\mathsf{fma}\left(t - a, {\left(b - y\right)}^{-1}, t\_2\right)\\
\mathbf{elif}\;t\_4 \leq 10^{+269}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t\_3\right)}{t\_1}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t - a, \frac{z}{t\_1}, t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{z}, y, t - a\right)}{b - y} - \frac{y}{{\left(b - y\right)}^{2}} \cdot \frac{t - a}{z}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999999e266Initial program 27.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
if -4.9999999999999999e266 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e269Initial program 94.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6480.8
Applied rewrites80.8%
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
sub-divN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6494.5
Applied rewrites94.5%
if 1e269 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 35.4%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 0.0%
Taylor expanded in z around inf
associate--r+N/A
lower--.f64N/A
+-commutativeN/A
associate--l+N/A
times-fracN/A
associate-*r/N/A
div-subN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
Applied rewrites91.4%
Final simplification95.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (* z (- t a)))
(t_3 (/ (+ (* x y) t_2) (+ y (* z (- b y))))))
(if (or (<= t_3 -5e+266) (not (<= t_3 1e+269)))
(fma (- t a) (pow (- b y) -1.0) (* y (/ x t_1)))
(/ (fma x y t_2) t_1))))
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 - a);
double t_3 = ((x * y) + t_2) / (y + (z * (b - y)));
double tmp;
if ((t_3 <= -5e+266) || !(t_3 <= 1e+269)) {
tmp = fma((t - a), pow((b - y), -1.0), (y * (x / t_1)));
} else {
tmp = fma(x, y, t_2) / t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(z * Float64(t - a)) t_3 = Float64(Float64(Float64(x * y) + t_2) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if ((t_3 <= -5e+266) || !(t_3 <= 1e+269)) tmp = fma(Float64(t - a), (Float64(b - y) ^ -1.0), Float64(y * Float64(x / t_1))); else tmp = Float64(fma(x, y, t_2) / t_1); 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[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$3, -5e+266], N[Not[LessEqual[t$95$3, 1e+269]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] * N[Power[N[(b - y), $MachinePrecision], -1.0], $MachinePrecision] + N[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := \frac{x \cdot y + t\_2}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+266} \lor \neg \left(t\_3 \leq 10^{+269}\right):\\
\;\;\;\;\mathsf{fma}\left(t - a, {\left(b - y\right)}^{-1}, y \cdot \frac{x}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t\_2\right)}{t\_1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999999e266 or 1e269 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 18.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.5
Applied rewrites62.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6487.2
Applied rewrites87.2%
if -4.9999999999999999e266 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e269Initial program 94.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6480.8
Applied rewrites80.8%
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
sub-divN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6494.5
Applied rewrites94.5%
Final simplification92.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (* (/ (fma z (/ (- t a) x) y) t_1) x))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* x y) t_3) (+ y (* z (- b y))))))
(if (<= t_4 -1e+253)
t_2
(if (<= t_4 2e+224)
(/ (fma x y t_3) t_1)
(if (<= t_4 INFINITY) t_2 (/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - y), z, y);
double t_2 = (fma(z, ((t - a) / x), y) / t_1) * x;
double t_3 = z * (t - a);
double t_4 = ((x * y) + t_3) / (y + (z * (b - y)));
double tmp;
if (t_4 <= -1e+253) {
tmp = t_2;
} else if (t_4 <= 2e+224) {
tmp = fma(x, y, t_3) / t_1;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(fma(z, Float64(Float64(t - a) / x), y) / t_1) * x) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(x * y) + t_3) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_4 <= -1e+253) tmp = t_2; elseif (t_4 <= 2e+224) tmp = Float64(fma(x, y, t_3) / t_1); elseif (t_4 <= Inf) tmp = t_2; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * N[(N[(t - a), $MachinePrecision] / x), $MachinePrecision] + y), $MachinePrecision] / t$95$1), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + t$95$3), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -1e+253], t$95$2, If[LessEqual[t$95$4, 2e+224], N[(N[(x * y + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$2, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{\mathsf{fma}\left(z, \frac{t - a}{x}, y\right)}{t\_1} \cdot x\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{x \cdot y + t\_3}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t\_4 \leq -1 \cdot 10^{+253}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+224}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t\_3\right)}{t\_1}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.9999999999999994e252 or 1.99999999999999994e224 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 39.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6491.4
Applied rewrites91.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
associate-/r*N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6484.7
Applied rewrites84.7%
if -9.9999999999999994e252 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.99999999999999994e224Initial program 94.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.8
Applied rewrites82.8%
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
sub-divN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6494.3
Applied rewrites94.3%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 0.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6472.2
Applied rewrites72.2%
Final simplification89.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -3.6e-136)
t_1
(if (<= z 1e-80)
(fma (/ (- t a) y) z x)
(if (<= z 124.0) (/ (fma y (/ x z) (- t a)) b) 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.6e-136) {
tmp = t_1;
} else if (z <= 1e-80) {
tmp = fma(((t - a) / y), z, x);
} else if (z <= 124.0) {
tmp = fma(y, (x / z), (t - a)) / b;
} 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.6e-136) tmp = t_1; elseif (z <= 1e-80) tmp = fma(Float64(Float64(t - a) / y), z, x); elseif (z <= 124.0) tmp = Float64(fma(y, Float64(x / z), Float64(t - a)) / b); 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, -3.6e-136], t$95$1, If[LessEqual[z, 1e-80], N[(N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[z, 124.0], N[(N[(y * N[(x / z), $MachinePrecision] + N[(t - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-80}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - a}{y}, z, x\right)\\
\mathbf{elif}\;z \leq 124:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{x}{z}, t - a\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5999999999999998e-136 or 124 < z Initial program 53.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6475.0
Applied rewrites75.0%
if -3.5999999999999998e-136 < z < 9.99999999999999961e-81Initial program 87.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6458.2
Applied rewrites58.2%
Taylor expanded in x around 0
Applied rewrites72.5%
if 9.99999999999999961e-81 < z < 124Initial program 99.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6483.3
Applied rewrites83.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6461.9
Applied rewrites61.9%
Applied rewrites61.9%
Final simplification73.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -3.6e-136)
t_1
(if (<= z 1e-80)
(fma (/ (- t a) y) z x)
(if (<= z 124.0) (/ (- (fma x (/ y z) t) a) b) 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.6e-136) {
tmp = t_1;
} else if (z <= 1e-80) {
tmp = fma(((t - a) / y), z, x);
} else if (z <= 124.0) {
tmp = (fma(x, (y / z), t) - a) / b;
} 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.6e-136) tmp = t_1; elseif (z <= 1e-80) tmp = fma(Float64(Float64(t - a) / y), z, x); elseif (z <= 124.0) tmp = Float64(Float64(fma(x, Float64(y / z), t) - a) / b); 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, -3.6e-136], t$95$1, If[LessEqual[z, 1e-80], N[(N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[z, 124.0], N[(N[(N[(x * N[(y / z), $MachinePrecision] + t), $MachinePrecision] - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-80}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - a}{y}, z, x\right)\\
\mathbf{elif}\;z \leq 124:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{y}{z}, t\right) - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5999999999999998e-136 or 124 < z Initial program 53.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6475.0
Applied rewrites75.0%
if -3.5999999999999998e-136 < z < 9.99999999999999961e-81Initial program 87.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6458.2
Applied rewrites58.2%
Taylor expanded in x around 0
Applied rewrites72.5%
if 9.99999999999999961e-81 < z < 124Initial program 99.8%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6483.3
Applied rewrites83.3%
Taylor expanded in b around inf
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6461.9
Applied rewrites61.9%
Final simplification73.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.1e+117) (not (<= z 2.95e+88))) (/ (- t a) (- b y)) (/ (fma x y (* z (- t a))) (fma (- b y) z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.1e+117) || !(z <= 2.95e+88)) {
tmp = (t - a) / (b - y);
} else {
tmp = fma(x, y, (z * (t - a))) / fma((b - y), z, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.1e+117) || !(z <= 2.95e+88)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / fma(Float64(b - y), z, y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.1e+117], N[Not[LessEqual[z, 2.95e+88]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+117} \lor \neg \left(z \leq 2.95 \cdot 10^{+88}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\end{array}
\end{array}
if z < -1.10000000000000007e117 or 2.94999999999999984e88 < z Initial program 31.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.4
Applied rewrites85.4%
if -1.10000000000000007e117 < z < 2.94999999999999984e88Initial program 88.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.5
Applied rewrites84.5%
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
sub-divN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6488.5
Applied rewrites88.5%
Final simplification87.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.2e+19) (not (<= z 252.0))) (/ (- t a) (- b y)) (/ (fma x y (* z t)) (fma (- b y) z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.2e+19) || !(z <= 252.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = fma(x, y, (z * t)) / fma((b - y), z, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.2e+19) || !(z <= 252.0)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(fma(x, y, Float64(z * t)) / fma(Float64(b - y), z, y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.2e+19], N[Not[LessEqual[z, 252.0]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+19} \lor \neg \left(z \leq 252\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot t\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\end{array}
\end{array}
if z < -1.2e19 or 252 < z Initial program 45.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.4
Applied rewrites80.4%
if -1.2e19 < z < 252Initial program 89.6%
Taylor expanded in a around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6466.7
Applied rewrites66.7%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
Applied rewrites66.7%
Final simplification72.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.2e+19) (not (<= z 252.0))) (/ (- t a) (- b y)) (/ (fma t z (* y x)) (fma (- b y) z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.2e+19) || !(z <= 252.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = fma(t, z, (y * x)) / fma((b - y), z, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.2e+19) || !(z <= 252.0)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(fma(t, z, Float64(y * x)) / fma(Float64(b - y), z, y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.2e+19], N[Not[LessEqual[z, 252.0]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+19} \lor \neg \left(z \leq 252\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\end{array}
\end{array}
if z < -1.2e19 or 252 < z Initial program 45.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.4
Applied rewrites80.4%
if -1.2e19 < z < 252Initial program 89.6%
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--.f6466.7
Applied rewrites66.7%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a) b)) (t_2 (/ x (- 1.0 z))))
(if (<= y -3.8e-65)
t_2
(if (<= y -2.55e-276)
t_1
(if (<= y 5.6e-109) (/ t b) (if (<= y 2.2e-19) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -3.8e-65) {
tmp = t_2;
} else if (y <= -2.55e-276) {
tmp = t_1;
} else if (y <= 5.6e-109) {
tmp = t / b;
} else if (y <= 2.2e-19) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -a / b
t_2 = x / (1.0d0 - z)
if (y <= (-3.8d-65)) then
tmp = t_2
else if (y <= (-2.55d-276)) then
tmp = t_1
else if (y <= 5.6d-109) then
tmp = t / b
else if (y <= 2.2d-19) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -3.8e-65) {
tmp = t_2;
} else if (y <= -2.55e-276) {
tmp = t_1;
} else if (y <= 5.6e-109) {
tmp = t / b;
} else if (y <= 2.2e-19) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -a / b t_2 = x / (1.0 - z) tmp = 0 if y <= -3.8e-65: tmp = t_2 elif y <= -2.55e-276: tmp = t_1 elif y <= 5.6e-109: tmp = t / b elif y <= 2.2e-19: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-a) / b) t_2 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -3.8e-65) tmp = t_2; elseif (y <= -2.55e-276) tmp = t_1; elseif (y <= 5.6e-109) tmp = Float64(t / b); elseif (y <= 2.2e-19) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -a / b; t_2 = x / (1.0 - z); tmp = 0.0; if (y <= -3.8e-65) tmp = t_2; elseif (y <= -2.55e-276) tmp = t_1; elseif (y <= 5.6e-109) tmp = t / b; elseif (y <= 2.2e-19) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) / b), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.8e-65], t$95$2, If[LessEqual[y, -2.55e-276], t$95$1, If[LessEqual[y, 5.6e-109], N[(t / b), $MachinePrecision], If[LessEqual[y, 2.2e-19], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-a}{b}\\
t_2 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{-65}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.55 \cdot 10^{-276}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-109}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -3.8000000000000002e-65 or 2.1999999999999998e-19 < y Initial program 64.5%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6453.2
Applied rewrites53.2%
if -3.8000000000000002e-65 < y < -2.54999999999999984e-276 or 5.59999999999999958e-109 < y < 2.1999999999999998e-19Initial program 76.1%
Taylor expanded in a around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6448.2
Applied rewrites48.2%
Taylor expanded in y around 0
Applied rewrites47.1%
if -2.54999999999999984e-276 < y < 5.59999999999999958e-109Initial program 74.0%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6481.2
Applied rewrites81.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
Taylor expanded in t around inf
Applied rewrites47.9%
Final simplification50.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.6e-136) (not (<= z 1.06e-9))) (/ (- t a) (- b y)) (fma (/ (- t a) y) z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.6e-136) || !(z <= 1.06e-9)) {
tmp = (t - a) / (b - y);
} else {
tmp = fma(((t - a) / y), z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.6e-136) || !(z <= 1.06e-9)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = fma(Float64(Float64(t - a) / y), z, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.6e-136], N[Not[LessEqual[z, 1.06e-9]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-136} \lor \neg \left(z \leq 1.06 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - a}{y}, z, x\right)\\
\end{array}
\end{array}
if z < -3.5999999999999998e-136 or 1.0600000000000001e-9 < z Initial program 55.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.8
Applied rewrites73.8%
if -3.5999999999999998e-136 < z < 1.0600000000000001e-9Initial program 89.2%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6456.6
Applied rewrites56.6%
Taylor expanded in x around 0
Applied rewrites67.8%
Final simplification71.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.35e-136) (not (<= z 1.1e-80))) (/ (- t a) (- b y)) (fma (/ (- a) y) z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.35e-136) || !(z <= 1.1e-80)) {
tmp = (t - a) / (b - y);
} else {
tmp = fma((-a / y), z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.35e-136) || !(z <= 1.1e-80)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = fma(Float64(Float64(-a) / y), z, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.35e-136], N[Not[LessEqual[z, 1.1e-80]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[((-a) / y), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.35 \cdot 10^{-136} \lor \neg \left(z \leq 1.1 \cdot 10^{-80}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-a}{y}, z, x\right)\\
\end{array}
\end{array}
if z < -3.3499999999999999e-136 or 1.10000000000000005e-80 < z Initial program 60.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6470.3
Applied rewrites70.3%
if -3.3499999999999999e-136 < z < 1.10000000000000005e-80Initial program 87.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6458.2
Applied rewrites58.2%
Taylor expanded in a around inf
Applied rewrites63.0%
Final simplification67.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.4e-136) (not (<= z 1e-80))) (/ (- t a) (- b y)) (fma x z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.4e-136) || !(z <= 1e-80)) {
tmp = (t - a) / (b - y);
} else {
tmp = fma(x, z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.4e-136) || !(z <= 1e-80)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = fma(x, z, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.4e-136], N[Not[LessEqual[z, 1e-80]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-136} \lor \neg \left(z \leq 10^{-80}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\end{array}
\end{array}
if z < -2.3999999999999999e-136 or 9.99999999999999961e-81 < z Initial program 60.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6470.3
Applied rewrites70.3%
if -2.3999999999999999e-136 < z < 9.99999999999999961e-81Initial program 87.0%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6455.2
Applied rewrites55.2%
Taylor expanded in z around 0
Applied rewrites55.2%
Final simplification64.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.5e-74) (not (<= y 1.55e-18))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.5e-74) || !(y <= 1.55e-18)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-4.5d-74)) .or. (.not. (y <= 1.55d-18))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.5e-74) || !(y <= 1.55e-18)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.5e-74) or not (y <= 1.55e-18): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.5e-74) || !(y <= 1.55e-18)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.5e-74) || ~((y <= 1.55e-18))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.5e-74], N[Not[LessEqual[y, 1.55e-18]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-74} \lor \neg \left(y \leq 1.55 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -4.4999999999999999e-74 or 1.55000000000000003e-18 < y Initial program 64.7%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6452.8
Applied rewrites52.8%
if -4.4999999999999999e-74 < y < 1.55000000000000003e-18Initial program 75.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6468.1
Applied rewrites68.1%
Final simplification60.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.2e-103) (/ t b) (if (<= z 1.72e-65) (/ x 1.0) (/ (- a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e-103) {
tmp = t / b;
} else if (z <= 1.72e-65) {
tmp = x / 1.0;
} else {
tmp = -a / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.2d-103)) then
tmp = t / b
else if (z <= 1.72d-65) then
tmp = x / 1.0d0
else
tmp = -a / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e-103) {
tmp = t / b;
} else if (z <= 1.72e-65) {
tmp = x / 1.0;
} else {
tmp = -a / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.2e-103: tmp = t / b elif z <= 1.72e-65: tmp = x / 1.0 else: tmp = -a / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.2e-103) tmp = Float64(t / b); elseif (z <= 1.72e-65) tmp = Float64(x / 1.0); else tmp = Float64(Float64(-a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.2e-103) tmp = t / b; elseif (z <= 1.72e-65) tmp = x / 1.0; else tmp = -a / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e-103], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.72e-65], N[(x / 1.0), $MachinePrecision], N[((-a) / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-103}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 1.72 \cdot 10^{-65}:\\
\;\;\;\;\frac{x}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{b}\\
\end{array}
\end{array}
if z < -4.20000000000000009e-103Initial program 53.9%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6470.9
Applied rewrites70.9%
Taylor expanded in b around inf
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6455.2
Applied rewrites55.2%
Taylor expanded in t around inf
Applied rewrites34.8%
if -4.20000000000000009e-103 < z < 1.72000000000000005e-65Initial program 88.1%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6454.1
Applied rewrites54.1%
Taylor expanded in z around 0
Applied rewrites54.1%
if 1.72000000000000005e-65 < z Initial program 63.3%
Taylor expanded in a around inf
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6447.8
Applied rewrites47.8%
Taylor expanded in y around 0
Applied rewrites40.5%
Final simplification43.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.45e-118) (not (<= y 3.8e-105))) (/ x 1.0) (/ t b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.45e-118) || !(y <= 3.8e-105)) {
tmp = x / 1.0;
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.45d-118)) .or. (.not. (y <= 3.8d-105))) then
tmp = x / 1.0d0
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.45e-118) || !(y <= 3.8e-105)) {
tmp = x / 1.0;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.45e-118) or not (y <= 3.8e-105): tmp = x / 1.0 else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.45e-118) || !(y <= 3.8e-105)) tmp = Float64(x / 1.0); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.45e-118) || ~((y <= 3.8e-105))) tmp = x / 1.0; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.45e-118], N[Not[LessEqual[y, 3.8e-105]], $MachinePrecision]], N[(x / 1.0), $MachinePrecision], N[(t / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.45 \cdot 10^{-118} \lor \neg \left(y \leq 3.8 \cdot 10^{-105}\right):\\
\;\;\;\;\frac{x}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if y < -2.4499999999999999e-118 or 3.7999999999999998e-105 < y Initial program 67.4%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6446.4
Applied rewrites46.4%
Taylor expanded in z around 0
Applied rewrites35.6%
if -2.4499999999999999e-118 < y < 3.7999999999999998e-105Initial program 73.7%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6481.9
Applied rewrites81.9%
Taylor expanded in b around inf
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.2
Applied rewrites77.2%
Taylor expanded in t around inf
Applied rewrites40.7%
Final simplification37.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.2e-103) (not (<= z 1.4e-8))) (/ t b) (fma x z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.2e-103) || !(z <= 1.4e-8)) {
tmp = t / b;
} else {
tmp = fma(x, z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.2e-103) || !(z <= 1.4e-8)) tmp = Float64(t / b); else tmp = fma(x, z, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.2e-103], N[Not[LessEqual[z, 1.4e-8]], $MachinePrecision]], N[(t / b), $MachinePrecision], N[(x * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-103} \lor \neg \left(z \leq 1.4 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\end{array}
\end{array}
if z < -4.20000000000000009e-103 or 1.4e-8 < z Initial program 54.2%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6471.4
Applied rewrites71.4%
Taylor expanded in b around inf
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6456.8
Applied rewrites56.8%
Taylor expanded in t around inf
Applied rewrites27.9%
if -4.20000000000000009e-103 < z < 1.4e-8Initial program 89.5%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6449.2
Applied rewrites49.2%
Taylor expanded in z around 0
Applied rewrites49.2%
Final simplification37.3%
(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 69.8%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6431.5
Applied rewrites31.5%
Taylor expanded in z around 0
Applied rewrites24.5%
Final simplification24.5%
(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 69.8%
Taylor expanded in y around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6431.5
Applied rewrites31.5%
Taylor expanded in z around 0
Applied rewrites24.5%
Taylor expanded in z around inf
Applied rewrites3.2%
Final simplification3.2%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024337
(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)))))