
(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 15 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 (+ (* x y) (* z t))))
(if (<= (* 2.0 (- t_1 (* (* (+ a (* b c)) c) i))) INFINITY)
(* 2.0 (- t_1 (* (fma c b a) (* i c))))
(* (* -2.0 c) (fma (* i c) b (* i a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((2.0 * (t_1 - (((a + (b * c)) * c) * i))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_1 - (fma(c, b, a) * (i * c)));
} else {
tmp = (-2.0 * c) * fma((i * c), b, (i * a));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(2.0 * Float64(t_1 - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) <= Inf) tmp = Float64(2.0 * Float64(t_1 - Float64(fma(c, b, a) * Float64(i * c)))); else tmp = Float64(Float64(-2.0 * c) * fma(Float64(i * c), b, Float64(i * a))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(2.0 * N[(t$95$1 - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$1 - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * c), $MachinePrecision] * N[(N[(i * c), $MachinePrecision] * b + N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;2 \cdot \left(t\_1 - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_1 - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot c\right) \cdot \mathsf{fma}\left(i \cdot c, b, i \cdot a\right)\\
\end{array}
\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 94.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6498.5
Applied rewrites98.5%
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 0.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6412.4
Applied rewrites12.4%
Taylor expanded in i around inf
Applied rewrites55.5%
lift-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6448.1
Applied rewrites48.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ a (* b c)) c)))
(if (<= t_1 (- INFINITY))
(* 2.0 (- (* y x) (* (* (fma c b a) i) c)))
(if (<= t_1 2e+278)
(* 2.0 (fma y x (- (* t z) (* (* (fma c b a) c) i))))
(* 2.0 (- (* t z) (* (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 * ((y * x) - ((fma(c, b, a) * i) * c));
} else if (t_1 <= 2e+278) {
tmp = 2.0 * fma(y, x, ((t * z) - ((fma(c, b, a) * c) * i)));
} else {
tmp = 2.0 * ((t * z) - (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(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * i) * c))); elseif (t_1 <= 2e+278) 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(t * z) - Float64(fma(c, b, a) * Float64(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[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+278], 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[(t * z), $MachinePrecision] - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $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:\\
\;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+278}:\\
\;\;\;\;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(t \cdot z - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 71.8%
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.f6488.0
Applied rewrites88.0%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1.99999999999999993e278Initial program 97.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6498.3
Applied rewrites98.3%
if 1.99999999999999993e278 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 74.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.2
Applied rewrites89.2%
Taylor expanded in x around 0
lift-*.f6487.5
Applied rewrites87.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -5e+174)
(* (* (* i c) (fma b c a)) -2.0)
(if (<= t_1 5e+286)
(* 2.0 (- (fma t z (* y x)) (* (* i c) a)))
(* 2.0 (- (* t z) (* (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) * i;
double tmp;
if (t_1 <= -5e+174) {
tmp = ((i * c) * fma(b, c, a)) * -2.0;
} else if (t_1 <= 5e+286) {
tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * a));
} else {
tmp = 2.0 * ((t * z) - (fma(c, b, a) * (i * 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 <= -5e+174) tmp = Float64(Float64(Float64(i * c) * fma(b, c, a)) * -2.0); elseif (t_1 <= 5e+286) tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * a))); else tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(fma(c, b, a) * Float64(i * 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, -5e+174], N[(N[(N[(i * c), $MachinePrecision] * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+286], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+174}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+286}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t \cdot z - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999997e174Initial program 80.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.5
Applied rewrites89.5%
Taylor expanded in i around inf
Applied rewrites81.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.9%
if -4.9999999999999997e174 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000004e286Initial program 99.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6491.0
Applied rewrites91.0%
if 5.0000000000000004e286 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 75.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6487.8
Applied rewrites87.8%
Taylor expanded in x around 0
lift-*.f6488.2
Applied rewrites88.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -5e+174)
(* (* (* i c) (fma b c a)) -2.0)
(if (<= t_1 5e+288)
(* 2.0 (- (fma t z (* y x)) (* (* i c) a)))
(* 2.0 (- (* t z) (* (* (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) * i;
double tmp;
if (t_1 <= -5e+174) {
tmp = ((i * c) * fma(b, c, a)) * -2.0;
} else if (t_1 <= 5e+288) {
tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * a));
} else {
tmp = 2.0 * ((t * z) - ((fma(c, b, a) * i) * 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 <= -5e+174) tmp = Float64(Float64(Float64(i * c) * fma(b, c, a)) * -2.0); elseif (t_1 <= 5e+288) tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * a))); else tmp = Float64(2.0 * Float64(Float64(t * z) - 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[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+174], N[(N[(N[(i * c), $MachinePrecision] * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+288], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+174}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999997e174Initial program 80.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.5
Applied rewrites89.5%
Taylor expanded in i around inf
Applied rewrites81.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.9%
if -4.9999999999999997e174 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e288Initial program 99.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6491.0
Applied rewrites91.0%
if 5.0000000000000003e288 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 75.5%
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.f6487.3
Applied rewrites87.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -5e+154)
(* (* (* i c) (fma b c a)) -2.0)
(if (<= t_1 4e-76)
(* 2.0 (fma y x (* z t)))
(* 2.0 (- (* t z) (* (* (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) * i;
double tmp;
if (t_1 <= -5e+154) {
tmp = ((i * c) * fma(b, c, a)) * -2.0;
} else if (t_1 <= 4e-76) {
tmp = 2.0 * fma(y, x, (z * t));
} else {
tmp = 2.0 * ((t * z) - ((fma(c, b, a) * i) * 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 <= -5e+154) tmp = Float64(Float64(Float64(i * c) * fma(b, c, a)) * -2.0); elseif (t_1 <= 4e-76) tmp = Float64(2.0 * fma(y, x, Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(t * z) - 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[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+154], N[(N[(N[(i * c), $MachinePrecision] * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 4e-76], N[(2.0 * N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+154}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-76}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000004e154Initial program 81.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.8
Applied rewrites89.8%
Taylor expanded in i around inf
Applied rewrites80.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.9%
if -5.00000000000000004e154 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.99999999999999971e-76Initial program 99.2%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6499.4
Applied rewrites99.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f6487.8
Applied rewrites87.8%
if 3.99999999999999971e-76 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 86.0%
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.f6476.1
Applied rewrites76.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* i c) (fma b c a)) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -5e+154)
t_1
(if (<= t_2 2e+119) (* 2.0 (fma y x (* z t))) 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) * fma(b, c, a)) * -2.0;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+154) {
tmp = t_1;
} else if (t_2 <= 2e+119) {
tmp = 2.0 * fma(y, x, (z * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(i * c) * fma(b, c, a)) * -2.0) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -5e+154) tmp = t_1; elseif (t_2 <= 2e+119) tmp = Float64(2.0 * fma(y, x, Float64(z * t))); 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] * N[(b * c + a), $MachinePrecision]), $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+154], t$95$1, If[LessEqual[t$95$2, 2e+119], N[(2.0 * N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot \mathsf{fma}\left(b, c, a\right)\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^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+119}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000004e154 or 1.99999999999999989e119 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.9
Applied rewrites89.9%
Taylor expanded in i around inf
Applied rewrites79.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.1%
if -5.00000000000000004e154 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999989e119Initial program 99.2%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6499.4
Applied rewrites99.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f6484.5
Applied rewrites84.5%
(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) i)))
(if (<= t_2 -4e+173)
t_1
(if (<= t_2 2e+119) (* 2.0 (fma y x (* z t))) 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) * i;
double tmp;
if (t_2 <= -4e+173) {
tmp = t_1;
} else if (t_2 <= 2e+119) {
tmp = 2.0 * fma(y, x, (z * t));
} 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(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -4e+173) tmp = t_1; elseif (t_2 <= 2e+119) tmp = Float64(2.0 * fma(y, x, Float64(z * t))); 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[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+173], t$95$1, If[LessEqual[t$95$2, 2e+119], N[(2.0 * N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision]), $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(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+119}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.0000000000000001e173 or 1.99999999999999989e119 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.0%
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.f6479.6
Applied rewrites79.6%
if -4.0000000000000001e173 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999989e119Initial program 99.2%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6499.4
Applied rewrites99.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f6484.0
Applied rewrites84.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* (* c c) i) b) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -4e+173)
t_1
(if (<= t_2 5e+288) (* 2.0 (fma y x (* z t))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((c * c) * i) * b) * -2.0;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -4e+173) {
tmp = t_1;
} else if (t_2 <= 5e+288) {
tmp = 2.0 * fma(y, x, (z * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(c * c) * i) * b) * -2.0) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -4e+173) tmp = t_1; elseif (t_2 <= 5e+288) tmp = Float64(2.0 * fma(y, x, Float64(z * t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * b), $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, -4e+173], t$95$1, If[LessEqual[t$95$2, 5e+288], N[(2.0 * N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.0000000000000001e173 or 5.0000000000000003e288 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 78.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.4
Applied rewrites64.4%
if -4.0000000000000001e173 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e288Initial program 99.2%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6499.4
Applied rewrites99.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f6479.6
Applied rewrites79.6%
(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) i)))
(if (<= t_2 -4e+173)
t_1
(if (<= t_2 5e+288) (* 2.0 (fma y x (* z t))) 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) * i;
double tmp;
if (t_2 <= -4e+173) {
tmp = t_1;
} else if (t_2 <= 5e+288) {
tmp = 2.0 * fma(y, x, (z * t));
} 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(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -4e+173) tmp = t_1; elseif (t_2 <= 5e+288) tmp = Float64(2.0 * fma(y, x, Float64(z * t))); 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[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+173], t$95$1, If[LessEqual[t$95$2, 5e+288], N[(2.0 * N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision]), $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(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.0000000000000001e173 or 5.0000000000000003e288 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 78.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6488.7
Applied rewrites88.7%
Taylor expanded in i around inf
Applied rewrites84.4%
Taylor expanded in a around 0
*-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6465.8
Applied rewrites65.8%
if -4.0000000000000001e173 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e288Initial program 99.2%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6499.4
Applied rewrites99.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f6479.6
Applied rewrites79.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 -1e+261)
t_1
(if (<= t_2 5e+301) (* 2.0 (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 = ((i * c) * a) * -2.0;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -1e+261) {
tmp = t_1;
} else if (t_2 <= 5e+301) {
tmp = 2.0 * fma(t, z, (y * x));
} 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 <= -1e+261) tmp = t_1; elseif (t_2 <= 5e+301) tmp = Float64(2.0 * 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[(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, -1e+261], t$95$1, If[LessEqual[t$95$2, 5e+301], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $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 -1 \cdot 10^{+261}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999993e260 or 5.0000000000000004e301 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6441.4
Applied rewrites41.4%
if -9.9999999999999993e260 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000004e301Initial program 99.2%
Taylor expanded in c around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6477.2
Applied rewrites77.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ x x) y)))
(if (<= (* x y) -50000000.0)
t_1
(if (<= (* x y) 4e+16)
(* (+ t t) z)
(if (<= (* x y) 1e+179) (* (* (* 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 = (x + x) * y;
double tmp;
if ((x * y) <= -50000000.0) {
tmp = t_1;
} else if ((x * y) <= 4e+16) {
tmp = (t + t) * z;
} else if ((x * y) <= 1e+179) {
tmp = ((i * c) * a) * -2.0;
} 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) <= (-50000000.0d0)) then
tmp = t_1
else if ((x * y) <= 4d+16) then
tmp = (t + t) * z
else if ((x * y) <= 1d+179) then
tmp = ((i * c) * a) * (-2.0d0)
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) <= -50000000.0) {
tmp = t_1;
} else if ((x * y) <= 4e+16) {
tmp = (t + t) * z;
} else if ((x * y) <= 1e+179) {
tmp = ((i * c) * a) * -2.0;
} 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) <= -50000000.0: tmp = t_1 elif (x * y) <= 4e+16: tmp = (t + t) * z elif (x * y) <= 1e+179: 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(x + x) * y) tmp = 0.0 if (Float64(x * y) <= -50000000.0) tmp = t_1; elseif (Float64(x * y) <= 4e+16) tmp = Float64(Float64(t + t) * z); elseif (Float64(x * y) <= 1e+179) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); 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) <= -50000000.0) tmp = t_1; elseif ((x * y) <= 4e+16) tmp = (t + t) * z; elseif ((x * y) <= 1e+179) tmp = ((i * c) * a) * -2.0; 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], -50000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e+16], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+179], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + x\right) \cdot y\\
\mathbf{if}\;x \cdot y \leq -50000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+16}:\\
\;\;\;\;\left(t + t\right) \cdot z\\
\mathbf{elif}\;x \cdot y \leq 10^{+179}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -5e7 or 9.9999999999999998e178 < (*.f64 x y) Initial program 88.1%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6457.9
Applied rewrites57.9%
if -5e7 < (*.f64 x y) < 4e16Initial program 91.9%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6437.9
Applied rewrites37.9%
if 4e16 < (*.f64 x y) < 9.9999999999999998e178Initial program 90.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.5
Applied rewrites24.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ x x) y)))
(if (<= (* x y) -50000000.0)
t_1
(if (<= (* x y) 4e+16)
(* (+ t t) z)
(if (<= (* x y) 1e+179) (* (* (* c a) -2.0) i) 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) <= -50000000.0) {
tmp = t_1;
} else if ((x * y) <= 4e+16) {
tmp = (t + t) * z;
} else if ((x * y) <= 1e+179) {
tmp = ((c * a) * -2.0) * i;
} 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) <= (-50000000.0d0)) then
tmp = t_1
else if ((x * y) <= 4d+16) then
tmp = (t + t) * z
else if ((x * y) <= 1d+179) then
tmp = ((c * a) * (-2.0d0)) * i
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) <= -50000000.0) {
tmp = t_1;
} else if ((x * y) <= 4e+16) {
tmp = (t + t) * z;
} else if ((x * y) <= 1e+179) {
tmp = ((c * a) * -2.0) * i;
} 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) <= -50000000.0: tmp = t_1 elif (x * y) <= 4e+16: tmp = (t + t) * z elif (x * y) <= 1e+179: tmp = ((c * a) * -2.0) * i 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) <= -50000000.0) tmp = t_1; elseif (Float64(x * y) <= 4e+16) tmp = Float64(Float64(t + t) * z); elseif (Float64(x * y) <= 1e+179) tmp = Float64(Float64(Float64(c * a) * -2.0) * i); 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) <= -50000000.0) tmp = t_1; elseif ((x * y) <= 4e+16) tmp = (t + t) * z; elseif ((x * y) <= 1e+179) tmp = ((c * a) * -2.0) * i; 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], -50000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e+16], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+179], N[(N[(N[(c * a), $MachinePrecision] * -2.0), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + x\right) \cdot y\\
\mathbf{if}\;x \cdot y \leq -50000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+16}:\\
\;\;\;\;\left(t + t\right) \cdot z\\
\mathbf{elif}\;x \cdot y \leq 10^{+179}:\\
\;\;\;\;\left(\left(c \cdot a\right) \cdot -2\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -5e7 or 9.9999999999999998e178 < (*.f64 x y) Initial program 88.1%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6457.9
Applied rewrites57.9%
if -5e7 < (*.f64 x y) < 4e16Initial program 91.9%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6437.9
Applied rewrites37.9%
if 4e16 < (*.f64 x y) < 9.9999999999999998e178Initial program 90.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6496.2
Applied rewrites96.2%
Taylor expanded in i around inf
Applied rewrites45.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f6443.3
Applied rewrites43.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6422.4
Applied rewrites22.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ x x) y)))
(if (<= (* x y) -50000000.0)
t_1
(if (<= (* x y) 4e+16)
(* (+ t t) z)
(if (<= (* x y) 1e+179) (* (* -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 = (x + x) * y;
double tmp;
if ((x * y) <= -50000000.0) {
tmp = t_1;
} else if ((x * y) <= 4e+16) {
tmp = (t + t) * z;
} else if ((x * y) <= 1e+179) {
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 = (x + x) * y
if ((x * y) <= (-50000000.0d0)) then
tmp = t_1
else if ((x * y) <= 4d+16) then
tmp = (t + t) * z
else if ((x * y) <= 1d+179) 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 = (x + x) * y;
double tmp;
if ((x * y) <= -50000000.0) {
tmp = t_1;
} else if ((x * y) <= 4e+16) {
tmp = (t + t) * z;
} else if ((x * y) <= 1e+179) {
tmp = (-2.0 * c) * (i * a);
} 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) <= -50000000.0: tmp = t_1 elif (x * y) <= 4e+16: tmp = (t + t) * z elif (x * y) <= 1e+179: 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(x + x) * y) tmp = 0.0 if (Float64(x * y) <= -50000000.0) tmp = t_1; elseif (Float64(x * y) <= 4e+16) tmp = Float64(Float64(t + t) * z); elseif (Float64(x * y) <= 1e+179) 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 = (x + x) * y; tmp = 0.0; if ((x * y) <= -50000000.0) tmp = t_1; elseif ((x * y) <= 4e+16) tmp = (t + t) * z; elseif ((x * y) <= 1e+179) 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[(x + x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -50000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e+16], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+179], N[(N[(-2.0 * c), $MachinePrecision] * N[(i * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + x\right) \cdot y\\
\mathbf{if}\;x \cdot y \leq -50000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+16}:\\
\;\;\;\;\left(t + t\right) \cdot z\\
\mathbf{elif}\;x \cdot y \leq 10^{+179}:\\
\;\;\;\;\left(-2 \cdot c\right) \cdot \left(i \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -5e7 or 9.9999999999999998e178 < (*.f64 x y) Initial program 88.1%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6457.9
Applied rewrites57.9%
if -5e7 < (*.f64 x y) < 4e16Initial program 91.9%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6437.9
Applied rewrites37.9%
if 4e16 < (*.f64 x y) < 9.9999999999999998e178Initial program 90.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6496.2
Applied rewrites96.2%
Taylor expanded in i around inf
Applied rewrites45.1%
Taylor expanded in a around inf
*-commutativeN/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lift-*.f6420.7
Applied rewrites20.7%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* (+ t t) z))) (if (<= (* z t) -5e+76) t_1 (if (<= (* z t) 1e+82) (* (+ x 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 = (t + t) * z;
double tmp;
if ((z * t) <= -5e+76) {
tmp = t_1;
} else if ((z * t) <= 1e+82) {
tmp = (x + x) * y;
} 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+76)) then
tmp = t_1
else if ((z * t) <= 1d+82) then
tmp = (x + x) * y
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+76) {
tmp = t_1;
} else if ((z * t) <= 1e+82) {
tmp = (x + x) * y;
} 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+76: tmp = t_1 elif (z * t) <= 1e+82: tmp = (x + x) * y 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+76) tmp = t_1; elseif (Float64(z * t) <= 1e+82) tmp = Float64(Float64(x + x) * y); 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+76) tmp = t_1; elseif ((z * t) <= 1e+82) tmp = (x + x) * y; 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+76], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e+82], N[(N[(x + x), $MachinePrecision] * y), $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^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 10^{+82}:\\
\;\;\;\;\left(x + x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -4.99999999999999991e76 or 9.9999999999999996e81 < (*.f64 z t) Initial program 87.7%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6456.1
Applied rewrites56.1%
if -4.99999999999999991e76 < (*.f64 z t) < 9.9999999999999996e81Initial program 91.9%
Taylor expanded in x around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6436.4
Applied rewrites36.4%
(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.3%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6428.8
Applied rewrites28.8%
herbie shell --seed 2025114
(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))))