
(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 16 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 (* a t) -4.0 (/ (fma (* y x) 9.0 b) z)) c)))
(if (<= z -3.2e-53)
t_1
(if (<= z 1e-23)
(/ (+ (- (* x (* y 9.0)) (* (* (* 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 <= -3.2e-53) {
tmp = t_1;
} else if (z <= 1e-23) {
tmp = (((x * (y * 9.0)) - (((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 <= -3.2e-53) tmp = t_1; elseif (z <= 1e-23) tmp = Float64(Float64(Float64(Float64(x * Float64(y * 9.0)) - 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, -3.2e-53], t$95$1, If[LessEqual[z, 1e-23], 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], 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 -3.2 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-23}:\\
\;\;\;\;\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}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.2000000000000001e-53 or 9.9999999999999996e-24 < z Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
if -3.2000000000000001e-53 < z < 9.9999999999999996e-24Initial program 79.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.6
Applied rewrites79.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (* y x) 9.0 b)))
(if (<= c 4e+48)
(/ (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+48) {
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+48) tmp = Float64(fma(Float64(a * t), -4.0, Float64(t_1 / z)) / c); else tmp = fma(-4.0, Float64(a * Float64(t / c)), Float64(t_1 / Float64(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+48], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / N[(c * z), $MachinePrecision]), $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^{+48}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{t\_1}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot \frac{t}{c}, \frac{t\_1}{c \cdot z}\right)\\
\end{array}
\end{array}
if c < 4.00000000000000018e48Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
if 4.00000000000000018e48 < c Initial program 79.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-*.f6485.0
Applied rewrites85.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.4
Applied rewrites84.4%
(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 -4.9e-56) t_2 (if (<= z 1.1e-179) (/ 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 <= -4.9e-56) {
tmp = t_2;
} else if (z <= 1.1e-179) {
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 <= -4.9e-56) tmp = t_2; elseif (z <= 1.1e-179) 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, -4.9e-56], t$95$2, If[LessEqual[z, 1.1e-179], 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 -4.9 \cdot 10^{-56}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-179}:\\
\;\;\;\;\frac{t\_1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.9e-56 or 1.10000000000000002e-179 < z Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
if -4.9e-56 < z < 1.10000000000000002e-179Initial program 79.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6459.6
Applied rewrites59.6%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* (* x 9.0) y) 4e+197) (/ (fma (* a t) -4.0 (/ (fma (* y x) 9.0 b) z)) c) (* (/ (fma (* x (/ y (* t z))) 9.0 (* -4.0 a)) c) t)))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * 9.0) * y) <= 4e+197) {
tmp = fma((a * t), -4.0, (fma((y * x), 9.0, b) / z)) / c;
} else {
tmp = (fma((x * (y / (t * z))), 9.0, (-4.0 * a)) / c) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(x * 9.0) * y) <= 4e+197) tmp = Float64(fma(Float64(a * t), -4.0, Float64(fma(Float64(y * x), 9.0, b) / z)) / c); else tmp = Float64(Float64(fma(Float64(x * Float64(y / Float64(t * z))), 9.0, Float64(-4.0 * a)) / c) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision], 4e+197], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(x * N[(y / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 9.0 + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot 9\right) \cdot y \leq 4 \cdot 10^{+197}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x \cdot \frac{y}{t \cdot z}, 9, -4 \cdot a\right)}{c} \cdot t\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 3.9999999999999998e197Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
if 3.9999999999999998e197 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-/.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
associate-/r*N/A
Applied rewrites78.9%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-*.f6463.2
Applied rewrites63.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z))))
(if (<= z -6.6e-55)
(/ (fma (* a t) -4.0 (/ (* (* y x) 9.0) z)) c)
(if (<= z 7.2e-132)
(/ (fma (* y x) 9.0 b) (* z c))
(if (<= z 1e+75)
(fma -4.0 (* a (/ t c)) t_1)
(if (<= z 1.25e+112)
(fma (* x (/ y (* c z))) 9.0 t_1)
(/ (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 t_1 = b / (c * z);
double tmp;
if (z <= -6.6e-55) {
tmp = fma((a * t), -4.0, (((y * x) * 9.0) / z)) / c;
} else if (z <= 7.2e-132) {
tmp = fma((y * x), 9.0, b) / (z * c);
} else if (z <= 1e+75) {
tmp = fma(-4.0, (a * (t / c)), t_1);
} else if (z <= 1.25e+112) {
tmp = fma((x * (y / (c * z))), 9.0, t_1);
} else {
tmp = fma((a * t), -4.0, (b / z)) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) tmp = 0.0 if (z <= -6.6e-55) tmp = Float64(fma(Float64(a * t), -4.0, Float64(Float64(Float64(y * x) * 9.0) / z)) / c); elseif (z <= 7.2e-132) tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); elseif (z <= 1e+75) tmp = fma(-4.0, Float64(a * Float64(t / c)), t_1); elseif (z <= 1.25e+112) tmp = fma(Float64(x * Float64(y / Float64(c * z))), 9.0, t_1); 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_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e-55], 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, 7.2e-132], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+75], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 1.25e+112], N[(N[(x * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 9.0 + t$95$1), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\left(y \cdot x\right) \cdot 9}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-132}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot \frac{t}{c}, t\_1\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot \frac{y}{c \cdot z}, 9, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if z < -6.5999999999999999e-55Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6464.3
Applied rewrites64.3%
if -6.5999999999999999e-55 < z < 7.20000000000000015e-132Initial program 79.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6459.6
Applied rewrites59.6%
if 7.20000000000000015e-132 < z < 9.99999999999999927e74Initial program 79.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-*.f6485.0
Applied rewrites85.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.4
Applied rewrites84.4%
Taylor expanded in x around 0
lower-/.f64N/A
lift-*.f6463.0
Applied rewrites63.0%
if 9.99999999999999927e74 < z < 1.25e112Initial program 79.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-*.f6485.0
Applied rewrites85.0%
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.7
Applied rewrites58.7%
lift-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
div-addN/A
associate-/r*N/A
div-addN/A
associate-*r/N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites53.3%
if 1.25e112 < z Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
Taylor expanded in x around 0
Applied rewrites63.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -6.6e-55)
(/ (fma (* a t) -4.0 (/ (* (* y x) 9.0) z)) c)
(if (<= z 7.2e-132)
(/ (fma (* y x) 9.0 b) (* z c))
(if (<= z 9e+64)
(fma -4.0 (* a (/ t c)) (/ b (* c z)))
(/ (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 <= -6.6e-55) {
tmp = fma((a * t), -4.0, (((y * x) * 9.0) / z)) / c;
} else if (z <= 7.2e-132) {
tmp = fma((y * x), 9.0, b) / (z * c);
} else if (z <= 9e+64) {
tmp = fma(-4.0, (a * (t / c)), (b / (c * z)));
} 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 <= -6.6e-55) tmp = Float64(fma(Float64(a * t), -4.0, Float64(Float64(Float64(y * x) * 9.0) / z)) / c); elseif (z <= 7.2e-132) tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); elseif (z <= 9e+64) tmp = fma(-4.0, Float64(a * Float64(t / c)), Float64(b / Float64(c * z))); 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, -6.6e-55], 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, 7.2e-132], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+64], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $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 -6.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\left(y \cdot x\right) \cdot 9}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-132}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot \frac{t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if z < -6.5999999999999999e-55Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6464.3
Applied rewrites64.3%
if -6.5999999999999999e-55 < z < 7.20000000000000015e-132Initial program 79.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6459.6
Applied rewrites59.6%
if 7.20000000000000015e-132 < z < 8.99999999999999946e64Initial program 79.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-*.f6485.0
Applied rewrites85.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.4
Applied rewrites84.4%
Taylor expanded in x around 0
lower-/.f64N/A
lift-*.f6463.0
Applied rewrites63.0%
if 8.99999999999999946e64 < z Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
Taylor expanded in x around 0
Applied rewrites63.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma -4.0 (* a (/ t c)) (/ b (* c z)))))
(if (<= z -2.1e+109)
t_1
(if (<= z 7.2e-132)
(/ (fma (* y x) 9.0 b) (* z c))
(if (<= z 9e+64) t_1 (/ (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 t_1 = fma(-4.0, (a * (t / c)), (b / (c * z)));
double tmp;
if (z <= -2.1e+109) {
tmp = t_1;
} else if (z <= 7.2e-132) {
tmp = fma((y * x), 9.0, b) / (z * c);
} else if (z <= 9e+64) {
tmp = t_1;
} else {
tmp = fma((a * t), -4.0, (b / z)) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(-4.0, Float64(a * Float64(t / c)), Float64(b / Float64(c * z))) tmp = 0.0 if (z <= -2.1e+109) tmp = t_1; elseif (z <= 7.2e-132) tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); elseif (z <= 9e+64) tmp = t_1; 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_] := Block[{t$95$1 = N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+109], t$95$1, If[LessEqual[z, 7.2e-132], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+64], t$95$1, N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-4, a \cdot \frac{t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-132}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if z < -2.1000000000000001e109 or 7.20000000000000015e-132 < z < 8.99999999999999946e64Initial program 79.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-*.f6485.0
Applied rewrites85.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.4
Applied rewrites84.4%
Taylor expanded in x around 0
lower-/.f64N/A
lift-*.f6463.0
Applied rewrites63.0%
if -2.1000000000000001e109 < z < 7.20000000000000015e-132Initial program 79.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6459.6
Applied rewrites59.6%
if 8.99999999999999946e64 < z Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
Taylor expanded in x around 0
Applied rewrites63.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (- (* (* (/ (/ y c) z) -9.0) x))))
(if (<= t_1 -1e+213)
t_2
(if (<= t_1 2e+151) (fma -4.0 (/ (* a t) c) (/ b (* c z))) 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 = -((((y / c) / z) * -9.0) * x);
double tmp;
if (t_1 <= -1e+213) {
tmp = t_2;
} else if (t_1 <= 2e+151) {
tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
} 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(Float64(Float64(Float64(y / c) / z) * -9.0) * x)) tmp = 0.0 if (t_1 <= -1e+213) tmp = t_2; elseif (t_1 <= 2e+151) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z))); else tmp = t_2; end return 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[(N[(N[(y / c), $MachinePrecision] / z), $MachinePrecision] * -9.0), $MachinePrecision] * x), $MachinePrecision])}, If[LessEqual[t$95$1, -1e+213], t$95$2, If[LessEqual[t$95$1, 2e+151], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := -\left(\frac{\frac{y}{c}}{z} \cdot -9\right) \cdot x\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+213}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.99999999999999984e212 or 2.00000000000000003e151 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6437.2
Applied rewrites37.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
if -9.99999999999999984e212 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000003e151Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in x around 0
Applied rewrites62.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1e+93)
(- (* (* (/ y (* c z)) -9.0) x))
(if (<= t_1 2e+151)
(/ (fma (* a t) -4.0 (/ b z)) 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 <= -1e+93) {
tmp = -(((y / (c * z)) * -9.0) * x);
} else if (t_1 <= 2e+151) {
tmp = fma((a * t), -4.0, (b / z)) / 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 <= -1e+93) tmp = Float64(-Float64(Float64(Float64(y / Float64(c * z)) * -9.0) * x)); elseif (t_1 <= 2e+151) tmp = Float64(fma(Float64(a * t), -4.0, Float64(b / z)) / c); else tmp = Float64(-Float64(Float64(Float64(Float64(y / c) / z) * -9.0) * x)); end return 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, -1e+93], (-N[(N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision] * x), $MachinePrecision]), If[LessEqual[t$95$1, 2e+151], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], (-N[(N[(N[(N[(y / c), $MachinePrecision] / z), $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 -1 \cdot 10^{+93}:\\
\;\;\;\;-\left(\frac{y}{c \cdot z} \cdot -9\right) \cdot x\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+151}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;-\left(\frac{\frac{y}{c}}{z} \cdot -9\right) \cdot x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.00000000000000004e93Initial program 79.6%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6437.2
Applied rewrites37.2%
if -1.00000000000000004e93 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000003e151Initial program 79.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-*.f6485.0
Applied rewrites85.0%
Taylor expanded in c around 0
lower-/.f64N/A
Applied rewrites86.8%
Taylor expanded in x around 0
Applied rewrites63.9%
if 2.00000000000000003e151 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6437.2
Applied rewrites37.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ (* a t) c))))
(if (<= z -5.8e+109)
t_1
(if (<= z 1.6e+112) (/ (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 = -4.0 * ((a * t) / c);
double tmp;
if (z <= -5.8e+109) {
tmp = t_1;
} else if (z <= 1.6e+112) {
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(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (z <= -5.8e+109) tmp = t_1; elseif (z <= 1.6e+112) 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[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+109], t$95$1, If[LessEqual[z, 1.6e+112], 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 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+112}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.8e109 or 1.59999999999999993e112 < z Initial program 79.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
if -5.8e109 < z < 1.59999999999999993e112Initial program 79.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6459.6
Applied rewrites59.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (- (* (* (/ (/ y c) z) -9.0) x))))
(if (<= t_1 -1e+213)
t_2
(if (<= t_1 -4e+38)
(* (* (/ a c) -4.0) t)
(if (<= t_1 5e-283)
(/ b (* c z))
(if (<= t_1 2e+151) (* -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 = -((((y / c) / z) * -9.0) * x);
double tmp;
if (t_1 <= -1e+213) {
tmp = t_2;
} else if (t_1 <= -4e+38) {
tmp = ((a / c) * -4.0) * t;
} else if (t_1 <= 5e-283) {
tmp = b / (c * z);
} else if (t_1 <= 2e+151) {
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 = -((((y / c) / z) * (-9.0d0)) * x)
if (t_1 <= (-1d+213)) then
tmp = t_2
else if (t_1 <= (-4d+38)) then
tmp = ((a / c) * (-4.0d0)) * t
else if (t_1 <= 5d-283) then
tmp = b / (c * z)
else if (t_1 <= 2d+151) 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 = -((((y / c) / z) * -9.0) * x);
double tmp;
if (t_1 <= -1e+213) {
tmp = t_2;
} else if (t_1 <= -4e+38) {
tmp = ((a / c) * -4.0) * t;
} else if (t_1 <= 5e-283) {
tmp = b / (c * z);
} else if (t_1 <= 2e+151) {
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 = -((((y / c) / z) * -9.0) * x) tmp = 0 if t_1 <= -1e+213: tmp = t_2 elif t_1 <= -4e+38: tmp = ((a / c) * -4.0) * t elif t_1 <= 5e-283: tmp = b / (c * z) elif t_1 <= 2e+151: 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(Float64(Float64(Float64(y / c) / z) * -9.0) * x)) tmp = 0.0 if (t_1 <= -1e+213) tmp = t_2; elseif (t_1 <= -4e+38) tmp = Float64(Float64(Float64(a / c) * -4.0) * t); elseif (t_1 <= 5e-283) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 2e+151) 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 = -((((y / c) / z) * -9.0) * x); tmp = 0.0; if (t_1 <= -1e+213) tmp = t_2; elseif (t_1 <= -4e+38) tmp = ((a / c) * -4.0) * t; elseif (t_1 <= 5e-283) tmp = b / (c * z); elseif (t_1 <= 2e+151) 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[(N[(N[(y / c), $MachinePrecision] / z), $MachinePrecision] * -9.0), $MachinePrecision] * x), $MachinePrecision])}, If[LessEqual[t$95$1, -1e+213], t$95$2, If[LessEqual[t$95$1, -4e+38], N[(N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 5e-283], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+151], 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(\frac{\frac{y}{c}}{z} \cdot -9\right) \cdot x\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+213}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+38}:\\
\;\;\;\;\left(\frac{a}{c} \cdot -4\right) \cdot t\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-283}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+151}:\\
\;\;\;\;-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.99999999999999984e212 or 2.00000000000000003e151 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6437.2
Applied rewrites37.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
if -9.99999999999999984e212 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999991e38Initial program 79.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f6440.9
Applied rewrites40.9%
if -3.99999999999999991e38 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000001e-283Initial program 79.6%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.5
Applied rewrites34.5%
if 5.0000000000000001e-283 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000003e151Initial program 79.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ y (* c z))) (t_2 (* (* x 9.0) y)))
(if (<= t_2 -1e+213)
(* (* x t_1) 9.0)
(if (<= t_2 -4e+38)
(* (* (/ a c) -4.0) t)
(if (<= t_2 5e-283)
(/ b (* c z))
(if (<= t_2 2e+151)
(* -4.0 (/ (* a t) c))
(- (* (* t_1 -9.0) x))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y / (c * z);
double t_2 = (x * 9.0) * y;
double tmp;
if (t_2 <= -1e+213) {
tmp = (x * t_1) * 9.0;
} else if (t_2 <= -4e+38) {
tmp = ((a / c) * -4.0) * t;
} else if (t_2 <= 5e-283) {
tmp = b / (c * z);
} else if (t_2 <= 2e+151) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = -((t_1 * -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) :: t_2
real(8) :: tmp
t_1 = y / (c * z)
t_2 = (x * 9.0d0) * y
if (t_2 <= (-1d+213)) then
tmp = (x * t_1) * 9.0d0
else if (t_2 <= (-4d+38)) then
tmp = ((a / c) * (-4.0d0)) * t
else if (t_2 <= 5d-283) then
tmp = b / (c * z)
else if (t_2 <= 2d+151) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = -((t_1 * (-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 = y / (c * z);
double t_2 = (x * 9.0) * y;
double tmp;
if (t_2 <= -1e+213) {
tmp = (x * t_1) * 9.0;
} else if (t_2 <= -4e+38) {
tmp = ((a / c) * -4.0) * t;
} else if (t_2 <= 5e-283) {
tmp = b / (c * z);
} else if (t_2 <= 2e+151) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = -((t_1 * -9.0) * x);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = y / (c * z) t_2 = (x * 9.0) * y tmp = 0 if t_2 <= -1e+213: tmp = (x * t_1) * 9.0 elif t_2 <= -4e+38: tmp = ((a / c) * -4.0) * t elif t_2 <= 5e-283: tmp = b / (c * z) elif t_2 <= 2e+151: tmp = -4.0 * ((a * t) / c) else: tmp = -((t_1 * -9.0) * x) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(y / Float64(c * z)) t_2 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_2 <= -1e+213) tmp = Float64(Float64(x * t_1) * 9.0); elseif (t_2 <= -4e+38) tmp = Float64(Float64(Float64(a / c) * -4.0) * t); elseif (t_2 <= 5e-283) tmp = Float64(b / Float64(c * z)); elseif (t_2 <= 2e+151) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(-Float64(Float64(t_1 * -9.0) * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = y / (c * z); t_2 = (x * 9.0) * y; tmp = 0.0; if (t_2 <= -1e+213) tmp = (x * t_1) * 9.0; elseif (t_2 <= -4e+38) tmp = ((a / c) * -4.0) * t; elseif (t_2 <= 5e-283) tmp = b / (c * z); elseif (t_2 <= 2e+151) tmp = -4.0 * ((a * t) / c); else tmp = -((t_1 * -9.0) * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+213], N[(N[(x * t$95$1), $MachinePrecision] * 9.0), $MachinePrecision], If[LessEqual[t$95$2, -4e+38], N[(N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$2, 5e-283], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+151], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], (-N[(N[(t$95$1 * -9.0), $MachinePrecision] * x), $MachinePrecision])]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{c \cdot z}\\
t_2 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+213}:\\
\;\;\;\;\left(x \cdot t\_1\right) \cdot 9\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+38}:\\
\;\;\;\;\left(\frac{a}{c} \cdot -4\right) \cdot t\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-283}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+151}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;-\left(t\_1 \cdot -9\right) \cdot x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.99999999999999984e212Initial program 79.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-*.f6485.0
Applied rewrites85.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.4
Applied rewrites84.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6437.2
Applied rewrites37.2%
if -9.99999999999999984e212 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999991e38Initial program 79.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f6440.9
Applied rewrites40.9%
if -3.99999999999999991e38 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000001e-283Initial program 79.6%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.5
Applied rewrites34.5%
if 5.0000000000000001e-283 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000003e151Initial program 79.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
if 2.00000000000000003e151 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6437.2
Applied rewrites37.2%
(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+213)
t_2
(if (<= t_1 -4e+38)
(* (* (/ a c) -4.0) t)
(if (<= t_1 5e-283)
(/ b (* c z))
(if (<= t_1 2e+151) (* -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+213) {
tmp = t_2;
} else if (t_1 <= -4e+38) {
tmp = ((a / c) * -4.0) * t;
} else if (t_1 <= 5e-283) {
tmp = b / (c * z);
} else if (t_1 <= 2e+151) {
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+213)) then
tmp = t_2
else if (t_1 <= (-4d+38)) then
tmp = ((a / c) * (-4.0d0)) * t
else if (t_1 <= 5d-283) then
tmp = b / (c * z)
else if (t_1 <= 2d+151) 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+213) {
tmp = t_2;
} else if (t_1 <= -4e+38) {
tmp = ((a / c) * -4.0) * t;
} else if (t_1 <= 5e-283) {
tmp = b / (c * z);
} else if (t_1 <= 2e+151) {
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+213: tmp = t_2 elif t_1 <= -4e+38: tmp = ((a / c) * -4.0) * t elif t_1 <= 5e-283: tmp = b / (c * z) elif t_1 <= 2e+151: 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+213) tmp = t_2; elseif (t_1 <= -4e+38) tmp = Float64(Float64(Float64(a / c) * -4.0) * t); elseif (t_1 <= 5e-283) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 2e+151) 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+213) tmp = t_2; elseif (t_1 <= -4e+38) tmp = ((a / c) * -4.0) * t; elseif (t_1 <= 5e-283) tmp = b / (c * z); elseif (t_1 <= 2e+151) 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+213], t$95$2, If[LessEqual[t$95$1, -4e+38], N[(N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 5e-283], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+151], 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^{+213}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+38}:\\
\;\;\;\;\left(\frac{a}{c} \cdot -4\right) \cdot t\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-283}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+151}:\\
\;\;\;\;-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.99999999999999984e212 or 2.00000000000000003e151 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.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-*.f6485.0
Applied rewrites85.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.4
Applied rewrites84.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6437.2
Applied rewrites37.2%
if -9.99999999999999984e212 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999991e38Initial program 79.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f6440.9
Applied rewrites40.9%
if -3.99999999999999991e38 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000001e-283Initial program 79.6%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.5
Applied rewrites34.5%
if 5.0000000000000001e-283 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000003e151Initial program 79.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ (* a t) c))))
(if (<= z -9e-63)
t_1
(if (<= z 1.7e-74)
(/ b (* c z))
(if (<= z 1.05e+143) (* (* (/ a c) -4.0) t) 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 <= -9e-63) {
tmp = t_1;
} else if (z <= 1.7e-74) {
tmp = b / (c * z);
} else if (z <= 1.05e+143) {
tmp = ((a / c) * -4.0) * t;
} 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 <= (-9d-63)) then
tmp = t_1
else if (z <= 1.7d-74) then
tmp = b / (c * z)
else if (z <= 1.05d+143) then
tmp = ((a / c) * (-4.0d0)) * t
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 <= -9e-63) {
tmp = t_1;
} else if (z <= 1.7e-74) {
tmp = b / (c * z);
} else if (z <= 1.05e+143) {
tmp = ((a / c) * -4.0) * t;
} 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 <= -9e-63: tmp = t_1 elif z <= 1.7e-74: tmp = b / (c * z) elif z <= 1.05e+143: tmp = ((a / c) * -4.0) * t 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 <= -9e-63) tmp = t_1; elseif (z <= 1.7e-74) tmp = Float64(b / Float64(c * z)); elseif (z <= 1.05e+143) tmp = Float64(Float64(Float64(a / c) * -4.0) * t); 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 <= -9e-63) tmp = t_1; elseif (z <= 1.7e-74) tmp = b / (c * z); elseif (z <= 1.05e+143) tmp = ((a / c) * -4.0) * t; 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, -9e-63], t$95$1, If[LessEqual[z, 1.7e-74], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+143], N[(N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -9 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-74}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+143}:\\
\;\;\;\;\left(\frac{a}{c} \cdot -4\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.9999999999999999e-63 or 1.04999999999999994e143 < z Initial program 79.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
if -8.9999999999999999e-63 < z < 1.7e-74Initial program 79.6%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.5
Applied rewrites34.5%
if 1.7e-74 < z < 1.04999999999999994e143Initial program 79.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f6440.9
Applied rewrites40.9%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* -4.0 (/ (* a t) c)))) (if (<= z -9e-63) t_1 (if (<= z 5.5e-73) (/ b (* c z)) 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 <= -9e-63) {
tmp = t_1;
} else if (z <= 5.5e-73) {
tmp = b / (c * z);
} 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 <= (-9d-63)) then
tmp = t_1
else if (z <= 5.5d-73) then
tmp = b / (c * z)
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 <= -9e-63) {
tmp = t_1;
} else if (z <= 5.5e-73) {
tmp = b / (c * z);
} 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 <= -9e-63: tmp = t_1 elif z <= 5.5e-73: tmp = b / (c * z) 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 <= -9e-63) tmp = t_1; elseif (z <= 5.5e-73) tmp = Float64(b / Float64(c * z)); 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 <= -9e-63) tmp = t_1; elseif (z <= 5.5e-73) tmp = b / (c * z); 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, -9e-63], t$95$1, If[LessEqual[z, 5.5e-73], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -9 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-73}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.9999999999999999e-63 or 5.50000000000000006e-73 < z Initial program 79.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
if -8.9999999999999999e-63 < z < 5.50000000000000006e-73Initial program 79.6%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.5
Applied rewrites34.5%
(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(b / Float64(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[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 79.6%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.5
Applied rewrites34.5%
herbie shell --seed 2025127
(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)))