
(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]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
Herbie found 12 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]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))) INFINITY) (* 2.0 (fma (fma c b a) (* (- c) i) (fma t z (* y x)))) (* (* (* i c) b) (* c -2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))) <= ((double) INFINITY)) {
tmp = 2.0 * fma(fma(c, b, a), (-c * i), fma(t, z, (y * x)));
} else {
tmp = ((i * c) * b) * (c * -2.0);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) <= Inf) tmp = Float64(2.0 * fma(fma(c, b, a), Float64(Float64(-c) * i), fma(t, z, Float64(y * x)))); else tmp = Float64(Float64(Float64(i * c) * b) * Float64(c * -2.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[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], Infinity], N[(2.0 * N[(N[(c * b + a), $MachinePrecision] * N[((-c) * i), $MachinePrecision] + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision] * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \leq \infty:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), \left(-c\right) \cdot i, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot b\right) \cdot \left(c \cdot -2\right)\\
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i))) < +inf.0Initial program 90.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6494.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.3%
Applied rewrites95.3%
if +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i))) Initial program 90.0%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6432.8%
Applied rewrites32.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.6%
Applied rewrites33.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (fma (fma c b a) (* (- c) i) (* t z))))
(t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -2e+118)
t_1
(if (<= t_2 2e+298)
(* (fma z t (- (* x y) (* (* i c) (* b c)))) 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(fma(c, b, a), (-c * i), (t * z));
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -2e+118) {
tmp = t_1;
} else if (t_2 <= 2e+298) {
tmp = fma(z, t, ((x * y) - ((i * c) * (b * c)))) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * fma(fma(c, b, a), Float64(Float64(-c) * i), Float64(t * z))) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -2e+118) tmp = t_1; elseif (t_2 <= 2e+298) tmp = Float64(fma(z, t, Float64(Float64(x * y) - Float64(Float64(i * c) * Float64(b * c)))) * 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[(c * b + a), $MachinePrecision] * N[((-c) * i), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+118], t$95$1, If[LessEqual[t$95$2, 2e+298], N[(N[(z * t + N[(N[(x * y), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := 2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), \left(-c\right) \cdot i, t \cdot z\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;\mathsf{fma}\left(z, t, x \cdot y - \left(i \cdot c\right) \cdot \left(b \cdot c\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e118 or 1.9999999999999999e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6494.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.3%
Applied rewrites95.3%
Taylor expanded in x around 0
lower-*.f6471.7%
Applied rewrites71.7%
if -1.9999999999999999e118 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e298Initial program 90.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6494.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.3%
Applied rewrites95.3%
Taylor expanded in a around 0
lower-*.f6480.1%
Applied rewrites80.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.1%
Applied rewrites80.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (- c) i))
(t_2 (* 2.0 (fma (fma c b a) t_1 (* t z))))
(t_3 (* (* (+ a (* b c)) c) i)))
(if (<= t_3 -2e+118)
t_2
(if (<= t_3 2e+298) (* 2.0 (fma (* b c) t_1 (fma t z (* y x)))) t_2))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -c * i;
double t_2 = 2.0 * fma(fma(c, b, a), t_1, (t * z));
double t_3 = ((a + (b * c)) * c) * i;
double tmp;
if (t_3 <= -2e+118) {
tmp = t_2;
} else if (t_3 <= 2e+298) {
tmp = 2.0 * fma((b * c), t_1, fma(t, z, (y * x)));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-c) * i) t_2 = Float64(2.0 * fma(fma(c, b, a), t_1, Float64(t * z))) t_3 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_3 <= -2e+118) tmp = t_2; elseif (t_3 <= 2e+298) tmp = Float64(2.0 * fma(Float64(b * c), t_1, fma(t, z, Float64(y * x)))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[((-c) * i), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(c * b + a), $MachinePrecision] * t$95$1 + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+118], t$95$2, If[LessEqual[t$95$3, 2e+298], N[(2.0 * N[(N[(b * c), $MachinePrecision] * t$95$1 + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \left(-c\right) \cdot i\\
t_2 := 2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), t\_1, t \cdot z\right)\\
t_3 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+118}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b \cdot c, t\_1, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e118 or 1.9999999999999999e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6494.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.3%
Applied rewrites95.3%
Taylor expanded in x around 0
lower-*.f6471.7%
Applied rewrites71.7%
if -1.9999999999999999e118 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e298Initial program 90.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6494.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.3%
Applied rewrites95.3%
Taylor expanded in a around 0
lower-*.f6480.1%
Applied rewrites80.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -1e+79)
(* 2.0 (fma (fma c b a) (* (- c) i) (* t z)))
(if (<= t_1 1e-13)
(* 2.0 (fma t z (* x y)))
(* 2.0 (fma (fma b c a) (* i (- c)) (* x y)))))))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) * i;
double tmp;
if (t_1 <= -1e+79) {
tmp = 2.0 * fma(fma(c, b, a), (-c * i), (t * z));
} else if (t_1 <= 1e-13) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = 2.0 * fma(fma(b, c, a), (i * -c), (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_1 <= -1e+79) tmp = Float64(2.0 * fma(fma(c, b, a), Float64(Float64(-c) * i), Float64(t * z))); elseif (t_1 <= 1e-13) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(2.0 * fma(fma(b, c, a), Float64(i * Float64(-c)), Float64(x * y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+79], N[(2.0 * N[(N[(c * b + a), $MachinePrecision] * N[((-c) * i), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-13], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b * c + a), $MachinePrecision] * N[(i * (-c)), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+79}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), \left(-c\right) \cdot i, t \cdot z\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-13}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), i \cdot \left(-c\right), x \cdot y\right)\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999997e78Initial program 90.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6494.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.3%
Applied rewrites95.3%
Taylor expanded in x around 0
lower-*.f6471.7%
Applied rewrites71.7%
if -9.9999999999999997e78 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e-13Initial program 90.0%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
if 1e-13 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6469.7%
Applied rewrites69.7%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-fma.f6472.9%
Applied rewrites72.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c)))
(t_2 (* -2.0 (* c (* i t_1))))
(t_3 (* (* t_1 c) i)))
(if (<= t_3 -5e+274)
t_2
(if (<= t_3 1e-13)
(* 2.0 (fma t z (* x y)))
(if (<= t_3 2e+306) (* 2.0 (- (* x y) (* (* (fma b c a) c) i))) t_2)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = -2.0 * (c * (i * t_1));
double t_3 = (t_1 * c) * i;
double tmp;
if (t_3 <= -5e+274) {
tmp = t_2;
} else if (t_3 <= 1e-13) {
tmp = 2.0 * fma(t, z, (x * y));
} else if (t_3 <= 2e+306) {
tmp = 2.0 * ((x * y) - ((fma(b, c, a) * c) * i));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(-2.0 * Float64(c * Float64(i * t_1))) t_3 = Float64(Float64(t_1 * c) * i) tmp = 0.0 if (t_3 <= -5e+274) tmp = t_2; elseif (t_3 <= 1e-13) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); elseif (t_3 <= 2e+306) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(fma(b, c, a) * c) * i))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+274], t$95$2, If[LessEqual[t$95$3, 1e-13], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+306], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := -2 \cdot \left(c \cdot \left(i \cdot t\_1\right)\right)\\
t_3 := \left(t\_1 \cdot c\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+274}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 10^{-13}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;2 \cdot \left(x \cdot y - \left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999998e274 or 2e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6447.5%
Applied rewrites47.5%
if -4.9999999999999998e274 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e-13Initial program 90.0%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
if 1e-13 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e306Initial program 90.0%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6469.7%
Applied rewrites69.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-*.f6469.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6469.1%
Applied rewrites69.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (fma (fma b c a) (* i (- c)) (* x y))))
(t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -1e+79) t_1 (if (<= t_2 1e-13) (* 2.0 (fma t z (* x y))) 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(fma(b, c, a), (i * -c), (x * y));
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -1e+79) {
tmp = t_1;
} else if (t_2 <= 1e-13) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * fma(fma(b, c, a), Float64(i * Float64(-c)), Float64(x * y))) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -1e+79) tmp = t_1; elseif (t_2 <= 1e-13) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); 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[(b * c + a), $MachinePrecision] * N[(i * (-c)), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+79], t$95$1, If[LessEqual[t$95$2, 1e-13], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := 2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), i \cdot \left(-c\right), x \cdot y\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-13}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999997e78 or 1e-13 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6469.7%
Applied rewrites69.7%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-fma.f6472.9%
Applied rewrites72.9%
if -9.9999999999999997e78 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e-13Initial program 90.0%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c)))
(t_2 (* -2.0 (* c (* i t_1))))
(t_3 (* (* t_1 c) i)))
(if (<= t_3 -5e+274)
t_2
(if (<= t_3 2e+142) (* 2.0 (fma t z (* x y))) t_2))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = -2.0 * (c * (i * t_1));
double t_3 = (t_1 * c) * i;
double tmp;
if (t_3 <= -5e+274) {
tmp = t_2;
} else if (t_3 <= 2e+142) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(-2.0 * Float64(c * Float64(i * t_1))) t_3 = Float64(Float64(t_1 * c) * i) tmp = 0.0 if (t_3 <= -5e+274) tmp = t_2; elseif (t_3 <= 2e+142) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+274], t$95$2, If[LessEqual[t$95$3, 2e+142], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := -2 \cdot \left(c \cdot \left(i \cdot t\_1\right)\right)\\
t_3 := \left(t\_1 \cdot c\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+274}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+142}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999998e274 or 2.0000000000000001e142 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6447.5%
Applied rewrites47.5%
if -4.9999999999999998e274 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e142Initial program 90.0%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 (- INFINITY))
(* (* (* i c) b) (* c -2.0))
(if (<= t_1 2e+298)
(* 2.0 (fma t z (* x y)))
(* -2.0 (* b (* (* i c) 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) * i;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((i * c) * b) * (c * -2.0);
} else if (t_1 <= 2e+298) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = -2.0 * (b * ((i * c) * c));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(i * c) * b) * Float64(c * -2.0)); elseif (t_1 <= 2e+298) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(-2.0 * Float64(b * Float64(Float64(i * c) * c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision] * N[(c * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+298], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(b * N[(N[(i * c), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot b\right) \cdot \left(c \cdot -2\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(b \cdot \left(\left(i \cdot c\right) \cdot c\right)\right)\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 90.0%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6432.8%
Applied rewrites32.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.6%
Applied rewrites33.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e298Initial program 90.0%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
if 1.9999999999999999e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6432.8%
Applied rewrites32.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.6%
Applied rewrites33.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* b (* (* i c) c)))) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 2e+298) (* 2.0 (fma t z (* x y))) 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 * (b * ((i * c) * c));
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 2e+298) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(b * Float64(Float64(i * c) * c))) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 2e+298) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); 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[(b * N[(N[(i * c), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 2e+298], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := -2 \cdot \left(b \cdot \left(\left(i \cdot c\right) \cdot c\right)\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 1.9999999999999999e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6432.8%
Applied rewrites32.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.6%
Applied rewrites33.6%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e298Initial program 90.0%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* (* (+ a (* b c)) c) i) 2e+306) (* 2.0 (fma t z (* x y))) (* -2.0 (* a (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((a + (b * c)) * c) * i) <= 2e+306) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = -2.0 * (a * (c * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(a + Float64(b * c)) * c) * i) <= 2e+306) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(-2.0 * Float64(a * Float64(c * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision], 2e+306], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq 2 \cdot 10^{+306}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e306Initial program 90.0%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
if 2e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.0%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6426.2%
Applied rewrites26.2%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* (+ t t) z))) (if (<= (* z t) -2e+112) t_1 (if (<= (* z t) 1e+261) (* (+ y 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 = (t + t) * z;
double tmp;
if ((z * t) <= -2e+112) {
tmp = t_1;
} else if ((z * t) <= 1e+261) {
tmp = (y + y) * x;
} 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) <= (-2d+112)) then
tmp = t_1
else if ((z * t) <= 1d+261) then
tmp = (y + y) * x
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) <= -2e+112) {
tmp = t_1;
} else if ((z * t) <= 1e+261) {
tmp = (y + y) * x;
} 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) <= -2e+112: tmp = t_1 elif (z * t) <= 1e+261: tmp = (y + y) * x 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) <= -2e+112) tmp = t_1; elseif (Float64(z * t) <= 1e+261) tmp = Float64(Float64(y + y) * x); 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) <= -2e+112) tmp = t_1; elseif ((z * t) <= 1e+261) tmp = (y + y) * x; 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], -2e+112], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e+261], N[(N[(y + y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(t + t\right) \cdot z\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 10^{+261}:\\
\;\;\;\;\left(y + y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 z t) < -1.9999999999999999e112 or 9.9999999999999993e260 < (*.f64 z t) Initial program 90.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6428.2%
Applied rewrites28.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6428.2%
Applied rewrites28.2%
if -1.9999999999999999e112 < (*.f64 z t) < 9.9999999999999993e260Initial program 90.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6429.5%
Applied rewrites29.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6429.5%
Applied rewrites29.5%
(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]
\left(t + t\right) \cdot z
Initial program 90.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6428.2%
Applied rewrites28.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6428.2%
Applied rewrites28.2%
herbie shell --seed 2025188
(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))))