
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
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, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
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, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (fma y x (- (* t z) (* (* (fma c b a) c) i))))))
(if (<= i -3.6e-73)
t_1
(if (<= i 1e+26)
(* 2.0 (fma (- (* (- b) (* i c)) (* i a)) c (fma t z (* y x))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * fma(y, x, ((t * z) - ((fma(c, b, a) * c) * i)));
double tmp;
if (i <= -3.6e-73) {
tmp = t_1;
} else if (i <= 1e+26) {
tmp = 2.0 * fma(((-b * (i * c)) - (i * a)), c, fma(t, z, (y * x)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(fma(c, b, a) * c) * i)))) tmp = 0.0 if (i <= -3.6e-73) tmp = t_1; elseif (i <= 1e+26) tmp = Float64(2.0 * fma(Float64(Float64(Float64(-b) * Float64(i * c)) - Float64(i * a)), c, fma(t, z, Float64(y * x)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -3.6e-73], t$95$1, If[LessEqual[i, 1e+26], N[(2.0 * N[(N[(N[((-b) * N[(i * c), $MachinePrecision]), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision] * c + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\
\mathbf{if}\;i \leq -3.6 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 10^{+26}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -3.5999999999999999e-73 or 1.00000000000000005e26 < i Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
if -3.5999999999999999e-73 < i < 1.00000000000000005e26Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.2
Applied rewrites89.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ a (* b c)) c)))
(if (<= t_1 (- INFINITY))
(* (* -2.0 c) (fma i a (* (* i c) b)))
(if (<= t_1 5e+257)
(* 2.0 (fma y x (- (* t z) (* (* (fma c b a) c) i))))
(* 2.0 (- (* y x) (* (* (fma c b a) i) c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a + (b * c)) * c;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (-2.0 * c) * fma(i, a, ((i * c) * b));
} else if (t_1 <= 5e+257) {
tmp = 2.0 * fma(y, x, ((t * z) - ((fma(c, b, a) * c) * i)));
} else {
tmp = 2.0 * ((y * x) - ((fma(c, b, a) * i) * c));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(-2.0 * c) * fma(i, a, Float64(Float64(i * c) * b))); elseif (t_1 <= 5e+257) tmp = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(fma(c, b, a) * c) * i)))); else tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * i) * c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(-2.0 * c), $MachinePrecision] * N[(i * a + N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+257], N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(-2 \cdot c\right) \cdot \mathsf{fma}\left(i, a, \left(i \cdot c\right) \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+257}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
Taylor expanded in i around inf
associate-+r-N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites46.9%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6445.6
Applied rewrites45.6%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 5.00000000000000028e257Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
if 5.00000000000000028e257 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.6%
Taylor expanded in z around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.3
Applied rewrites69.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma c b a) i)))
(if (<= (* x y) -1e+105)
(* 2.0 (* (- x) (fma c (/ t_1 x) (- y))))
(if (<= (* x y) 2e-18)
(* 2.0 (- (* t z) (* t_1 c)))
(* (- (fma t z (* y x)) (* (* c (* i c)) b)) 2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(c, b, a) * i;
double tmp;
if ((x * y) <= -1e+105) {
tmp = 2.0 * (-x * fma(c, (t_1 / x), -y));
} else if ((x * y) <= 2e-18) {
tmp = 2.0 * ((t * z) - (t_1 * c));
} else {
tmp = (fma(t, z, (y * x)) - ((c * (i * c)) * b)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(c, b, a) * i) tmp = 0.0 if (Float64(x * y) <= -1e+105) tmp = Float64(2.0 * Float64(Float64(-x) * fma(c, Float64(t_1 / x), Float64(-y)))); elseif (Float64(x * y) <= 2e-18) tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(t_1 * c))); else tmp = Float64(Float64(fma(t, z, Float64(y * x)) - Float64(Float64(c * Float64(i * c)) * b)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+105], N[(2.0 * N[((-x) * N[(c * N[(t$95$1 / x), $MachinePrecision] + (-y)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-18], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(t$95$1 * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(i * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, a\right) \cdot i\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+105}:\\
\;\;\;\;2 \cdot \left(\left(-x\right) \cdot \mathsf{fma}\left(c, \frac{t\_1}{x}, -y\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-18}:\\
\;\;\;\;2 \cdot \left(t \cdot z - t\_1 \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999994e104Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
Taylor expanded in z around 0
associate-+r-N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower--.f64N/A
Applied rewrites69.4%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6465.6
Applied rewrites65.6%
if -9.9999999999999994e104 < (*.f64 x y) < 2.0000000000000001e-18Initial program 90.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.0
Applied rewrites69.0%
if 2.0000000000000001e-18 < (*.f64 x y) Initial program 90.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.3
Applied rewrites76.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.3
Applied rewrites79.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (fma c b a) i) c)) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -1e+48)
(* 2.0 (- (* t z) t_1))
(if (<= t_2 2e+137)
(* (- (fma t z (* y x)) (* (* c (* i c)) b)) 2.0)
(* 2.0 (- (* y x) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (fma(c, b, a) * i) * c;
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -1e+48) {
tmp = 2.0 * ((t * z) - t_1);
} else if (t_2 <= 2e+137) {
tmp = (fma(t, z, (y * x)) - ((c * (i * c)) * b)) * 2.0;
} else {
tmp = 2.0 * ((y * x) - t_1);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(fma(c, b, a) * i) * c) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -1e+48) tmp = Float64(2.0 * Float64(Float64(t * z) - t_1)); elseif (t_2 <= 2e+137) tmp = Float64(Float64(fma(t, z, Float64(y * x)) - Float64(Float64(c * Float64(i * c)) * b)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(y * x) - t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+48], N[(2.0 * N[(N[(t * z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+137], N[(N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(i * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+48}:\\
\;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+137}:\\
\;\;\;\;\left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.00000000000000004e48Initial program 90.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.0
Applied rewrites69.0%
if -1.00000000000000004e48 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.0000000000000001e137Initial program 90.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.3
Applied rewrites76.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.3
Applied rewrites79.3%
if 2.0000000000000001e137 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.6%
Taylor expanded in z around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.3
Applied rewrites69.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (fma c b a) i) c)) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -1e+48)
(* 2.0 (- (* t z) t_1))
(if (<= t_2 1e-55)
(* (fma t z (* y x)) 2.0)
(if (<= t_2 2e+137)
(* 2.0 (- (* t z) (* t_2 i)))
(* 2.0 (- (* y x) t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (fma(c, b, a) * i) * c;
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -1e+48) {
tmp = 2.0 * ((t * z) - t_1);
} else if (t_2 <= 1e-55) {
tmp = fma(t, z, (y * x)) * 2.0;
} else if (t_2 <= 2e+137) {
tmp = 2.0 * ((t * z) - (t_2 * i));
} else {
tmp = 2.0 * ((y * x) - t_1);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(fma(c, b, a) * i) * c) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -1e+48) tmp = Float64(2.0 * Float64(Float64(t * z) - t_1)); elseif (t_2 <= 1e-55) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); elseif (t_2 <= 2e+137) tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(t_2 * i))); else tmp = Float64(2.0 * Float64(Float64(y * x) - t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+48], N[(2.0 * N[(N[(t * z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-55], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+137], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(t$95$2 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+48}:\\
\;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+137}:\\
\;\;\;\;2 \cdot \left(t \cdot z - t\_2 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.00000000000000004e48Initial program 90.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.0
Applied rewrites69.0%
if -1.00000000000000004e48 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.99999999999999995e-56Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
if 9.99999999999999995e-56 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.0000000000000001e137Initial program 90.6%
Taylor expanded in x around 0
lower-*.f6468.8
Applied rewrites68.8%
if 2.0000000000000001e137 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.6%
Taylor expanded in z around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.3
Applied rewrites69.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (fma c b a) i) c)) (t_2 (* 2.0 (- (* y x) t_1))))
(if (<= (* x y) -2.0)
t_2
(if (<= (* x y) 50000000000000.0)
(* 2.0 (- (* t z) t_1))
(if (<= (* x y) 1e+225) t_2 (* (fma y x (* z t)) 2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (fma(c, b, a) * i) * c;
double t_2 = 2.0 * ((y * x) - t_1);
double tmp;
if ((x * y) <= -2.0) {
tmp = t_2;
} else if ((x * y) <= 50000000000000.0) {
tmp = 2.0 * ((t * z) - t_1);
} else if ((x * y) <= 1e+225) {
tmp = t_2;
} else {
tmp = fma(y, x, (z * t)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(fma(c, b, a) * i) * c) t_2 = Float64(2.0 * Float64(Float64(y * x) - t_1)) tmp = 0.0 if (Float64(x * y) <= -2.0) tmp = t_2; elseif (Float64(x * y) <= 50000000000000.0) tmp = Float64(2.0 * Float64(Float64(t * z) - t_1)); elseif (Float64(x * y) <= 1e+225) tmp = t_2; else tmp = Float64(fma(y, x, Float64(z * t)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.0], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 50000000000000.0], N[(2.0 * N[(N[(t * z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+225], t$95$2, N[(N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\
t_2 := 2 \cdot \left(y \cdot x - t\_1\right)\\
\mathbf{if}\;x \cdot y \leq -2:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 50000000000000:\\
\;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+225}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 x y) < -2 or 5e13 < (*.f64 x y) < 9.99999999999999928e224Initial program 90.6%
Taylor expanded in z around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.3
Applied rewrites69.3%
if -2 < (*.f64 x y) < 5e13Initial program 90.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.0
Applied rewrites69.0%
if 9.99999999999999928e224 < (*.f64 x y) Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2.0)
(* 2.0 (- (* x y) (* (* (fma b c a) c) i)))
(if (<= (* x y) 50000000000000.0)
(* 2.0 (- (* t z) (* (* (fma c b a) i) c)))
(if (<= (* x y) 1e+225)
(* (- (* x y) (* (* (* c c) i) b)) 2.0)
(* (fma y x (* z t)) 2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2.0) {
tmp = 2.0 * ((x * y) - ((fma(b, c, a) * c) * i));
} else if ((x * y) <= 50000000000000.0) {
tmp = 2.0 * ((t * z) - ((fma(c, b, a) * i) * c));
} else if ((x * y) <= 1e+225) {
tmp = ((x * y) - (((c * c) * i) * b)) * 2.0;
} else {
tmp = fma(y, x, (z * t)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2.0) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(fma(b, c, a) * c) * i))); elseif (Float64(x * y) <= 50000000000000.0) tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(Float64(fma(c, b, a) * i) * c))); elseif (Float64(x * y) <= 1e+225) tmp = Float64(Float64(Float64(x * y) - Float64(Float64(Float64(c * c) * i) * b)) * 2.0); else tmp = Float64(fma(y, x, Float64(z * t)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2.0], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 50000000000000.0], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+225], N[(N[(N[(x * y), $MachinePrecision] - N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2:\\
\;\;\;\;2 \cdot \left(x \cdot y - \left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right)\\
\mathbf{elif}\;x \cdot y \leq 50000000000000:\\
\;\;\;\;2 \cdot \left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+225}:\\
\;\;\;\;\left(x \cdot y - \left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 x y) < -2Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
Taylor expanded in z around 0
associate-+r-N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower--.f64N/A
Applied rewrites69.4%
if -2 < (*.f64 x y) < 5e13Initial program 90.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.0
Applied rewrites69.0%
if 5e13 < (*.f64 x y) < 9.99999999999999928e224Initial program 90.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.3
Applied rewrites76.3%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6455.1
Applied rewrites55.1%
if 9.99999999999999928e224 < (*.f64 x y) Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+113)
(* 2.0 (- (* x y) (* (* (* c b) c) i)))
(if (<= (* x y) 50000000000000.0)
(* 2.0 (- (* t z) (* (* (fma c b a) i) c)))
(if (<= (* x y) 1e+225)
(* (- (* x y) (* (* (* c c) i) b)) 2.0)
(* (fma y x (* z t)) 2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+113) {
tmp = 2.0 * ((x * y) - (((c * b) * c) * i));
} else if ((x * y) <= 50000000000000.0) {
tmp = 2.0 * ((t * z) - ((fma(c, b, a) * i) * c));
} else if ((x * y) <= 1e+225) {
tmp = ((x * y) - (((c * c) * i) * b)) * 2.0;
} else {
tmp = fma(y, x, (z * t)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+113) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(Float64(c * b) * c) * i))); elseif (Float64(x * y) <= 50000000000000.0) tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(Float64(fma(c, b, a) * i) * c))); elseif (Float64(x * y) <= 1e+225) tmp = Float64(Float64(Float64(x * y) - Float64(Float64(Float64(c * c) * i) * b)) * 2.0); else tmp = Float64(fma(y, x, Float64(z * t)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+113], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(N[(c * b), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 50000000000000.0], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+225], N[(N[(N[(x * y), $MachinePrecision] - N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+113}:\\
\;\;\;\;2 \cdot \left(x \cdot y - \left(\left(c \cdot b\right) \cdot c\right) \cdot i\right)\\
\mathbf{elif}\;x \cdot y \leq 50000000000000:\\
\;\;\;\;2 \cdot \left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+225}:\\
\;\;\;\;\left(x \cdot y - \left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 x y) < -5e113Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
Taylor expanded in z around 0
associate-+r-N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower--.f64N/A
Applied rewrites69.4%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f6455.3
Applied rewrites55.3%
if -5e113 < (*.f64 x y) < 5e13Initial program 90.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.0
Applied rewrites69.0%
if 5e13 < (*.f64 x y) < 9.99999999999999928e224Initial program 90.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.3
Applied rewrites76.3%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6455.1
Applied rewrites55.1%
if 9.99999999999999928e224 < (*.f64 x y) Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* (* (fma c b a) i) c))) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -1e+48)
t_1
(if (<= t_2 1e+160) (* (fma t z (* y x)) 2.0) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * ((fma(c, b, a) * i) * c);
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -1e+48) {
tmp = t_1;
} else if (t_2 <= 1e+160) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -1e+48) tmp = t_1; elseif (t_2 <= 1e+160) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+48], t$95$1, If[LessEqual[t$95$2, 1e+160], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.00000000000000004e48 or 1.00000000000000001e160 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.6%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6446.9
Applied rewrites46.9%
if -1.00000000000000004e48 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1.00000000000000001e160Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ a (* b c)) c)))
(if (<= t_1 -1e+230)
(* (* -2.0 c) (* (* i c) b))
(if (<= t_1 1e+160)
(* (fma y x (* z t)) 2.0)
(if (<= t_1 5e+294)
(* (* (* i c) a) -2.0)
(* (* (* (* c c) i) b) -2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a + (b * c)) * c;
double tmp;
if (t_1 <= -1e+230) {
tmp = (-2.0 * c) * ((i * c) * b);
} else if (t_1 <= 1e+160) {
tmp = fma(y, x, (z * t)) * 2.0;
} else if (t_1 <= 5e+294) {
tmp = ((i * c) * a) * -2.0;
} else {
tmp = (((c * c) * i) * b) * -2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_1 <= -1e+230) tmp = Float64(Float64(-2.0 * c) * Float64(Float64(i * c) * b)); elseif (t_1 <= 1e+160) tmp = Float64(fma(y, x, Float64(z * t)) * 2.0); elseif (t_1 <= 5e+294) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); else tmp = Float64(Float64(Float64(Float64(c * c) * i) * b) * -2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+230], N[(N[(-2.0 * c), $MachinePrecision] * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+160], N[(N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+294], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+230}:\\
\;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+294}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.0000000000000001e230Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
Taylor expanded in i around inf
associate-+r-N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites46.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.3
Applied rewrites33.3%
if -1.0000000000000001e230 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1.00000000000000001e160Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
if 1.00000000000000001e160 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999999e294Initial program 90.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
if 4.9999999999999999e294 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ a (* b c)) c)))
(if (<= t_1 -1e+230)
(* (* -2.0 c) (* (* i c) b))
(if (<= t_1 1e+160)
(* (fma y x (* z t)) 2.0)
(if (<= t_1 5e+294)
(* (* (* i c) a) -2.0)
(* (* (* c (* i c)) b) -2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a + (b * c)) * c;
double tmp;
if (t_1 <= -1e+230) {
tmp = (-2.0 * c) * ((i * c) * b);
} else if (t_1 <= 1e+160) {
tmp = fma(y, x, (z * t)) * 2.0;
} else if (t_1 <= 5e+294) {
tmp = ((i * c) * a) * -2.0;
} else {
tmp = ((c * (i * c)) * b) * -2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_1 <= -1e+230) tmp = Float64(Float64(-2.0 * c) * Float64(Float64(i * c) * b)); elseif (t_1 <= 1e+160) tmp = Float64(fma(y, x, Float64(z * t)) * 2.0); elseif (t_1 <= 5e+294) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); else tmp = Float64(Float64(Float64(c * Float64(i * c)) * b) * -2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+230], N[(N[(-2.0 * c), $MachinePrecision] * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+160], N[(N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+294], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(N[(N[(c * N[(i * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+230}:\\
\;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+294}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.0000000000000001e230Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
Taylor expanded in i around inf
associate-+r-N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites46.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.3
Applied rewrites33.3%
if -1.0000000000000001e230 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1.00000000000000001e160Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
if 1.00000000000000001e160 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999999e294Initial program 90.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
if 4.9999999999999999e294 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.4
Applied rewrites32.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.4
Applied rewrites33.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* -2.0 c) (* (* i c) b))) (t_2 (* (+ a (* b c)) c)))
(if (<= t_2 -1e+230)
t_1
(if (<= t_2 1e+160)
(* (fma y x (* z t)) 2.0)
(if (<= t_2 2e+298) (* (* (* i c) a) -2.0) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (-2.0 * c) * ((i * c) * b);
double t_2 = (a + (b * c)) * c;
double tmp;
if (t_2 <= -1e+230) {
tmp = t_1;
} else if (t_2 <= 1e+160) {
tmp = fma(y, x, (z * t)) * 2.0;
} else if (t_2 <= 2e+298) {
tmp = ((i * c) * a) * -2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-2.0 * c) * Float64(Float64(i * c) * b)) t_2 = Float64(Float64(a + Float64(b * c)) * c) tmp = 0.0 if (t_2 <= -1e+230) tmp = t_1; elseif (t_2 <= 1e+160) tmp = Float64(fma(y, x, Float64(z * t)) * 2.0); elseif (t_2 <= 2e+298) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(-2.0 * c), $MachinePrecision] * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+230], t$95$1, If[LessEqual[t$95$2, 1e+160], N[(N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+298], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right)\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+230}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.0000000000000001e230 or 1.9999999999999999e298 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
Taylor expanded in i around inf
associate-+r-N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites46.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.3
Applied rewrites33.3%
if -1.0000000000000001e230 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1.00000000000000001e160Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
if 1.00000000000000001e160 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1.9999999999999999e298Initial program 90.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -5e+255)
t_1
(if (<= t_2 5e+253) (* (fma y x (* z t)) 2.0) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((i * c) * a) * -2.0;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+255) {
tmp = t_1;
} else if (t_2 <= 5e+253) {
tmp = fma(y, x, (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(i * c) * a) * -2.0) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -5e+255) tmp = t_1; elseif (t_2 <= 5e+253) tmp = Float64(fma(y, x, Float64(z * t)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+255], t$95$1, If[LessEqual[t$95$2, 5e+253], N[(N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+253}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000002e255 or 4.9999999999999997e253 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
if -5.0000000000000002e255 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999997e253Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -5e+255)
t_1
(if (<= t_2 5e+253) (* (fma t z (* y x)) 2.0) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((i * c) * a) * -2.0;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+255) {
tmp = t_1;
} else if (t_2 <= 5e+253) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(i * c) * a) * -2.0) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -5e+255) tmp = t_1; elseif (t_2 <= 5e+253) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+255], t$95$1, If[LessEqual[t$95$2, 5e+253], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+253}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000002e255 or 4.9999999999999997e253 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
if -5.0000000000000002e255 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999997e253Initial program 90.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (+ t t) z)))
(if (<= (* z t) -500000.0)
t_2
(if (<= (* z t) -5e-172)
t_1
(if (<= (* z t) 1e-251)
(* (+ x x) y)
(if (<= (* z t) 4e+224) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((i * c) * a) * -2.0;
double t_2 = (t + t) * z;
double tmp;
if ((z * t) <= -500000.0) {
tmp = t_2;
} else if ((z * t) <= -5e-172) {
tmp = t_1;
} else if ((z * t) <= 1e-251) {
tmp = (x + x) * y;
} else if ((z * t) <= 4e+224) {
tmp = t_1;
} 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, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((i * c) * a) * (-2.0d0)
t_2 = (t + t) * z
if ((z * t) <= (-500000.0d0)) then
tmp = t_2
else if ((z * t) <= (-5d-172)) then
tmp = t_1
else if ((z * t) <= 1d-251) then
tmp = (x + x) * y
else if ((z * t) <= 4d+224) then
tmp = t_1
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 i) {
double t_1 = ((i * c) * a) * -2.0;
double t_2 = (t + t) * z;
double tmp;
if ((z * t) <= -500000.0) {
tmp = t_2;
} else if ((z * t) <= -5e-172) {
tmp = t_1;
} else if ((z * t) <= 1e-251) {
tmp = (x + x) * y;
} else if ((z * t) <= 4e+224) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((i * c) * a) * -2.0 t_2 = (t + t) * z tmp = 0 if (z * t) <= -500000.0: tmp = t_2 elif (z * t) <= -5e-172: tmp = t_1 elif (z * t) <= 1e-251: tmp = (x + x) * y elif (z * t) <= 4e+224: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(i * c) * a) * -2.0) t_2 = Float64(Float64(t + t) * z) tmp = 0.0 if (Float64(z * t) <= -500000.0) tmp = t_2; elseif (Float64(z * t) <= -5e-172) tmp = t_1; elseif (Float64(z * t) <= 1e-251) tmp = Float64(Float64(x + x) * y); elseif (Float64(z * t) <= 4e+224) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((i * c) * a) * -2.0; t_2 = (t + t) * z; tmp = 0.0; if ((z * t) <= -500000.0) tmp = t_2; elseif ((z * t) <= -5e-172) tmp = t_1; elseif ((z * t) <= 1e-251) tmp = (x + x) * y; elseif ((z * t) <= 4e+224) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -500000.0], t$95$2, If[LessEqual[N[(z * t), $MachinePrecision], -5e-172], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e-251], N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 4e+224], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(t + t\right) \cdot z\\
\mathbf{if}\;z \cdot t \leq -500000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \cdot t \leq -5 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 10^{-251}:\\
\;\;\;\;\left(x + x\right) \cdot y\\
\mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 z t) < -5e5 or 3.99999999999999988e224 < (*.f64 z t) Initial program 90.6%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.0
Applied rewrites29.0%
if -5e5 < (*.f64 z t) < -4.9999999999999999e-172 or 1.00000000000000002e-251 < (*.f64 z t) < 3.99999999999999988e224Initial program 90.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
if -4.9999999999999999e-172 < (*.f64 z t) < 1.00000000000000002e-251Initial program 90.6%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.8
Applied rewrites29.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ t t) z)))
(if (<= (* z t) -5e+143)
t_1
(if (<= (* z t) 1e-251)
(* (+ x x) y)
(if (<= (* z t) 4e+224) (* (* -2.0 c) (* i a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (t + t) * z;
double tmp;
if ((z * t) <= -5e+143) {
tmp = t_1;
} else if ((z * t) <= 1e-251) {
tmp = (x + x) * y;
} else if ((z * t) <= 4e+224) {
tmp = (-2.0 * c) * (i * a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (t + t) * z
if ((z * t) <= (-5d+143)) then
tmp = t_1
else if ((z * t) <= 1d-251) then
tmp = (x + x) * y
else if ((z * t) <= 4d+224) then
tmp = ((-2.0d0) * c) * (i * a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (t + t) * z;
double tmp;
if ((z * t) <= -5e+143) {
tmp = t_1;
} else if ((z * t) <= 1e-251) {
tmp = (x + x) * y;
} else if ((z * t) <= 4e+224) {
tmp = (-2.0 * c) * (i * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (t + t) * z tmp = 0 if (z * t) <= -5e+143: tmp = t_1 elif (z * t) <= 1e-251: tmp = (x + x) * y elif (z * t) <= 4e+224: tmp = (-2.0 * c) * (i * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(t + t) * z) tmp = 0.0 if (Float64(z * t) <= -5e+143) tmp = t_1; elseif (Float64(z * t) <= 1e-251) tmp = Float64(Float64(x + x) * y); elseif (Float64(z * t) <= 4e+224) tmp = Float64(Float64(-2.0 * c) * Float64(i * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (t + t) * z; tmp = 0.0; if ((z * t) <= -5e+143) tmp = t_1; elseif ((z * t) <= 1e-251) tmp = (x + x) * y; elseif ((z * t) <= 4e+224) tmp = (-2.0 * c) * (i * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -5e+143], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e-251], N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 4e+224], N[(N[(-2.0 * c), $MachinePrecision] * N[(i * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + t\right) \cdot z\\
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 10^{-251}:\\
\;\;\;\;\left(x + x\right) \cdot y\\
\mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+224}:\\
\;\;\;\;\left(-2 \cdot c\right) \cdot \left(i \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -5.00000000000000012e143 or 3.99999999999999988e224 < (*.f64 z t) Initial program 90.6%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.0
Applied rewrites29.0%
if -5.00000000000000012e143 < (*.f64 z t) < 1.00000000000000002e-251Initial program 90.6%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.8
Applied rewrites29.8%
if 1.00000000000000002e-251 < (*.f64 z t) < 3.99999999999999988e224Initial program 90.6%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
Taylor expanded in i around inf
associate-+r-N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites46.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6422.2
Applied rewrites22.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ x x) y)))
(if (<= (* x y) -1e+105)
t_1
(if (<= (* x y) 50000000000000.0) (* (+ t t) z) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + x) * y;
double tmp;
if ((x * y) <= -1e+105) {
tmp = t_1;
} else if ((x * y) <= 50000000000000.0) {
tmp = (t + t) * 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, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x + x) * y
if ((x * y) <= (-1d+105)) then
tmp = t_1
else if ((x * y) <= 50000000000000.0d0) then
tmp = (t + t) * 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 i) {
double t_1 = (x + x) * y;
double tmp;
if ((x * y) <= -1e+105) {
tmp = t_1;
} else if ((x * y) <= 50000000000000.0) {
tmp = (t + t) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x + x) * y tmp = 0 if (x * y) <= -1e+105: tmp = t_1 elif (x * y) <= 50000000000000.0: tmp = (t + t) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + x) * y) tmp = 0.0 if (Float64(x * y) <= -1e+105) tmp = t_1; elseif (Float64(x * y) <= 50000000000000.0) tmp = Float64(Float64(t + t) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x + x) * y; tmp = 0.0; if ((x * y) <= -1e+105) tmp = t_1; elseif ((x * y) <= 50000000000000.0) tmp = (t + t) * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+105], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 50000000000000.0], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + x\right) \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 50000000000000:\\
\;\;\;\;\left(t + t\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999994e104 or 5e13 < (*.f64 x y) Initial program 90.6%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.8
Applied rewrites29.8%
if -9.9999999999999994e104 < (*.f64 x y) < 5e13Initial program 90.6%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.0
Applied rewrites29.0%
(FPCore (x y z t a b c i) :precision binary64 (* (+ t t) z))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + t) * 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, i)
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), intent (in) :: i
code = (t + t) * z
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + t) * z;
}
def code(x, y, z, t, a, b, c, i): return (t + t) * z
function code(x, y, z, t, a, b, c, i) return Float64(Float64(t + t) * z) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (t + t) * z; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}
\\
\left(t + t\right) \cdot z
\end{array}
Initial program 90.6%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.0
Applied rewrites29.0%
herbie shell --seed 2025142
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))