
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, c)
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), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, c)
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), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (* y x) 9.0 b)) (t_2 (/ t_1 z)))
(if (<= z -3.5e-8)
(- (/ (fma (* 4.0 a) t (- t_2)) c))
(if (<= z 1.8e-119)
(fma -4.0 (/ (* a t) c) (/ t_1 (* c z)))
(/ (fma (* a t) -4.0 t_2) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((y * x), 9.0, b);
double t_2 = t_1 / z;
double tmp;
if (z <= -3.5e-8) {
tmp = -(fma((4.0 * a), t, -t_2) / c);
} else if (z <= 1.8e-119) {
tmp = fma(-4.0, ((a * t) / c), (t_1 / (c * z)));
} else {
tmp = fma((a * t), -4.0, t_2) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(y * x), 9.0, b) t_2 = Float64(t_1 / z) tmp = 0.0 if (z <= -3.5e-8) tmp = Float64(-Float64(fma(Float64(4.0 * a), t, Float64(-t_2)) / c)); elseif (z <= 1.8e-119) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(t_1 / Float64(c * z))); else tmp = Float64(fma(Float64(a * t), -4.0, t_2) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / z), $MachinePrecision]}, If[LessEqual[z, -3.5e-8], (-N[(N[(N[(4.0 * a), $MachinePrecision] * t + (-t$95$2)), $MachinePrecision] / c), $MachinePrecision]), If[LessEqual[z, 1.8e-119], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(t$95$1 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + t$95$2), $MachinePrecision] / c), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y \cdot x, 9, b\right)\\
t_2 := \frac{t\_1}{z}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-8}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(4 \cdot a, t, -t\_2\right)}{c}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-119}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{t\_1}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, t\_2\right)}{c}\\
\end{array}
\end{array}
if z < -3.50000000000000024e-8Initial program 65.9%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.0
Applied rewrites83.0%
Taylor expanded in c around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites88.9%
if -3.50000000000000024e-8 < z < 1.8e-119Initial program 95.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.5
Applied rewrites86.5%
if 1.8e-119 < z Initial program 72.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.8
Applied rewrites83.8%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6489.1
Applied rewrites89.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma (* y x) 9.0 b) z)))
(if (<= z -5e-8)
(- (/ (fma (* 4.0 a) t (- t_1)) c))
(if (<= z 1.8e-119)
(fma -4.0 (/ (* a t) c) (/ (fma (* 9.0 x) y b) (* c z)))
(/ (fma (* a t) -4.0 t_1) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((y * x), 9.0, b) / z;
double tmp;
if (z <= -5e-8) {
tmp = -(fma((4.0 * a), t, -t_1) / c);
} else if (z <= 1.8e-119) {
tmp = fma(-4.0, ((a * t) / c), (fma((9.0 * x), y, b) / (c * z)));
} else {
tmp = fma((a * t), -4.0, t_1) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fma(Float64(y * x), 9.0, b) / z) tmp = 0.0 if (z <= -5e-8) tmp = Float64(-Float64(fma(Float64(4.0 * a), t, Float64(-t_1)) / c)); elseif (z <= 1.8e-119) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(fma(Float64(9.0 * x), y, b) / Float64(c * z))); else tmp = Float64(fma(Float64(a * t), -4.0, t_1) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -5e-8], (-N[(N[(N[(4.0 * a), $MachinePrecision] * t + (-t$95$1)), $MachinePrecision] / c), $MachinePrecision]), If[LessEqual[z, 1.8e-119], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(N[(N[(9.0 * x), $MachinePrecision] * y + b), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + t$95$1), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\\
\mathbf{if}\;z \leq -5 \cdot 10^{-8}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(4 \cdot a, t, -t\_1\right)}{c}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-119}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, t\_1\right)}{c}\\
\end{array}
\end{array}
if z < -4.9999999999999998e-8Initial program 65.9%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.0
Applied rewrites83.0%
Taylor expanded in c around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites88.9%
if -4.9999999999999998e-8 < z < 1.8e-119Initial program 95.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.5
Applied rewrites86.5%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6486.5
Applied rewrites86.5%
if 1.8e-119 < z Initial program 72.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.8
Applied rewrites83.8%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6489.1
Applied rewrites89.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (* y x) 9.0 b)))
(if (<= c 4e-57)
(/ (fma (* a t) -4.0 (/ t_1 z)) c)
(fma -4.0 (/ (* a t) c) (/ (/ t_1 c) z)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((y * x), 9.0, b);
double tmp;
if (c <= 4e-57) {
tmp = fma((a * t), -4.0, (t_1 / z)) / c;
} else {
tmp = fma(-4.0, ((a * t) / c), ((t_1 / c) / z));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(y * x), 9.0, b) tmp = 0.0 if (c <= 4e-57) tmp = Float64(fma(Float64(a * t), -4.0, Float64(t_1 / z)) / c); else tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(Float64(t_1 / c) / z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]}, If[LessEqual[c, 4e-57], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(N[(t$95$1 / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y \cdot x, 9, b\right)\\
\mathbf{if}\;c \leq 4 \cdot 10^{-57}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{t\_1}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{\frac{t\_1}{c}}{z}\right)\\
\end{array}
\end{array}
if c < 3.99999999999999982e-57Initial program 83.2%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6485.5
Applied rewrites85.5%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6489.5
Applied rewrites89.5%
if 3.99999999999999982e-57 < c Initial program 71.2%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6482.5
Applied rewrites82.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6486.2
Applied rewrites86.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (* y x) 9.0 b)) (t_2 (/ t_1 z)))
(if (<= z -1.15e-48)
(- (/ (fma (* 4.0 a) t (- t_2)) c))
(if (<= z 4.4e-120)
(fma -4.0 (* a (/ t c)) (/ t_1 (* c z)))
(/ (fma (* a t) -4.0 t_2) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((y * x), 9.0, b);
double t_2 = t_1 / z;
double tmp;
if (z <= -1.15e-48) {
tmp = -(fma((4.0 * a), t, -t_2) / c);
} else if (z <= 4.4e-120) {
tmp = fma(-4.0, (a * (t / c)), (t_1 / (c * z)));
} else {
tmp = fma((a * t), -4.0, t_2) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(y * x), 9.0, b) t_2 = Float64(t_1 / z) tmp = 0.0 if (z <= -1.15e-48) tmp = Float64(-Float64(fma(Float64(4.0 * a), t, Float64(-t_2)) / c)); elseif (z <= 4.4e-120) tmp = fma(-4.0, Float64(a * Float64(t / c)), Float64(t_1 / Float64(c * z))); else tmp = Float64(fma(Float64(a * t), -4.0, t_2) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / z), $MachinePrecision]}, If[LessEqual[z, -1.15e-48], (-N[(N[(N[(4.0 * a), $MachinePrecision] * t + (-t$95$2)), $MachinePrecision] / c), $MachinePrecision]), If[LessEqual[z, 4.4e-120], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + t$95$2), $MachinePrecision] / c), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y \cdot x, 9, b\right)\\
t_2 := \frac{t\_1}{z}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-48}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(4 \cdot a, t, -t\_2\right)}{c}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-120}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot \frac{t}{c}, \frac{t\_1}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, t\_2\right)}{c}\\
\end{array}
\end{array}
if z < -1.15e-48Initial program 68.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.8
Applied rewrites83.8%
Taylor expanded in c around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites89.3%
if -1.15e-48 < z < 4.40000000000000025e-120Initial program 95.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.1
Applied rewrites86.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6487.0
Applied rewrites87.0%
if 4.40000000000000025e-120 < z Initial program 72.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.8
Applied rewrites83.8%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6489.1
Applied rewrites89.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (* y x) 9.0 b)) (t_2 (/ t_1 z)))
(if (<= z -1.22e-85)
(- (/ (fma (* 4.0 a) t (- t_2)) c))
(if (<= z 4.2e-242) (/ t_1 (* z c)) (/ (fma (* a t) -4.0 t_2) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((y * x), 9.0, b);
double t_2 = t_1 / z;
double tmp;
if (z <= -1.22e-85) {
tmp = -(fma((4.0 * a), t, -t_2) / c);
} else if (z <= 4.2e-242) {
tmp = t_1 / (z * c);
} else {
tmp = fma((a * t), -4.0, t_2) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(y * x), 9.0, b) t_2 = Float64(t_1 / z) tmp = 0.0 if (z <= -1.22e-85) tmp = Float64(-Float64(fma(Float64(4.0 * a), t, Float64(-t_2)) / c)); elseif (z <= 4.2e-242) tmp = Float64(t_1 / Float64(z * c)); else tmp = Float64(fma(Float64(a * t), -4.0, t_2) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / z), $MachinePrecision]}, If[LessEqual[z, -1.22e-85], (-N[(N[(N[(4.0 * a), $MachinePrecision] * t + (-t$95$2)), $MachinePrecision] / c), $MachinePrecision]), If[LessEqual[z, 4.2e-242], N[(t$95$1 / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + t$95$2), $MachinePrecision] / c), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y \cdot x, 9, b\right)\\
t_2 := \frac{t\_1}{z}\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{-85}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(4 \cdot a, t, -t\_2\right)}{c}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-242}:\\
\;\;\;\;\frac{t\_1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, t\_2\right)}{c}\\
\end{array}
\end{array}
if z < -1.22000000000000006e-85Initial program 71.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6484.0
Applied rewrites84.0%
Taylor expanded in c around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites89.2%
if -1.22000000000000006e-85 < z < 4.20000000000000037e-242Initial program 96.3%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6485.5
Applied rewrites85.5%
if 4.20000000000000037e-242 < z Initial program 77.6%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6484.3
Applied rewrites84.3%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6487.7
Applied rewrites87.7%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (fma (* y x) 9.0 b)) (t_2 (/ (fma (* a t) -4.0 (/ t_1 z)) c))) (if (<= z -1.22e-85) t_2 (if (<= z 4.2e-242) (/ t_1 (* z c)) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((y * x), 9.0, b);
double t_2 = fma((a * t), -4.0, (t_1 / z)) / c;
double tmp;
if (z <= -1.22e-85) {
tmp = t_2;
} else if (z <= 4.2e-242) {
tmp = t_1 / (z * c);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(y * x), 9.0, b) t_2 = Float64(fma(Float64(a * t), -4.0, Float64(t_1 / z)) / c) tmp = 0.0 if (z <= -1.22e-85) tmp = t_2; elseif (z <= 4.2e-242) tmp = Float64(t_1 / Float64(z * c)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.22e-85], t$95$2, If[LessEqual[z, 4.2e-242], N[(t$95$1 / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y \cdot x, 9, b\right)\\
t_2 := \frac{\mathsf{fma}\left(a \cdot t, -4, \frac{t\_1}{z}\right)}{c}\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{-85}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-242}:\\
\;\;\;\;\frac{t\_1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.22000000000000006e-85 or 4.20000000000000037e-242 < z Initial program 74.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6484.2
Applied rewrites84.2%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6488.3
Applied rewrites88.3%
if -1.22000000000000006e-85 < z < 4.20000000000000037e-242Initial program 96.3%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6485.5
Applied rewrites85.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma (* a t) -4.0 (/ b z)) c)))
(if (<= z -1.75e-85)
t_1
(if (<= z 7.2e-118)
(/ (fma (* y x) 9.0 b) (* z c))
(if (<= z 2.4e+112)
t_1
(if (<= z 6.8e+199)
(/ (fma (* a t) -4.0 (/ (* (* y x) 9.0) z)) c)
(fma -4.0 (/ (* a t) c) (/ (/ b c) z))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((a * t), -4.0, (b / z)) / c;
double tmp;
if (z <= -1.75e-85) {
tmp = t_1;
} else if (z <= 7.2e-118) {
tmp = fma((y * x), 9.0, b) / (z * c);
} else if (z <= 2.4e+112) {
tmp = t_1;
} else if (z <= 6.8e+199) {
tmp = fma((a * t), -4.0, (((y * x) * 9.0) / z)) / c;
} else {
tmp = fma(-4.0, ((a * t) / c), ((b / c) / z));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fma(Float64(a * t), -4.0, Float64(b / z)) / c) tmp = 0.0 if (z <= -1.75e-85) tmp = t_1; elseif (z <= 7.2e-118) tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); elseif (z <= 2.4e+112) tmp = t_1; elseif (z <= 6.8e+199) tmp = Float64(fma(Float64(a * t), -4.0, Float64(Float64(Float64(y * x) * 9.0) / z)) / c); else tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(Float64(b / c) / z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.75e-85], t$95$1, If[LessEqual[z, 7.2e-118], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+112], t$95$1, If[LessEqual[z, 6.8e+199], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-118}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+199}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\left(y \cdot x\right) \cdot 9}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{\frac{b}{c}}{z}\right)\\
\end{array}
\end{array}
if z < -1.74999999999999989e-85 or 7.2000000000000004e-118 < z < 2.4e112Initial program 77.3%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6485.1
Applied rewrites85.1%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6489.5
Applied rewrites89.5%
Taylor expanded in x around 0
Applied rewrites68.6%
if -1.74999999999999989e-85 < z < 7.2000000000000004e-118Initial program 96.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6484.3
Applied rewrites84.3%
if 2.4e112 < z < 6.8000000000000001e199Initial program 77.3%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6485.1
Applied rewrites85.1%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6489.5
Applied rewrites89.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6466.4
Applied rewrites66.4%
if 6.8000000000000001e199 < z Initial program 64.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6480.3
Applied rewrites80.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6476.2
Applied rewrites76.2%
Taylor expanded in x around 0
Applied rewrites65.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.75e-85)
(/ (fma (* a t) -4.0 (/ b z)) c)
(if (<= z 7.2e-118)
(/ (fma (* y x) 9.0 b) (* z c))
(- (/ (fma (* 4.0 a) t (- (/ b z))) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.75e-85) {
tmp = fma((a * t), -4.0, (b / z)) / c;
} else if (z <= 7.2e-118) {
tmp = fma((y * x), 9.0, b) / (z * c);
} else {
tmp = -(fma((4.0 * a), t, -(b / z)) / c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.75e-85) tmp = Float64(fma(Float64(a * t), -4.0, Float64(b / z)) / c); elseif (z <= 7.2e-118) tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); else tmp = Float64(-Float64(fma(Float64(4.0 * a), t, Float64(-Float64(b / z))) / c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.75e-85], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 7.2e-118], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], (-N[(N[(N[(4.0 * a), $MachinePrecision] * t + (-N[(b / z), $MachinePrecision])), $MachinePrecision] / c), $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-85}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-118}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(4 \cdot a, t, -\frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if z < -1.74999999999999989e-85Initial program 71.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6484.0
Applied rewrites84.0%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6489.0
Applied rewrites89.0%
Taylor expanded in x around 0
Applied rewrites71.4%
if -1.74999999999999989e-85 < z < 7.2000000000000004e-118Initial program 96.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6484.3
Applied rewrites84.3%
if 7.2000000000000004e-118 < z Initial program 72.6%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.8
Applied rewrites83.8%
Taylor expanded in c around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites89.3%
Taylor expanded in x around 0
Applied rewrites69.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma (* a t) -4.0 (/ b z)) c)))
(if (<= z -1.75e-85)
t_1
(if (<= z 7.2e-118) (/ (fma (* y x) 9.0 b) (* z c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((a * t), -4.0, (b / z)) / c;
double tmp;
if (z <= -1.75e-85) {
tmp = t_1;
} else if (z <= 7.2e-118) {
tmp = fma((y * x), 9.0, b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fma(Float64(a * t), -4.0, Float64(b / z)) / c) tmp = 0.0 if (z <= -1.75e-85) tmp = t_1; elseif (z <= 7.2e-118) tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.75e-85], t$95$1, If[LessEqual[z, 7.2e-118], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-118}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.74999999999999989e-85 or 7.2000000000000004e-118 < z Initial program 71.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.9
Applied rewrites83.9%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6489.1
Applied rewrites89.1%
Taylor expanded in x around 0
Applied rewrites70.2%
if -1.74999999999999989e-85 < z < 7.2000000000000004e-118Initial program 96.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6484.3
Applied rewrites84.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -2.2e+115)
(* (* (/ a c) -4.0) t)
(if (<= z 1.08e+105)
(/ (fma (* y x) 9.0 b) (* z c))
(* -4.0 (/ (* a t) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.2e+115) {
tmp = ((a / c) * -4.0) * t;
} else if (z <= 1.08e+105) {
tmp = fma((y * x), 9.0, b) / (z * c);
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.2e+115) tmp = Float64(Float64(Float64(a / c) * -4.0) * t); elseif (z <= 1.08e+105) tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2.2e+115], N[(N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 1.08e+105], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+115}:\\
\;\;\;\;\left(\frac{a}{c} \cdot -4\right) \cdot t\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+105}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -2.2e115Initial program 56.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f6461.6
Applied rewrites61.6%
if -2.2e115 < z < 1.07999999999999994e105Initial program 91.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6473.1
Applied rewrites73.1%
if 1.07999999999999994e105 < z Initial program 55.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
(FPCore (x y z t a b c) :precision binary64 (if (<= z -2.9e+85) (* (* (/ a c) -4.0) t) (if (<= z 4.2e-110) (/ b (* z c)) (* -4.0 (/ (* a t) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.9e+85) {
tmp = ((a / c) * -4.0) * t;
} else if (z <= 4.2e-110) {
tmp = b / (z * c);
} else {
tmp = -4.0 * ((a * t) / c);
}
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, c)
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), intent (in) :: c
real(8) :: tmp
if (z <= (-2.9d+85)) then
tmp = ((a / c) * (-4.0d0)) * t
else if (z <= 4.2d-110) then
tmp = b / (z * c)
else
tmp = (-4.0d0) * ((a * t) / c)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.9e+85) {
tmp = ((a / c) * -4.0) * t;
} else if (z <= 4.2e-110) {
tmp = b / (z * c);
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -2.9e+85: tmp = ((a / c) * -4.0) * t elif z <= 4.2e-110: tmp = b / (z * c) else: tmp = -4.0 * ((a * t) / c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.9e+85) tmp = Float64(Float64(Float64(a / c) * -4.0) * t); elseif (z <= 4.2e-110) tmp = Float64(b / Float64(z * c)); else tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -2.9e+85) tmp = ((a / c) * -4.0) * t; elseif (z <= 4.2e-110) tmp = b / (z * c); else tmp = -4.0 * ((a * t) / c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2.9e+85], N[(N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 4.2e-110], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+85}:\\
\;\;\;\;\left(\frac{a}{c} \cdot -4\right) \cdot t\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-110}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -2.89999999999999997e85Initial program 58.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f6460.0
Applied rewrites60.0%
if -2.89999999999999997e85 < z < 4.20000000000000004e-110Initial program 93.6%
Taylor expanded in b around inf
Applied rewrites46.4%
if 4.20000000000000004e-110 < z Initial program 72.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6447.3
Applied rewrites47.3%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* -4.0 (/ (* a t) c)))) (if (<= z -1.8e+82) t_1 (if (<= z 4.2e-110) (/ b (* z c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * ((a * t) / c);
double tmp;
if (z <= -1.8e+82) {
tmp = t_1;
} else if (z <= 4.2e-110) {
tmp = b / (z * c);
} 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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((a * t) / c)
if (z <= (-1.8d+82)) then
tmp = t_1
else if (z <= 4.2d-110) then
tmp = b / (z * c)
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 c) {
double t_1 = -4.0 * ((a * t) / c);
double tmp;
if (z <= -1.8e+82) {
tmp = t_1;
} else if (z <= 4.2e-110) {
tmp = b / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = -4.0 * ((a * t) / c) tmp = 0 if z <= -1.8e+82: tmp = t_1 elif z <= 4.2e-110: tmp = b / (z * c) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (z <= -1.8e+82) tmp = t_1; elseif (z <= 4.2e-110) tmp = Float64(b / Float64(z * c)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = -4.0 * ((a * t) / c); tmp = 0.0; if (z <= -1.8e+82) tmp = t_1; elseif (z <= 4.2e-110) tmp = b / (z * c); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+82], t$95$1, If[LessEqual[z, 4.2e-110], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-110}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.80000000000000007e82 or 4.20000000000000004e-110 < z Initial program 67.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.7
Applied rewrites51.7%
if -1.80000000000000007e82 < z < 4.20000000000000004e-110Initial program 93.8%
Taylor expanded in b around inf
Applied rewrites46.5%
(FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
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, c)
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), intent (in) :: c
code = b / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
def code(x, y, z, t, a, b, c): return b / (z * c)
function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = b / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 79.8%
Taylor expanded in b around inf
Applied rewrites35.4%
herbie shell --seed 2025115
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))