
(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 17 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) z) (* y x)) (+ (* (- b y) z) y)))
(t_2 (fma (- t a) z (* y x))))
(if (<= t_1 -1e+274)
(-
(/ x (- 1.0 z))
(/
(fma (- t a) (/ z (- z 1.0)) (/ (* (* z x) b) (* (- z 1.0) (- z 1.0))))
y))
(if (<= t_1 1e+284)
(/ 1.0 (fma (* (/ 1.0 t_2) (- b y)) z (/ y t_2)))
(/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
double t_2 = fma((t - a), z, (y * x));
double tmp;
if (t_1 <= -1e+274) {
tmp = (x / (1.0 - z)) - (fma((t - a), (z / (z - 1.0)), (((z * x) * b) / ((z - 1.0) * (z - 1.0)))) / y);
} else if (t_1 <= 1e+284) {
tmp = 1.0 / fma(((1.0 / t_2) * (b - y)), z, (y / t_2));
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)) t_2 = fma(Float64(t - a), z, Float64(y * x)) tmp = 0.0 if (t_1 <= -1e+274) tmp = Float64(Float64(x / Float64(1.0 - z)) - Float64(fma(Float64(t - a), Float64(z / Float64(z - 1.0)), Float64(Float64(Float64(z * x) * b) / Float64(Float64(z - 1.0) * Float64(z - 1.0)))) / y)); elseif (t_1 <= 1e+284) tmp = Float64(1.0 / fma(Float64(Float64(1.0 / t_2) * Float64(b - y)), z, Float64(y / 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[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+274], N[(N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t - a), $MachinePrecision] * N[(z / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * x), $MachinePrecision] * b), $MachinePrecision] / N[(N[(z - 1.0), $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+284], N[(1.0 / N[(N[(N[(1.0 / t$95$2), $MachinePrecision] * N[(b - y), $MachinePrecision]), $MachinePrecision] * z + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
t_2 := \mathsf{fma}\left(t - a, z, y \cdot x\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+274}:\\
\;\;\;\;\frac{x}{1 - z} - \frac{\mathsf{fma}\left(t - a, \frac{z}{z - 1}, \frac{\left(z \cdot x\right) \cdot b}{\left(z - 1\right) \cdot \left(z - 1\right)}\right)}{y}\\
\mathbf{elif}\;t\_1 \leq 10^{+284}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\frac{1}{t\_2} \cdot \left(b - y\right), z, \frac{y}{t\_2}\right)}\\
\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.99999999999999921e273Initial program 34.2%
Taylor expanded in y around -inf
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Applied rewrites68.2%
if -9.99999999999999921e273 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.00000000000000008e284Initial program 92.4%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites91.2%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
Applied rewrites96.0%
if 1.00000000000000008e284 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.2
Applied rewrites80.2%
Final simplification89.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- b y) z) y)) (t_2 (/ (+ (* (- t a) z) (* y x)) t_1)))
(if (<= t_2 (- INFINITY))
(* (/ z (fma (- b y) z y)) (- t a))
(if (<= t_2 -2e-318)
(/ (fma z t (fma z (- a) (* y x))) t_1)
(if (<= t_2 0.0)
(/ 1.0 (fma (* (/ 1.0 (fma (- t a) z (* y x))) (- b y)) z (/ 1.0 x)))
(if (<= t_2 1e+284) t_2 (/ (- t a) (- b y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((b - y) * z) + y;
double t_2 = (((t - a) * z) + (y * x)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z / fma((b - y), z, y)) * (t - a);
} else if (t_2 <= -2e-318) {
tmp = fma(z, t, fma(z, -a, (y * x))) / t_1;
} else if (t_2 <= 0.0) {
tmp = 1.0 / fma(((1.0 / fma((t - a), z, (y * x))) * (b - y)), z, (1.0 / x));
} else if (t_2 <= 1e+284) {
tmp = t_2;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(b - y) * z) + y) t_2 = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(z / fma(Float64(b - y), z, y)) * Float64(t - a)); elseif (t_2 <= -2e-318) tmp = Float64(fma(z, t, fma(z, Float64(-a), Float64(y * x))) / t_1); elseif (t_2 <= 0.0) tmp = Float64(1.0 / fma(Float64(Float64(1.0 / fma(Float64(t - a), z, Float64(y * x))) * Float64(b - y)), z, Float64(1.0 / x))); elseif (t_2 <= 1e+284) 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[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-318], N[(N[(z * t + N[(z * (-a) + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(1.0 / N[(N[(N[(1.0 / N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - y), $MachinePrecision]), $MachinePrecision] * z + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+284], t$95$2, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - y\right) \cdot z + y\\
t_2 := \frac{\left(t - a\right) \cdot z + y \cdot x}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(b - y, z, y\right)} \cdot \left(t - a\right)\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, t, \mathsf{fma}\left(z, -a, y \cdot x\right)\right)}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(t - a, z, y \cdot x\right)} \cdot \left(b - y\right), z, \frac{1}{x}\right)}\\
\mathbf{elif}\;t\_2 \leq 10^{+284}:\\
\;\;\;\;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)))) < -inf.0Initial program 26.9%
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--.f6453.7
Applied rewrites53.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2.0000024e-318Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-neg.f6499.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.6
Applied rewrites99.6%
if -2.0000024e-318 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 31.1%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites31.1%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
Applied rewrites97.5%
Taylor expanded in z around 0
lower-/.f6486.9
Applied rewrites86.9%
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.00000000000000008e284Initial program 99.7%
if 1.00000000000000008e284 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.2
Applied rewrites80.2%
Final simplification88.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- t a) z (* y x)))
(t_2 (/ (+ (* (- t a) z) (* y x)) (+ (* (- b y) z) y))))
(if (<= t_2 -5e+290)
(* (/ z (fma (- b y) z y)) (- t a))
(if (<= t_2 1e+284)
(/ 1.0 (fma (* (/ 1.0 t_1) (- b y)) z (/ y t_1)))
(/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((t - a), z, (y * x));
double t_2 = (((t - a) * z) + (y * x)) / (((b - y) * z) + y);
double tmp;
if (t_2 <= -5e+290) {
tmp = (z / fma((b - y), z, y)) * (t - a);
} else if (t_2 <= 1e+284) {
tmp = 1.0 / fma(((1.0 / t_1) * (b - y)), z, (y / t_1));
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(t - a), z, Float64(y * x)) t_2 = Float64(Float64(Float64(Float64(t - a) * z) + Float64(y * x)) / Float64(Float64(Float64(b - y) * z) + y)) tmp = 0.0 if (t_2 <= -5e+290) tmp = Float64(Float64(z / fma(Float64(b - y), z, y)) * Float64(t - a)); elseif (t_2 <= 1e+284) tmp = Float64(1.0 / fma(Float64(Float64(1.0 / t_1) * Float64(b - y)), z, Float64(y / t_1))); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+290], N[(N[(z / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+284], N[(1.0 / N[(N[(N[(1.0 / t$95$1), $MachinePrecision] * N[(b - y), $MachinePrecision]), $MachinePrecision] * z + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - a, z, y \cdot x\right)\\
t_2 := \frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+290}:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(b - y, z, y\right)} \cdot \left(t - a\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+284}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\frac{1}{t\_1} \cdot \left(b - y\right), z, \frac{y}{t\_1}\right)}\\
\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)))) < -4.9999999999999998e290Initial program 28.9%
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--.f6455.0
Applied rewrites55.0%
if -4.9999999999999998e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.00000000000000008e284Initial program 92.6%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites91.3%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
Applied rewrites96.1%
if 1.00000000000000008e284 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.2
Applied rewrites80.2%
Final simplification87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.2e+30)
t_1
(if (<= z 7.8e+126)
(/ (fma z t (fma z (- a) (* 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 <= -9.2e+30) {
tmp = t_1;
} else if (z <= 7.8e+126) {
tmp = fma(z, t, fma(z, -a, (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 <= -9.2e+30) tmp = t_1; elseif (z <= 7.8e+126) tmp = Float64(fma(z, t, fma(z, Float64(-a), 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+30], t$95$1, If[LessEqual[z, 7.8e+126], N[(N[(z * t + N[(z * (-a) + N[(y * x), $MachinePrecision]), $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 -9.2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+126}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, t, \mathsf{fma}\left(z, -a, y \cdot x\right)\right)}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.2e30 or 7.79999999999999986e126 < z Initial program 39.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.5
Applied rewrites84.5%
if -9.2e30 < z < 7.79999999999999986e126Initial program 86.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-neg.f6486.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6486.1
Applied rewrites86.1%
Final simplification85.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.2e+30)
t_1
(if (<= z 7.8e+126)
(/ (+ (* (- 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 <= -9.2e+30) {
tmp = t_1;
} else if (z <= 7.8e+126) {
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 <= (-9.2d+30)) then
tmp = t_1
else if (z <= 7.8d+126) 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 <= -9.2e+30) {
tmp = t_1;
} else if (z <= 7.8e+126) {
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 <= -9.2e+30: tmp = t_1 elif z <= 7.8e+126: 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 <= -9.2e+30) tmp = t_1; elseif (z <= 7.8e+126) 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 <= -9.2e+30) tmp = t_1; elseif (z <= 7.8e+126) 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, -9.2e+30], t$95$1, If[LessEqual[z, 7.8e+126], 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 -9.2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+126}:\\
\;\;\;\;\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 < -9.2e30 or 7.79999999999999986e126 < z Initial program 39.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.5
Applied rewrites84.5%
if -9.2e30 < z < 7.79999999999999986e126Initial program 86.1%
Final simplification85.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.45e-13)
t_1
(if (<= z -1.35e-134)
(fma (- (+ (/ t y) x) (/ a y)) z x)
(if (<= z 4e+39) (/ (fma t z (* y x)) (fma (- 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 <= -1.45e-13) {
tmp = t_1;
} else if (z <= -1.35e-134) {
tmp = fma((((t / y) + x) - (a / y)), z, x);
} else if (z <= 4e+39) {
tmp = fma(t, z, (y * x)) / fma((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 <= -1.45e-13) tmp = t_1; elseif (z <= -1.35e-134) tmp = fma(Float64(Float64(Float64(t / y) + x) - Float64(a / y)), z, x); elseif (z <= 4e+39) tmp = Float64(fma(t, z, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e-13], t$95$1, If[LessEqual[z, -1.35e-134], N[(N[(N[(N[(t / y), $MachinePrecision] + x), $MachinePrecision] - N[(a / y), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[z, 4e+39], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-134}:\\
\;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} + x\right) - \frac{a}{y}, z, x\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+39}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.4499999999999999e-13 or 3.99999999999999976e39 < z Initial program 50.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.6
Applied rewrites79.6%
if -1.4499999999999999e-13 < z < -1.3499999999999999e-134Initial program 82.9%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in z around 0
Applied rewrites67.4%
if -1.3499999999999999e-134 < z < 3.99999999999999976e39Initial program 88.7%
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--.f6477.0
Applied rewrites77.0%
Final simplification77.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.08e-16)
t_1
(if (<= z -8.5e-102)
(* (/ 1.0 y) (fma (- t a) z (* y x)))
(if (<= z 1.76e-15) (* (/ 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 <= -1.08e-16) {
tmp = t_1;
} else if (z <= -8.5e-102) {
tmp = (1.0 / y) * fma((t - a), z, (y * x));
} else if (z <= 1.76e-15) {
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 <= -1.08e-16) tmp = t_1; elseif (z <= -8.5e-102) tmp = Float64(Float64(1.0 / y) * fma(Float64(t - a), z, Float64(y * x))); elseif (z <= 1.76e-15) 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, -1.08e-16], t$95$1, If[LessEqual[z, -8.5e-102], N[(N[(1.0 / y), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.76e-15], 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 -1.08 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{y} \cdot \mathsf{fma}\left(t - a, z, y \cdot x\right)\\
\mathbf{elif}\;z \leq 1.76 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.08e-16 or 1.76e-15 < z Initial program 53.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.9
Applied rewrites77.9%
if -1.08e-16 < z < -8.49999999999999973e-102Initial program 95.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites95.3%
Taylor expanded in z around 0
lower-/.f6463.6
Applied rewrites63.6%
if -8.49999999999999973e-102 < z < 1.76e-15Initial program 84.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--.f6472.6
Applied rewrites72.6%
Final simplification74.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4.5e-13)
t_1
(if (<= z 4e+39) (/ (fma t z (* y x)) (fma (- b y) z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4.5e-13) {
tmp = t_1;
} else if (z <= 4e+39) {
tmp = fma(t, z, (y * x)) / fma((b - y), z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.5e-13) tmp = t_1; elseif (z <= 4e+39) tmp = Float64(fma(t, z, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e-13], t$95$1, If[LessEqual[z, 4e+39], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+39}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.5e-13 or 3.99999999999999976e39 < z Initial program 50.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.6
Applied rewrites79.6%
if -4.5e-13 < z < 3.99999999999999976e39Initial program 87.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--.f6471.3
Applied rewrites71.3%
Final simplification75.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.05e-16)
t_1
(if (<= z 1.76e-15) (* (/ 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 <= -1.05e-16) {
tmp = t_1;
} else if (z <= 1.76e-15) {
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 <= -1.05e-16) tmp = t_1; elseif (z <= 1.76e-15) 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, -1.05e-16], t$95$1, If[LessEqual[z, 1.76e-15], 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 -1.05 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.76 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0500000000000001e-16 or 1.76e-15 < z Initial program 53.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.9
Applied rewrites77.9%
if -1.0500000000000001e-16 < z < 1.76e-15Initial program 86.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--.f6467.4
Applied rewrites67.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -1.3e-17) t_1 (if (<= z 1.6e-15) (fma x z x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.3e-17) {
tmp = t_1;
} else if (z <= 1.6e-15) {
tmp = fma(x, z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.3e-17) tmp = t_1; elseif (z <= 1.6e-15) 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[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e-17], t$95$1, If[LessEqual[z, 1.6e-15], N[(x * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.30000000000000002e-17 or 1.6e-15 < z Initial program 53.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.9
Applied rewrites77.9%
if -1.30000000000000002e-17 < z < 1.6e-15Initial program 86.4%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6455.3
Applied rewrites55.3%
Taylor expanded in z around 0
Applied rewrites55.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -5.5e-55) t_1 (if (<= y 1.15e-48) (/ (- 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 <= -5.5e-55) {
tmp = t_1;
} else if (y <= 1.15e-48) {
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 <= (-5.5d-55)) then
tmp = t_1
else if (y <= 1.15d-48) 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 <= -5.5e-55) {
tmp = t_1;
} else if (y <= 1.15e-48) {
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 <= -5.5e-55: tmp = t_1 elif y <= 1.15e-48: 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 <= -5.5e-55) tmp = t_1; elseif (y <= 1.15e-48) 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 <= -5.5e-55) tmp = t_1; elseif (y <= 1.15e-48) 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, -5.5e-55], t$95$1, If[LessEqual[y, 1.15e-48], 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 -5.5 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-48}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.4999999999999999e-55 or 1.15e-48 < y Initial program 60.9%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6453.5
Applied rewrites53.5%
if -5.4999999999999999e-55 < y < 1.15e-48Initial program 82.2%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6460.8
Applied rewrites60.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- z)))) (if (<= z -3700.0) t_1 (if (<= z 1.65e+29) (fma x z x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / -z;
double tmp;
if (z <= -3700.0) {
tmp = t_1;
} else if (z <= 1.65e+29) {
tmp = fma(x, z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(-z)) tmp = 0.0 if (z <= -3700.0) tmp = t_1; elseif (z <= 1.65e+29) 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[(x / (-z)), $MachinePrecision]}, If[LessEqual[z, -3700.0], t$95$1, If[LessEqual[z, 1.65e+29], N[(x * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{-z}\\
\mathbf{if}\;z \leq -3700:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3700 or 1.64999999999999992e29 < z Initial program 49.5%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6420.0
Applied rewrites20.0%
Taylor expanded in z around inf
Applied rewrites19.5%
if -3700 < z < 1.64999999999999992e29Initial program 87.4%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in z around 0
Applied rewrites51.1%
(FPCore (x y z t a b) :precision binary64 (/ x (- 1.0 z)))
double code(double x, double y, double z, double t, double a, double b) {
return x / (1.0 - 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 / (1.0d0 - z)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / (1.0 - z);
}
def code(x, y, z, t, a, b): return x / (1.0 - z)
function code(x, y, z, t, a, b) return Float64(x / Float64(1.0 - z)) end
function tmp = code(x, y, z, t, a, b) tmp = x / (1.0 - z); end
code[x_, y_, z_, t_, a_, b_] := N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{1 - z}
\end{array}
Initial program 69.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6436.6
Applied rewrites36.6%
(FPCore (x y z t a b) :precision binary64 (fma (fma x z x) z x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(fma(x, z, x), z, x);
}
function code(x, y, z, t, a, b) return fma(fma(x, z, x), z, x) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * z + x), $MachinePrecision] * z + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(x, z, x\right), z, x\right)
\end{array}
Initial program 69.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6436.6
Applied rewrites36.6%
Taylor expanded in z around 0
Applied rewrites29.4%
(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
mul-1-negN/A
unsub-negN/A
lower--.f6436.6
Applied rewrites36.6%
Taylor expanded in z around 0
Applied rewrites29.0%
(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 69.8%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6445.3
Applied rewrites45.3%
Taylor expanded in x around inf
Applied rewrites35.0%
Taylor expanded in z around 0
Applied rewrites29.0%
Final simplification29.0%
(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 69.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6436.6
Applied rewrites36.6%
Taylor expanded in z around 0
Applied rewrites29.0%
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 2024236
(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)))))