
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
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 + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
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 + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (/ (* y b) t)))
(t_2 (/ (+ x (/ (* y z) t)) t_1))
(t_3
(fma
z
(/ y (fma a t (fma b y t)))
(/ x (fma (/ y t) b (- a -1.0))))))
(if (<= t_2 -1e-45)
t_3
(if (<= t_2 -5e-302)
(/ (fma (/ z t) y x) t_1)
(if (<= t_2 0.0)
(/ (fma x (/ t y) z) b)
(if (<= t_2 1e+159)
t_2
(if (<= t_2 INFINITY) t_3 (/ z b))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double t_2 = (x + ((y * z) / t)) / t_1;
double t_3 = fma(z, (y / fma(a, t, fma(b, y, t))), (x / fma((y / t), b, (a - -1.0))));
double tmp;
if (t_2 <= -1e-45) {
tmp = t_3;
} else if (t_2 <= -5e-302) {
tmp = fma((z / t), y, x) / t_1;
} else if (t_2 <= 0.0) {
tmp = fma(x, (t / y), z) / b;
} else if (t_2 <= 1e+159) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_1) t_3 = fma(z, Float64(y / fma(a, t, fma(b, y, t))), Float64(x / fma(Float64(y / t), b, Float64(a - -1.0)))) tmp = 0.0 if (t_2 <= -1e-45) tmp = t_3; elseif (t_2 <= -5e-302) tmp = Float64(fma(Float64(z / t), y, x) / t_1); elseif (t_2 <= 0.0) tmp = Float64(fma(x, Float64(t / y), z) / b); elseif (t_2 <= 1e+159) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(y / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-45], t$95$3, If[LessEqual[t$95$2, -5e-302], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(x * N[(t / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$2, 1e+159], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(z / b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_1 := \left(a + 1\right) + \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t\_1}\\
t_3 := \mathsf{fma}\left(z, \frac{y}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}, \frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-45}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-302}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_2 \leq 10^{+159}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -9.9999999999999998e-46 or 9.9999999999999993e158 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.7%
Applied rewrites88.0%
if -9.9999999999999998e-46 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000003e-302Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6474.4%
Applied rewrites74.4%
if -5.0000000000000003e-302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6441.9%
Applied rewrites41.9%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 9.9999999999999993e158Initial program 75.7%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.7%
Taylor expanded in y around inf
lower-/.f6434.0%
Applied rewrites34.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (fma a t (fma b y t)))
(t_3 (/ x (fma (/ y t) b (- a -1.0)))))
(if (<= t_1 -5e-302)
(fma (/ z t_2) y t_3)
(if (<= t_1 0.0)
(/ (fma x (/ t y) z) b)
(if (<= t_1 1e+159)
t_1
(if (<= t_1 INFINITY) (fma z (/ y t_2) t_3) (/ z b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = fma(a, t, fma(b, y, t));
double t_3 = x / fma((y / t), b, (a - -1.0));
double tmp;
if (t_1 <= -5e-302) {
tmp = fma((z / t_2), y, t_3);
} else if (t_1 <= 0.0) {
tmp = fma(x, (t / y), z) / b;
} else if (t_1 <= 1e+159) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma(z, (y / t_2), t_3);
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = fma(a, t, fma(b, y, t)) t_3 = Float64(x / fma(Float64(y / t), b, Float64(a - -1.0))) tmp = 0.0 if (t_1 <= -5e-302) tmp = fma(Float64(z / t_2), y, t_3); elseif (t_1 <= 0.0) tmp = Float64(fma(x, Float64(t / y), z) / b); elseif (t_1 <= 1e+159) tmp = t_1; elseif (t_1 <= Inf) tmp = fma(z, Float64(y / t_2), t_3); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-302], N[(N[(z / t$95$2), $MachinePrecision] * y + t$95$3), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(x * N[(t / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 1e+159], t$95$1, If[LessEqual[t$95$1, Infinity], N[(z * N[(y / t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)\\
t_3 := \frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t\_2}, y, t\_3\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_1 \leq 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{t\_2}, t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000003e-302Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.9%
if -5.0000000000000003e-302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6441.9%
Applied rewrites41.9%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 9.9999999999999993e158Initial program 75.7%
if 9.9999999999999993e158 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.7%
Applied rewrites88.0%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.7%
Taylor expanded in y around inf
lower-/.f6434.0%
Applied rewrites34.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(fma (/ z (fma a t (fma b y t))) y (/ x a))
(if (<= t_1 -5e-302)
t_1
(if (<= t_1 0.0)
(/ (fma x (/ t y) z) b)
(if (<= t_1 4e+278)
t_1
(fma z (/ 1.0 b) (/ x (fma (/ y t) b (- a -1.0))))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma((z / fma(a, t, fma(b, y, t))), y, (x / a));
} else if (t_1 <= -5e-302) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = fma(x, (t / y), z) / b;
} else if (t_1 <= 4e+278) {
tmp = t_1;
} else {
tmp = fma(z, (1.0 / b), (x / fma((y / t), b, (a - -1.0))));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(Float64(z / fma(a, t, fma(b, y, t))), y, Float64(x / a)); elseif (t_1 <= -5e-302) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(fma(x, Float64(t / y), z) / b); elseif (t_1 <= 4e+278) tmp = t_1; else tmp = fma(z, Float64(1.0 / b), Float64(x / fma(Float64(y / t), b, Float64(a - -1.0)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-302], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(x * N[(t / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 4e+278], t$95$1, N[(z * N[(1.0 / b), $MachinePrecision] + N[(x / N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}, y, \frac{x}{a}\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+278}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{1}{b}, \frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\right)\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.9%
Taylor expanded in a around inf
lower-/.f6446.4%
Applied rewrites46.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000003e-302 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 3.9999999999999999e278Initial program 75.7%
if -5.0000000000000003e-302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6441.9%
Applied rewrites41.9%
if 3.9999999999999999e278 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in y around inf
lower-/.f6459.0%
Applied rewrites59.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (/ (* y b) t)))
(t_2 (/ (fma (/ z t) y x) t_1))
(t_3 (/ (+ x (/ (* y z) t)) t_1)))
(if (<= t_3 (- INFINITY))
(fma (/ z (fma a t (fma b y t))) y (/ x a))
(if (<= t_3 -5e-302)
t_2
(if (<= t_3 0.0)
(/ (fma x (/ t y) z) b)
(if (<= t_3 INFINITY) t_2 (/ z b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double t_2 = fma((z / t), y, x) / t_1;
double t_3 = (x + ((y * z) / t)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = fma((z / fma(a, t, fma(b, y, t))), y, (x / a));
} else if (t_3 <= -5e-302) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = fma(x, (t / y), z) / b;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)) t_2 = Float64(fma(Float64(z / t), y, x) / t_1) t_3 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = fma(Float64(z / fma(a, t, fma(b, y, t))), y, Float64(x / a)); elseif (t_3 <= -5e-302) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(fma(x, Float64(t / y), z) / b); elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(z / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-302], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(x * N[(t / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$2, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \left(a + 1\right) + \frac{y \cdot b}{t}\\
t_2 := \frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{t\_1}\\
t_3 := \frac{x + \frac{y \cdot z}{t}}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}, y, \frac{x}{a}\right)\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-302}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.9%
Taylor expanded in a around inf
lower-/.f6446.4%
Applied rewrites46.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000003e-302 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6474.4%
Applied rewrites74.4%
if -5.0000000000000003e-302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6441.9%
Applied rewrites41.9%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.7%
Taylor expanded in y around inf
lower-/.f6434.0%
Applied rewrites34.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ y t) b (- a -1.0)))
(t_2 (+ x (/ (* y z) t)))
(t_3 (/ t_2 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_3 (- INFINITY))
(fma (/ z (fma a t (fma b y t))) y (/ x a))
(if (<= t_3 -5e-302)
(/ (fma (/ y t) z x) t_1)
(if (<= t_3 0.0)
(/ (fma x (/ t y) z) b)
(if (<= t_3 4e+278)
(/ t_2 (fma (/ b t) y (- a -1.0)))
(fma z (/ 1.0 b) (/ x t_1))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((y / t), b, (a - -1.0));
double t_2 = x + ((y * z) / t);
double t_3 = t_2 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = fma((z / fma(a, t, fma(b, y, t))), y, (x / a));
} else if (t_3 <= -5e-302) {
tmp = fma((y / t), z, x) / t_1;
} else if (t_3 <= 0.0) {
tmp = fma(x, (t / y), z) / b;
} else if (t_3 <= 4e+278) {
tmp = t_2 / fma((b / t), y, (a - -1.0));
} else {
tmp = fma(z, (1.0 / b), (x / t_1));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(y / t), b, Float64(a - -1.0)) t_2 = Float64(x + Float64(Float64(y * z) / t)) t_3 = Float64(t_2 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = fma(Float64(z / fma(a, t, fma(b, y, t))), y, Float64(x / a)); elseif (t_3 <= -5e-302) tmp = Float64(fma(Float64(y / t), z, x) / t_1); elseif (t_3 <= 0.0) tmp = Float64(fma(x, Float64(t / y), z) / b); elseif (t_3 <= 4e+278) tmp = Float64(t_2 / fma(Float64(b / t), y, Float64(a - -1.0))); else tmp = fma(z, Float64(1.0 / b), Float64(x / t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(z / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-302], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(x * N[(t / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$3, 4e+278], N[(t$95$2 / N[(N[(b / t), $MachinePrecision] * y + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(1.0 / b), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)\\
t_2 := x + \frac{y \cdot z}{t}\\
t_3 := \frac{t\_2}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}, y, \frac{x}{a}\right)\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-302}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{t\_1}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+278}:\\
\;\;\;\;\frac{t\_2}{\mathsf{fma}\left(\frac{b}{t}, y, a - -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{1}{b}, \frac{x}{t\_1}\right)\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.9%
Taylor expanded in a around inf
lower-/.f6446.4%
Applied rewrites46.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000003e-302Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6475.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.3%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval77.3%
Applied rewrites77.3%
if -5.0000000000000003e-302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6441.9%
Applied rewrites41.9%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 3.9999999999999999e278Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6474.6%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval74.6%
Applied rewrites74.6%
if 3.9999999999999999e278 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in y around inf
lower-/.f6459.0%
Applied rewrites59.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma (/ y t) z x) (fma (/ y t) b (- a -1.0))))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 (- INFINITY))
(fma (/ z (fma a t (fma b y t))) y (/ x a))
(if (<= t_2 -5e-302)
t_1
(if (<= t_2 0.0)
(/ (fma x (/ t y) z) b)
(if (<= t_2 INFINITY) t_1 (/ z b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((y / t), z, x) / fma((y / t), b, (a - -1.0));
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma((z / fma(a, t, fma(b, y, t))), y, (x / a));
} else if (t_2 <= -5e-302) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(x, (t / y), z) / b;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(y / t), z, x) / fma(Float64(y / t), b, Float64(a - -1.0))) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(Float64(z / fma(a, t, fma(b, y, t))), y, Float64(x / a)); elseif (t_2 <= -5e-302) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(fma(x, Float64(t / y), z) / b); elseif (t_2 <= Inf) tmp = t_1; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-302], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(x * N[(t / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$1, N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}, y, \frac{x}{a}\right)\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.9%
Taylor expanded in a around inf
lower-/.f6446.4%
Applied rewrites46.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000003e-302 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6475.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.3%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval77.3%
Applied rewrites77.3%
if -5.0000000000000003e-302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6441.9%
Applied rewrites41.9%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.7%
Taylor expanded in y around inf
lower-/.f6434.0%
Applied rewrites34.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (fma a t (fma b y t))))
(if (<= t_1 (- INFINITY))
(fma (/ z t_2) y (/ x a))
(if (<= t_1 4e+213)
(/ (fma t x (* z y)) t_2)
(if (<= t_1 INFINITY)
(fma (/ z t) (/ y (+ 1.0 a)) (/ x (+ 1.0 a)))
(/ z b))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = fma(a, t, fma(b, y, t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma((z / t_2), y, (x / a));
} else if (t_1 <= 4e+213) {
tmp = fma(t, x, (z * y)) / t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma((z / t), (y / (1.0 + a)), (x / (1.0 + a)));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = fma(a, t, fma(b, y, t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(Float64(z / t_2), y, Float64(x / a)); elseif (t_1 <= 4e+213) tmp = Float64(fma(t, x, Float64(z * y)) / t_2); elseif (t_1 <= Inf) tmp = fma(Float64(z / t), Float64(y / Float64(1.0 + a)), Float64(x / Float64(1.0 + a))); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z / t$95$2), $MachinePrecision] * y + N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+213], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(z / t), $MachinePrecision] * N[(y / N[(1.0 + a), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t\_2}, y, \frac{x}{a}\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+213}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{t\_2}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{1 + a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.9%
Taylor expanded in a around inf
lower-/.f6446.4%
Applied rewrites46.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 3.9999999999999999e213Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6464.8%
lower-unsound-/.f64N/A
*-lft-identityN/A
lower-unsound-+.f64N/A
Applied rewrites70.6%
if 3.9999999999999999e213 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites75.3%
Taylor expanded in y around 0
lower-+.f6462.0%
Applied rewrites62.0%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.7%
Taylor expanded in y around inf
lower-/.f6434.0%
Applied rewrites34.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (fma a t (fma b y t))))
(if (<= t_1 (- INFINITY))
(fma z (/ y t_2) (/ x a))
(if (<= t_1 4e+213)
(/ (fma t x (* z y)) t_2)
(if (<= t_1 INFINITY)
(fma (/ z t) (/ y (+ 1.0 a)) (/ x (+ 1.0 a)))
(/ z b))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = fma(a, t, fma(b, y, t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(z, (y / t_2), (x / a));
} else if (t_1 <= 4e+213) {
tmp = fma(t, x, (z * y)) / t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma((z / t), (y / (1.0 + a)), (x / (1.0 + a)));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = fma(a, t, fma(b, y, t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(z, Float64(y / t_2), Float64(x / a)); elseif (t_1 <= 4e+213) tmp = Float64(fma(t, x, Float64(z * y)) / t_2); elseif (t_1 <= Inf) tmp = fma(Float64(z / t), Float64(y / Float64(1.0 + a)), Float64(x / Float64(1.0 + a))); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(y / t$95$2), $MachinePrecision] + N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+213], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(z / t), $MachinePrecision] * N[(y / N[(1.0 + a), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{t\_2}, \frac{x}{a}\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+213}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{t\_2}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{1 + a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in a around inf
lower-/.f6447.8%
Applied rewrites47.8%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 3.9999999999999999e213Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6464.8%
lower-unsound-/.f64N/A
*-lft-identityN/A
lower-unsound-+.f64N/A
Applied rewrites70.6%
if 3.9999999999999999e213 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites75.3%
Taylor expanded in y around 0
lower-+.f6462.0%
Applied rewrites62.0%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.7%
Taylor expanded in y around inf
lower-/.f6434.0%
Applied rewrites34.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 4e+213)
(/ (fma t x (* z y)) (fma a t (fma b y t)))
(if (<= t_1 INFINITY)
(fma (/ z t) (/ y (+ 1.0 a)) (/ x (+ 1.0 a)))
(/ z b)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= 4e+213) {
tmp = fma(t, x, (z * y)) / fma(a, t, fma(b, y, t));
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma((z / t), (y / (1.0 + a)), (x / (1.0 + a)));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= 4e+213) tmp = Float64(fma(t, x, Float64(z * y)) / fma(a, t, fma(b, y, t))); elseif (t_1 <= Inf) tmp = fma(Float64(z / t), Float64(y / Float64(1.0 + a)), Float64(x / Float64(1.0 + a))); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e+213], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(z / t), $MachinePrecision] * N[(y / N[(1.0 + a), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{+213}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{1 + a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 3.9999999999999999e213Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6464.8%
lower-unsound-/.f64N/A
*-lft-identityN/A
lower-unsound-+.f64N/A
Applied rewrites70.6%
if 3.9999999999999999e213 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 75.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites75.3%
Taylor expanded in y around 0
lower-+.f6462.0%
Applied rewrites62.0%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 75.7%
Taylor expanded in y around inf
lower-/.f6434.0%
Applied rewrites34.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1e-8)
(/ (+ z (/ (* t x) y)) b)
(if (<= y 2.2e-74)
(/ (+ x (/ (* y z) t)) (+ 1.0 a))
(if (<= y 1.2e+49)
(/ (* y z) (+ t (fma a t (* b y))))
(/ (fma (/ x y) t z) b)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1e-8) {
tmp = (z + ((t * x) / y)) / b;
} else if (y <= 2.2e-74) {
tmp = (x + ((y * z) / t)) / (1.0 + a);
} else if (y <= 1.2e+49) {
tmp = (y * z) / (t + fma(a, t, (b * y)));
} else {
tmp = fma((x / y), t, z) / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1e-8) tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b); elseif (y <= 2.2e-74) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(1.0 + a)); elseif (y <= 1.2e+49) tmp = Float64(Float64(y * z) / Float64(t + fma(a, t, Float64(b * y)))); else tmp = Float64(fma(Float64(x / y), t, z) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1e-8], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 2.2e-74], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+49], N[(N[(y * z), $MachinePrecision] / N[(t + N[(a * t + N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] * t + z), $MachinePrecision] / b), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-8}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-74}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{1 + a}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{y \cdot z}{t + \mathsf{fma}\left(a, t, b \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b}\\
\end{array}
if y < -1e-8Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
if -1e-8 < y < 2.2000000000000001e-74Initial program 75.7%
Taylor expanded in y around 0
lower-+.f6456.4%
Applied rewrites56.4%
if 2.2000000000000001e-74 < y < 1.2e49Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-*.f6441.9%
Applied rewrites41.9%
if 1.2e49 < y Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1e-8)
(/ (+ z (/ (* t x) y)) b)
(if (<= y 5.4e+45)
(/ (+ x (/ (* y z) t)) (+ 1.0 a))
(/ (fma (/ x y) t z) b))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1e-8) {
tmp = (z + ((t * x) / y)) / b;
} else if (y <= 5.4e+45) {
tmp = (x + ((y * z) / t)) / (1.0 + a);
} else {
tmp = fma((x / y), t, z) / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1e-8) tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b); elseif (y <= 5.4e+45) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(1.0 + a)); else tmp = Float64(fma(Float64(x / y), t, z) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1e-8], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 5.4e+45], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] * t + z), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-8}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+45}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b}\\
\end{array}
if y < -1e-8Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
if -1e-8 < y < 5.3999999999999997e45Initial program 75.7%
Taylor expanded in y around 0
lower-+.f6456.4%
Applied rewrites56.4%
if 5.3999999999999997e45 < y Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1e-8)
(/ (+ z (/ (* t x) y)) b)
(if (<= y 4e-74)
(/ x (+ 1.0 (+ a (/ (* b y) t))))
(/ (fma (/ x y) t z) b))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1e-8) {
tmp = (z + ((t * x) / y)) / b;
} else if (y <= 4e-74) {
tmp = x / (1.0 + (a + ((b * y) / t)));
} else {
tmp = fma((x / y), t, z) / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1e-8) tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b); elseif (y <= 4e-74) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(b * y) / t)))); else tmp = Float64(fma(Float64(x / y), t, z) / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1e-8], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 4e-74], N[(x / N[(1.0 + N[(a + N[(N[(b * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] * t + z), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-8}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b}\\
\end{array}
if y < -1e-8Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
if -1e-8 < y < 3.9999999999999998e-74Initial program 75.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6451.6%
Applied rewrites51.6%
if 3.9999999999999998e-74 < y Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (+ z (/ (* t x) y)) b))) (if (<= y -7.4e-110) t_1 (if (<= y 4.1e-116) (/ x (+ 1.0 a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + ((t * x) / y)) / b;
double tmp;
if (y <= -7.4e-110) {
tmp = t_1;
} else if (y <= 4.1e-116) {
tmp = x / (1.0 + a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
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 = (z + ((t * x) / y)) / b
if (y <= (-7.4d-110)) then
tmp = t_1
else if (y <= 4.1d-116) then
tmp = x / (1.0d0 + a)
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 = (z + ((t * x) / y)) / b;
double tmp;
if (y <= -7.4e-110) {
tmp = t_1;
} else if (y <= 4.1e-116) {
tmp = x / (1.0 + a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + ((t * x) / y)) / b tmp = 0 if y <= -7.4e-110: tmp = t_1 elif y <= 4.1e-116: tmp = x / (1.0 + a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + Float64(Float64(t * x) / y)) / b) tmp = 0.0 if (y <= -7.4e-110) tmp = t_1; elseif (y <= 4.1e-116) tmp = Float64(x / Float64(1.0 + a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + ((t * x) / y)) / b; tmp = 0.0; if (y <= -7.4e-110) tmp = t_1; elseif (y <= 4.1e-116) tmp = x / (1.0 + a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -7.4e-110], t$95$1, If[LessEqual[y, 4.1e-116], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{z + \frac{t \cdot x}{y}}{b}\\
\mathbf{if}\;y \leq -7.4 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-116}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -7.4000000000000003e-110 or 4.0999999999999999e-116 < y Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
if -7.4000000000000003e-110 < y < 4.0999999999999999e-116Initial program 75.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.6%
Applied rewrites41.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (fma (/ x y) t z) b))) (if (<= y -7.4e-110) t_1 (if (<= y 4.1e-116) (/ x (+ 1.0 a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((x / y), t, z) / b;
double tmp;
if (y <= -7.4e-110) {
tmp = t_1;
} else if (y <= 4.1e-116) {
tmp = x / (1.0 + a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(x / y), t, z) / b) tmp = 0.0 if (y <= -7.4e-110) tmp = t_1; elseif (y <= 4.1e-116) tmp = Float64(x / Float64(1.0 + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x / y), $MachinePrecision] * t + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -7.4e-110], t$95$1, If[LessEqual[y, 4.1e-116], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b}\\
\mathbf{if}\;y \leq -7.4 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-116}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -7.4000000000000003e-110 or 4.0999999999999999e-116 < y Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6440.7%
Applied rewrites40.7%
if -7.4000000000000003e-110 < y < 4.0999999999999999e-116Initial program 75.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.6%
Applied rewrites41.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (fma x (/ t y) z) b))) (if (<= y -7.4e-110) t_1 (if (<= y 4.1e-116) (/ x (+ 1.0 a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(x, (t / y), z) / b;
double tmp;
if (y <= -7.4e-110) {
tmp = t_1;
} else if (y <= 4.1e-116) {
tmp = x / (1.0 + a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(x, Float64(t / y), z) / b) tmp = 0.0 if (y <= -7.4e-110) tmp = t_1; elseif (y <= 4.1e-116) tmp = Float64(x / Float64(1.0 + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[(t / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -7.4e-110], t$95$1, If[LessEqual[y, 4.1e-116], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -7.4 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-116}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -7.4000000000000003e-110 or 4.0999999999999999e-116 < y Initial program 75.7%
Applied rewrites88.0%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6441.9%
Applied rewrites41.9%
if -7.4000000000000003e-110 < y < 4.0999999999999999e-116Initial program 75.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.6%
Applied rewrites41.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.5e-110) (/ z b) (if (<= y 1.62e-74) (/ x (+ 1.0 a)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.5e-110) {
tmp = z / b;
} else if (y <= 1.62e-74) {
tmp = x / (1.0 + a);
} else {
tmp = z / b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
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-110)) then
tmp = z / b
else if (y <= 1.62d-74) then
tmp = x / (1.0d0 + a)
else
tmp = z / 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-110) {
tmp = z / b;
} else if (y <= 1.62e-74) {
tmp = x / (1.0 + a);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.5e-110: tmp = z / b elif y <= 1.62e-74: tmp = x / (1.0 + a) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.5e-110) tmp = Float64(z / b); elseif (y <= 1.62e-74) tmp = Float64(x / Float64(1.0 + a)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.5e-110) tmp = z / b; elseif (y <= 1.62e-74) tmp = x / (1.0 + a); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.5e-110], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.62e-74], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-110}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.62 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if y < -4.5000000000000001e-110 or 1.6200000000000001e-74 < y Initial program 75.7%
Taylor expanded in y around inf
lower-/.f6434.0%
Applied rewrites34.0%
if -4.5000000000000001e-110 < y < 1.6200000000000001e-74Initial program 75.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.6%
Applied rewrites41.6%
(FPCore (x y z t a b) :precision binary64 (/ z b))
double code(double x, double y, double z, double t, double a, double b) {
return z / b;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
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 / b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z / b;
}
def code(x, y, z, t, a, b): return z / b
function code(x, y, z, t, a, b) return Float64(z / b) end
function tmp = code(x, y, z, t, a, b) tmp = z / b; end
code[x_, y_, z_, t_, a_, b_] := N[(z / b), $MachinePrecision]
\frac{z}{b}
Initial program 75.7%
Taylor expanded in y around inf
lower-/.f6434.0%
Applied rewrites34.0%
herbie shell --seed 2025212
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))