
(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 17 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
(if (<= z -2.6e+67)
(/ (fma (* a t) -4.0 (* (fma (/ x z) 9.0 (/ b (* z y))) y)) c)
(if (<= z 5e-43)
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))
(/ (fma (* a t) -4.0 (/ (fma (* y x) 9.0 b) z)) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.6e+67) {
tmp = fma((a * t), -4.0, (fma((x / z), 9.0, (b / (z * y))) * y)) / c;
} else if (z <= 5e-43) {
tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
} else {
tmp = fma((a * t), -4.0, (fma((y * x), 9.0, b) / z)) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.6e+67) tmp = Float64(fma(Float64(a * t), -4.0, Float64(fma(Float64(x / z), 9.0, Float64(b / Float64(z * y))) * y)) / c); elseif (z <= 5e-43) tmp = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)); else tmp = Float64(fma(Float64(a * t), -4.0, Float64(fma(Float64(y * x), 9.0, b) / z)) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2.6e+67], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(x / z), $MachinePrecision] * 9.0 + N[(b / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 5e-43], 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], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+67}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \mathsf{fma}\left(\frac{x}{z}, 9, \frac{b}{z \cdot y}\right) \cdot y\right)}{c}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-43}:\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right)}{c}\\
\end{array}
\end{array}
if z < -2.6e67Initial program 56.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-*.f6478.9
Applied rewrites78.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-*.f6487.2
Applied rewrites87.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6488.3
Applied rewrites88.3%
if -2.6e67 < z < 5.00000000000000019e-43Initial program 94.9%
if 5.00000000000000019e-43 < z Initial program 68.4%
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.6
Applied rewrites82.6%
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
(if (<= c 1.75e-63)
(/ (/ (- (* (* y x) 9.0) (- (* (* (* 4.0 z) t) a) b)) z) c)
(if (<= c 2.5e+140)
(fma -4.0 (/ (* a t) c) (/ (fma (* 9.0 x) y b) (* c z)))
(fma -4.0 (* a (/ t c)) (/ (fma (* y x) 9.0 b) (* c z))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= 1.75e-63) {
tmp = ((((y * x) * 9.0) - ((((4.0 * z) * t) * a) - b)) / z) / c;
} else if (c <= 2.5e+140) {
tmp = fma(-4.0, ((a * t) / c), (fma((9.0 * x), y, b) / (c * z)));
} else {
tmp = fma(-4.0, (a * (t / c)), (fma((y * x), 9.0, b) / (c * z)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= 1.75e-63) tmp = Float64(Float64(Float64(Float64(Float64(y * x) * 9.0) - Float64(Float64(Float64(Float64(4.0 * z) * t) * a) - b)) / z) / c); elseif (c <= 2.5e+140) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(fma(Float64(9.0 * x), y, b) / Float64(c * z))); else tmp = fma(-4.0, Float64(a * Float64(t / c)), Float64(fma(Float64(y * x), 9.0, b) / Float64(c * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, 1.75e-63], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0), $MachinePrecision] - N[(N[(N[(N[(4.0 * z), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, 2.5e+140], 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[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 1.75 \cdot 10^{-63}:\\
\;\;\;\;\frac{\frac{\left(y \cdot x\right) \cdot 9 - \left(\left(\left(4 \cdot z\right) \cdot t\right) \cdot a - b\right)}{z}}{c}\\
\mathbf{elif}\;c \leq 2.5 \cdot 10^{+140}:\\
\;\;\;\;\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}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot \frac{t}{c}, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{c \cdot z}\right)\\
\end{array}
\end{array}
if c < 1.75000000000000002e-63Initial program 83.0%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites82.7%
if 1.75000000000000002e-63 < c < 2.50000000000000004e140Initial program 79.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-*.f6489.2
Applied rewrites89.2%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6489.0
Applied rewrites89.0%
if 2.50000000000000004e140 < c Initial program 64.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-*.f6474.9
Applied rewrites74.9%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6479.7
Applied rewrites79.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma (* a t) -4.0 (/ (fma (* y x) 9.0 b) z)) c)))
(if (<= z -1.18e-98)
t_1
(if (<= z 5e-43)
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) 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, (fma((y * x), 9.0, b) / z)) / c;
double tmp;
if (z <= -1.18e-98) {
tmp = t_1;
} else if (z <= 5e-43) {
tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + 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(fma(Float64(y * x), 9.0, b) / z)) / c) tmp = 0.0 if (z <= -1.18e-98) tmp = t_1; elseif (z <= 5e-43) tmp = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + 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[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.18e-98], t$95$1, If[LessEqual[z, 5e-43], 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], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -1.18 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-43}:\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.18e-98 or 5.00000000000000019e-43 < z Initial program 69.4%
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.7
Applied rewrites82.7%
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%
if -1.18e-98 < z < 5.00000000000000019e-43Initial program 96.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -8.2e-71)
(/ (fma (* a t) -4.0 (/ (fma (* y 9.0) x b) z)) c)
(if (<= z 5e-43)
(/ (+ (- (* x (* y 9.0)) (* (* (* z 4.0) t) a)) b) (* z c))
(/ (fma (* a t) -4.0 (/ (fma (* y x) 9.0 b) z)) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -8.2e-71) {
tmp = fma((a * t), -4.0, (fma((y * 9.0), x, b) / z)) / c;
} else if (z <= 5e-43) {
tmp = (((x * (y * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c);
} else {
tmp = fma((a * t), -4.0, (fma((y * x), 9.0, b) / z)) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -8.2e-71) tmp = Float64(fma(Float64(a * t), -4.0, Float64(fma(Float64(y * 9.0), x, b) / z)) / c); elseif (z <= 5e-43) tmp = Float64(Float64(Float64(Float64(x * Float64(y * 9.0)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)); else tmp = Float64(fma(Float64(a * t), -4.0, Float64(fma(Float64(y * x), 9.0, b) / z)) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -8.2e-71], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 5e-43], N[(N[(N[(N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-71}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-43}:\\
\;\;\;\;\frac{\left(x \cdot \left(y \cdot 9\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right)}{c}\\
\end{array}
\end{array}
if z < -8.19999999999999987e-71Initial program 68.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%
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%
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6489.0
Applied rewrites89.0%
if -8.19999999999999987e-71 < z < 5.00000000000000019e-43Initial program 96.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6496.4
Applied rewrites96.4%
if 5.00000000000000019e-43 < z Initial program 68.4%
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.6
Applied rewrites82.6%
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 (if (<= (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 5e+89) (/ (fma (* a t) -4.0 (/ (fma (* y 9.0) x b) z)) c) (fma -4.0 (* a (/ t c)) (/ (fma (* y x) 9.0 b) (* c z)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= 5e+89) {
tmp = fma((a * t), -4.0, (fma((y * 9.0), x, b) / z)) / c;
} else {
tmp = fma(-4.0, (a * (t / c)), (fma((y * x), 9.0, b) / (c * z)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) <= 5e+89) tmp = Float64(fma(Float64(a * t), -4.0, Float64(fma(Float64(y * 9.0), x, b) / z)) / c); else tmp = fma(-4.0, Float64(a * Float64(t / c)), Float64(fma(Float64(y * x), 9.0, b) / Float64(c * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[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], 5e+89], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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} \leq 5 \cdot 10^{+89}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot \frac{t}{c}, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{c \cdot z}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 4.99999999999999983e89Initial program 85.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-*.f6487.6
Applied rewrites87.6%
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-*.f6490.7
Applied rewrites90.7%
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6490.6
Applied rewrites90.6%
if 4.99999999999999983e89 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 71.5%
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-*.f6478.6
Applied rewrites78.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6480.6
Applied rewrites80.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (* y x) 9.0 b)))
(if (<= z -5.5e-265)
(/ (fma (* a t) -4.0 (/ (fma (* y 9.0) x b) z)) c)
(if (<= z 3.8e-94) (/ t_1 (* z c)) (/ (fma (* a t) -4.0 (/ t_1 z)) 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 tmp;
if (z <= -5.5e-265) {
tmp = fma((a * t), -4.0, (fma((y * 9.0), x, b) / z)) / c;
} else if (z <= 3.8e-94) {
tmp = t_1 / (z * c);
} else {
tmp = fma((a * t), -4.0, (t_1 / z)) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(y * x), 9.0, b) tmp = 0.0 if (z <= -5.5e-265) tmp = Float64(fma(Float64(a * t), -4.0, Float64(fma(Float64(y * 9.0), x, b) / z)) / c); elseif (z <= 3.8e-94) tmp = Float64(t_1 / Float64(z * c)); else tmp = Float64(fma(Float64(a * t), -4.0, Float64(t_1 / z)) / 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]}, If[LessEqual[z, -5.5e-265], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 3.8e-94], N[(t$95$1 / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y \cdot x, 9, b\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-265}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-94}:\\
\;\;\;\;\frac{t\_1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{t\_1}{z}\right)}{c}\\
\end{array}
\end{array}
if z < -5.49999999999999985e-265Initial 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-*.f6483.7
Applied rewrites83.7%
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-*.f6486.8
Applied rewrites86.8%
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6486.7
Applied rewrites86.7%
if -5.49999999999999985e-265 < z < 3.79999999999999999e-94Initial program 96.9%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6485.5
Applied rewrites85.5%
if 3.79999999999999999e-94 < 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.1
Applied rewrites83.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-*.f6488.7
Applied rewrites88.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma (* a t) -4.0 (/ (fma (* y 9.0) x b) z)) c)))
(if (<= z -5.5e-265)
t_1
(if (<= z 3.8e-94) (/ (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, (fma((y * 9.0), x, b) / z)) / c;
double tmp;
if (z <= -5.5e-265) {
tmp = t_1;
} else if (z <= 3.8e-94) {
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(fma(Float64(y * 9.0), x, b) / z)) / c) tmp = 0.0 if (z <= -5.5e-265) tmp = t_1; elseif (z <= 3.8e-94) 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[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -5.5e-265], t$95$1, If[LessEqual[z, 3.8e-94], 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{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-265}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-94}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.49999999999999985e-265 or 3.79999999999999999e-94 < z Initial program 75.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-*.f6483.4
Applied rewrites83.4%
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.6
Applied rewrites87.6%
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6487.5
Applied rewrites87.5%
if -5.49999999999999985e-265 < z < 3.79999999999999999e-94Initial program 96.9%
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
(if (<= z -1.8e-23)
(/ (fma (* a t) -4.0 (/ (* (* y x) 9.0) z)) c)
(if (<= z 0.00047)
(/ (fma (* y x) 9.0 b) (* z c))
(/ (fma (* a t) -4.0 (/ b z)) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.8e-23) {
tmp = fma((a * t), -4.0, (((y * x) * 9.0) / z)) / c;
} else if (z <= 0.00047) {
tmp = fma((y * x), 9.0, b) / (z * c);
} else {
tmp = fma((a * t), -4.0, (b / z)) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.8e-23) tmp = Float64(fma(Float64(a * t), -4.0, Float64(Float64(Float64(y * x) * 9.0) / z)) / c); elseif (z <= 0.00047) tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); else tmp = Float64(fma(Float64(a * t), -4.0, Float64(b / z)) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.8e-23], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 0.00047], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-23}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\left(y \cdot x\right) \cdot 9}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 0.00047:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if z < -1.7999999999999999e-23Initial program 64.4%
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-*.f6481.4
Applied rewrites81.4%
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.5
Applied rewrites88.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6468.5
Applied rewrites68.5%
if -1.7999999999999999e-23 < z < 4.69999999999999986e-4Initial program 95.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6480.3
Applied rewrites80.3%
if 4.69999999999999986e-4 < z Initial program 65.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-*.f6482.6
Applied rewrites82.6%
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.2
Applied rewrites89.2%
Taylor expanded in x around 0
Applied rewrites71.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma (* a t) -4.0 (/ b z)) c)))
(if (<= z -6.8e-53)
t_1
(if (<= z 0.00047) (/ (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 <= -6.8e-53) {
tmp = t_1;
} else if (z <= 0.00047) {
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 <= -6.8e-53) tmp = t_1; elseif (z <= 0.00047) 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, -6.8e-53], t$95$1, If[LessEqual[z, 0.00047], 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 -6.8 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.00047:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.8e-53 or 4.69999999999999986e-4 < z Initial program 66.1%
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.2
Applied rewrites82.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-*.f6489.0
Applied rewrites89.0%
Taylor expanded in x around 0
Applied rewrites70.9%
if -6.8e-53 < z < 4.69999999999999986e-4Initial program 95.9%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6480.8
Applied rewrites80.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -4.1e+68)
(/ (* (* a t) -4.0) c)
(if (<= z 3.6e+134)
(/ (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 <= -4.1e+68) {
tmp = ((a * t) * -4.0) / c;
} else if (z <= 3.6e+134) {
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 <= -4.1e+68) tmp = Float64(Float64(Float64(a * t) * -4.0) / c); elseif (z <= 3.6e+134) 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, -4.1e+68], N[(N[(N[(a * t), $MachinePrecision] * -4.0), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 3.6e+134], 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 -4.1 \cdot 10^{+68}:\\
\;\;\;\;\frac{\left(a \cdot t\right) \cdot -4}{c}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+134}:\\
\;\;\;\;\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 < -4.0999999999999999e68Initial program 56.2%
Taylor expanded in b around inf
Applied rewrites20.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6424.2
associate-+l-24.2
associate-*l*24.2
*-commutative24.2
*-commutative24.2
associate-+l-24.2
Applied rewrites24.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6456.6
Applied rewrites56.6%
if -4.0999999999999999e68 < z < 3.59999999999999988e134Initial program 92.1%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6473.7
Applied rewrites73.7%
if 3.59999999999999988e134 < z Initial program 51.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.4
Applied rewrites61.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -4e-15)
(/ (/ (* (* y x) 9.0) c) z)
(if (<= t_1 1e-71)
(/ (/ b c) z)
(if (<= t_1 2e+224)
(* -4.0 (/ (* a t) c))
(- (* (* (/ y (* c z)) -9.0) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -4e-15) {
tmp = (((y * x) * 9.0) / c) / z;
} else if (t_1 <= 1e-71) {
tmp = (b / c) / z;
} else if (t_1 <= 2e+224) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = -(((y / (c * z)) * -9.0) * x);
}
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 = (x * 9.0d0) * y
if (t_1 <= (-4d-15)) then
tmp = (((y * x) * 9.0d0) / c) / z
else if (t_1 <= 1d-71) then
tmp = (b / c) / z
else if (t_1 <= 2d+224) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = -(((y / (c * z)) * (-9.0d0)) * x)
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 = (x * 9.0) * y;
double tmp;
if (t_1 <= -4e-15) {
tmp = (((y * x) * 9.0) / c) / z;
} else if (t_1 <= 1e-71) {
tmp = (b / c) / z;
} else if (t_1 <= 2e+224) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = -(((y / (c * z)) * -9.0) * x);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -4e-15: tmp = (((y * x) * 9.0) / c) / z elif t_1 <= 1e-71: tmp = (b / c) / z elif t_1 <= 2e+224: tmp = -4.0 * ((a * t) / c) else: tmp = -(((y / (c * z)) * -9.0) * x) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -4e-15) tmp = Float64(Float64(Float64(Float64(y * x) * 9.0) / c) / z); elseif (t_1 <= 1e-71) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 2e+224) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(-Float64(Float64(Float64(y / Float64(c * z)) * -9.0) * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -4e-15) tmp = (((y * x) * 9.0) / c) / z; elseif (t_1 <= 1e-71) tmp = (b / c) / z; elseif (t_1 <= 2e+224) tmp = -4.0 * ((a * t) / c); else tmp = -(((y / (c * z)) * -9.0) * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-15], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e-71], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 2e+224], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], (-N[(N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision] * x), $MachinePrecision])]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{\left(y \cdot x\right) \cdot 9}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{-71}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+224}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;-\left(\frac{y}{c \cdot z} \cdot -9\right) \cdot x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -4.0000000000000003e-15Initial program 78.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-*.f6480.6
Applied rewrites80.6%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6464.7
Applied rewrites64.7%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6454.8
Applied rewrites54.8%
if -4.0000000000000003e-15 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999992e-72Initial program 82.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-*.f6488.1
Applied rewrites88.1%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6452.9
Applied rewrites52.9%
Taylor expanded in x around 0
lift-/.f6448.7
Applied rewrites48.7%
if 9.9999999999999992e-72 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.99999999999999994e224Initial program 83.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.3
Applied rewrites37.3%
if 1.99999999999999994e224 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 67.4%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6473.3
Applied rewrites73.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -4e-15)
(/ (/ (* (* y x) 9.0) c) z)
(if (<= t_1 1e-71)
(/ (/ b c) z)
(if (<= t_1 2e+224)
(* -4.0 (/ (* a t) c))
(* (* x (/ y (* c z))) 9.0))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -4e-15) {
tmp = (((y * x) * 9.0) / c) / z;
} else if (t_1 <= 1e-71) {
tmp = (b / c) / z;
} else if (t_1 <= 2e+224) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (x * (y / (c * z))) * 9.0;
}
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 = (x * 9.0d0) * y
if (t_1 <= (-4d-15)) then
tmp = (((y * x) * 9.0d0) / c) / z
else if (t_1 <= 1d-71) then
tmp = (b / c) / z
else if (t_1 <= 2d+224) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = (x * (y / (c * z))) * 9.0d0
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 = (x * 9.0) * y;
double tmp;
if (t_1 <= -4e-15) {
tmp = (((y * x) * 9.0) / c) / z;
} else if (t_1 <= 1e-71) {
tmp = (b / c) / z;
} else if (t_1 <= 2e+224) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (x * (y / (c * z))) * 9.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -4e-15: tmp = (((y * x) * 9.0) / c) / z elif t_1 <= 1e-71: tmp = (b / c) / z elif t_1 <= 2e+224: tmp = -4.0 * ((a * t) / c) else: tmp = (x * (y / (c * z))) * 9.0 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -4e-15) tmp = Float64(Float64(Float64(Float64(y * x) * 9.0) / c) / z); elseif (t_1 <= 1e-71) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 2e+224) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(Float64(x * Float64(y / Float64(c * z))) * 9.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -4e-15) tmp = (((y * x) * 9.0) / c) / z; elseif (t_1 <= 1e-71) tmp = (b / c) / z; elseif (t_1 <= 2e+224) tmp = -4.0 * ((a * t) / c); else tmp = (x * (y / (c * z))) * 9.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-15], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e-71], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 2e+224], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{\left(y \cdot x\right) \cdot 9}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{-71}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+224}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \frac{y}{c \cdot z}\right) \cdot 9\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -4.0000000000000003e-15Initial program 78.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-*.f6480.6
Applied rewrites80.6%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6464.7
Applied rewrites64.7%
Taylor expanded in x around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6454.8
Applied rewrites54.8%
if -4.0000000000000003e-15 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999992e-72Initial program 82.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-*.f6488.1
Applied rewrites88.1%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6452.9
Applied rewrites52.9%
Taylor expanded in x around 0
lift-/.f6448.7
Applied rewrites48.7%
if 9.9999999999999992e-72 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.99999999999999994e224Initial program 83.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.3
Applied rewrites37.3%
if 1.99999999999999994e224 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 67.4%
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-*.f6466.2
Applied rewrites66.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-*.f6471.2
Applied rewrites71.2%
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6471.2
Applied rewrites71.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f6473.3
Applied rewrites73.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* (* x (/ y (* c z))) 9.0)))
(if (<= t_1 -1e+105)
t_2
(if (<= t_1 1e-71)
(/ (/ b c) z)
(if (<= t_1 2e+224) (* -4.0 (/ (* a t) c)) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = (x * (y / (c * z))) * 9.0;
double tmp;
if (t_1 <= -1e+105) {
tmp = t_2;
} else if (t_1 <= 1e-71) {
tmp = (b / c) / z;
} else if (t_1 <= 2e+224) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = (x * (y / (c * z))) * 9.0d0
if (t_1 <= (-1d+105)) then
tmp = t_2
else if (t_1 <= 1d-71) then
tmp = (b / c) / z
else if (t_1 <= 2d+224) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = (x * (y / (c * z))) * 9.0;
double tmp;
if (t_1 <= -1e+105) {
tmp = t_2;
} else if (t_1 <= 1e-71) {
tmp = (b / c) / z;
} else if (t_1 <= 2e+224) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = (x * (y / (c * z))) * 9.0 tmp = 0 if t_1 <= -1e+105: tmp = t_2 elif t_1 <= 1e-71: tmp = (b / c) / z elif t_1 <= 2e+224: tmp = -4.0 * ((a * t) / c) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(Float64(x * Float64(y / Float64(c * z))) * 9.0) tmp = 0.0 if (t_1 <= -1e+105) tmp = t_2; elseif (t_1 <= 1e-71) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 2e+224) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; t_2 = (x * (y / (c * z))) * 9.0; tmp = 0.0; if (t_1 <= -1e+105) tmp = t_2; elseif (t_1 <= 1e-71) tmp = (b / c) / z; elseif (t_1 <= 2e+224) tmp = -4.0 * ((a * t) / c); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+105], t$95$2, If[LessEqual[t$95$1, 1e-71], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 2e+224], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \left(x \cdot \frac{y}{c \cdot z}\right) \cdot 9\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+105}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-71}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+224}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.9999999999999994e104 or 1.99999999999999994e224 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 72.4%
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-*.f6472.8
Applied rewrites72.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-*.f6476.1
Applied rewrites76.1%
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6476.0
Applied rewrites76.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f6468.6
Applied rewrites68.6%
if -9.9999999999999994e104 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999992e-72Initial program 82.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-*.f6488.1
Applied rewrites88.1%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6454.5
Applied rewrites54.5%
Taylor expanded in x around 0
lift-/.f6446.1
Applied rewrites46.1%
if 9.9999999999999992e-72 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.99999999999999994e224Initial program 83.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.3
Applied rewrites37.3%
(FPCore (x y z t a b c) :precision binary64 (if (<= z -1.8e-23) (/ (* (* a t) -4.0) c) (if (<= z 0.00017) (/ 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 <= -1.8e-23) {
tmp = ((a * t) * -4.0) / c;
} else if (z <= 0.00017) {
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 <= (-1.8d-23)) then
tmp = ((a * t) * (-4.0d0)) / c
else if (z <= 0.00017d0) 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 <= -1.8e-23) {
tmp = ((a * t) * -4.0) / c;
} else if (z <= 0.00017) {
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 <= -1.8e-23: tmp = ((a * t) * -4.0) / c elif z <= 0.00017: 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 <= -1.8e-23) tmp = Float64(Float64(Float64(a * t) * -4.0) / c); elseif (z <= 0.00017) 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 <= -1.8e-23) tmp = ((a * t) * -4.0) / c; elseif (z <= 0.00017) 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, -1.8e-23], N[(N[(N[(a * t), $MachinePrecision] * -4.0), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 0.00017], 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 -1.8 \cdot 10^{-23}:\\
\;\;\;\;\frac{\left(a \cdot t\right) \cdot -4}{c}\\
\mathbf{elif}\;z \leq 0.00017:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -1.7999999999999999e-23Initial program 64.4%
Taylor expanded in b around inf
Applied rewrites24.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6427.1
associate-+l-27.1
associate-*l*27.1
*-commutative27.1
*-commutative27.1
associate-+l-27.1
Applied rewrites27.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6451.4
Applied rewrites51.4%
if -1.7999999999999999e-23 < z < 1.7e-4Initial program 95.8%
Taylor expanded in b around inf
Applied rewrites47.7%
if 1.7e-4 < z Initial program 65.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.2
Applied rewrites52.2%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* -4.0 (/ (* a t) c)))) (if (<= z -1.8e-23) t_1 (if (<= z 0.00017) (/ 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-23) {
tmp = t_1;
} else if (z <= 0.00017) {
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-23)) then
tmp = t_1
else if (z <= 0.00017d0) 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-23) {
tmp = t_1;
} else if (z <= 0.00017) {
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-23: tmp = t_1 elif z <= 0.00017: 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-23) tmp = t_1; elseif (z <= 0.00017) 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-23) tmp = t_1; elseif (z <= 0.00017) 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-23], t$95$1, If[LessEqual[z, 0.00017], 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^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.00017:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7999999999999999e-23 or 1.7e-4 < z Initial program 65.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.8
Applied rewrites51.8%
if -1.7999999999999999e-23 < z < 1.7e-4Initial program 95.8%
Taylor expanded in b around inf
Applied rewrites47.7%
(FPCore (x y z t a b c) :precision binary64 (/ (/ b c) z))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
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 / c) / z
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
def code(x, y, z, t, a, b, c): return (b / c) / z
function code(x, y, z, t, a, b, c) return Float64(Float64(b / c) / z) end
function tmp = code(x, y, z, t, a, b, c) tmp = (b / c) / z; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{b}{c}}{z}
\end{array}
Initial program 79.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.9
Applied rewrites83.9%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6458.9
Applied rewrites58.9%
Taylor expanded in x around 0
lift-/.f6435.1
Applied rewrites35.1%
(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.7%
Taylor expanded in b around inf
Applied rewrites35.4%
herbie shell --seed 2025110
(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)))