
(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 16 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 (* 2.0 (fma (fma c b a) (* (- c) i) (fma t z (* y x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * fma(fma(c, b, a), (-c * i), fma(t, z, (y * x)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * fma(fma(c, b, a), Float64(Float64(-c) * i), fma(t, z, Float64(y * x)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(c * b + a), $MachinePrecision] * N[((-c) * i), $MachinePrecision] + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
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)
Initial program 90.5%
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.f6495.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.5%
Applied rewrites95.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (fma z t (* (- (- (- c))) (* i (fma b c a))))))
(t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -4e+273)
t_1
(if (<= t_2 2e+51)
(* 2.0 (fma z t (- (* y x) (* (* i c) a))))
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(z, t, (-(-(-c)) * (i * fma(b, c, a))));
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -4e+273) {
tmp = t_1;
} else if (t_2 <= 2e+51) {
tmp = 2.0 * fma(z, t, ((y * x) - ((i * c) * a)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * fma(z, t, Float64(Float64(-Float64(-Float64(-c))) * Float64(i * fma(b, c, a))))) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -4e+273) tmp = t_1; elseif (t_2 <= 2e+51) tmp = Float64(2.0 * fma(z, t, Float64(Float64(y * x) - Float64(Float64(i * c) * a)))); 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[(z * t + N[((-(-(-c))) * N[(i * N[(b * c + a), $MachinePrecision]), $MachinePrecision]), $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, -4e+273], t$95$1, If[LessEqual[t$95$2, 2e+51], N[(2.0 * N[(z * t + N[(N[(y * x), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := 2 \cdot \mathsf{fma}\left(z, t, \left(-\left(-\left(-c\right)\right)\right) \cdot \left(i \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+51}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, y \cdot x - \left(i \cdot c\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -3.9999999999999998e273 or 2e51 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-neg.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-neg.f6470.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6470.1%
Applied rewrites70.1%
if -3.9999999999999998e273 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e51Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
Taylor expanded in a around 0
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6473.5%
Applied rewrites73.5%
lift--.f64N/A
lift-fma.f64N/A
associate--l+N/A
sub-negate-revN/A
*-commutativeN/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f6474.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6474.0%
Applied rewrites74.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+74)
(* 2.0 (fma z t (- (* y x) (* (* i c) a))))
(if (<= (* x y) 5e+99)
(* 2.0 (fma (fma c b a) (* (- c) i) (* t z)))
(* 2.0 (- (fma t z (* x y)) (* a (* c i)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+74) {
tmp = 2.0 * fma(z, t, ((y * x) - ((i * c) * a)));
} else if ((x * y) <= 5e+99) {
tmp = 2.0 * fma(fma(c, b, a), (-c * i), (t * z));
} else {
tmp = 2.0 * (fma(t, z, (x * y)) - (a * (c * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+74) tmp = Float64(2.0 * fma(z, t, Float64(Float64(y * x) - Float64(Float64(i * c) * a)))); elseif (Float64(x * y) <= 5e+99) tmp = Float64(2.0 * fma(fma(c, b, a), Float64(Float64(-c) * i), Float64(t * z))); else tmp = Float64(2.0 * Float64(fma(t, z, Float64(x * y)) - Float64(a * Float64(c * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+74], N[(2.0 * N[(z * t + N[(N[(y * x), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+99], N[(2.0 * N[(N[(c * b + a), $MachinePrecision] * N[((-c) * i), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+74}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, y \cdot x - \left(i \cdot c\right) \cdot a\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+99}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), \left(-c\right) \cdot i, t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, x \cdot y\right) - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
if (*.f64 x y) < -4.9999999999999996e74Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
Taylor expanded in a around 0
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6473.5%
Applied rewrites73.5%
lift--.f64N/A
lift-fma.f64N/A
associate--l+N/A
sub-negate-revN/A
*-commutativeN/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f6474.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6474.0%
Applied rewrites74.0%
if -4.9999999999999996e74 < (*.f64 x y) < 5.0000000000000001e99Initial program 90.5%
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.f6495.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.5%
Applied rewrites95.5%
Taylor expanded in x around 0
lower-*.f6471.8%
Applied rewrites71.8%
if 5.0000000000000001e99 < (*.f64 x y) Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
Taylor expanded in a around 0
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6473.5%
Applied rewrites73.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+74)
(* 2.0 (fma z t (- (* y x) (* (* i c) a))))
(if (<= (* x y) 5e+99)
(* 2.0 (- (* t z) (* (fma b c a) (* i c))))
(* 2.0 (- (fma t z (* x y)) (* a (* c i)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+74) {
tmp = 2.0 * fma(z, t, ((y * x) - ((i * c) * a)));
} else if ((x * y) <= 5e+99) {
tmp = 2.0 * ((t * z) - (fma(b, c, a) * (i * c)));
} else {
tmp = 2.0 * (fma(t, z, (x * y)) - (a * (c * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+74) tmp = Float64(2.0 * fma(z, t, Float64(Float64(y * x) - Float64(Float64(i * c) * a)))); elseif (Float64(x * y) <= 5e+99) tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(fma(b, c, a) * Float64(i * c)))); else tmp = Float64(2.0 * Float64(fma(t, z, Float64(x * y)) - Float64(a * Float64(c * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+74], N[(2.0 * N[(z * t + N[(N[(y * x), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+99], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(N[(b * c + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+74}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, y \cdot x - \left(i \cdot c\right) \cdot a\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+99}:\\
\;\;\;\;2 \cdot \left(t \cdot z - \mathsf{fma}\left(b, c, a\right) \cdot \left(i \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, x \cdot y\right) - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
if (*.f64 x y) < -4.9999999999999996e74Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
Taylor expanded in a around 0
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6473.5%
Applied rewrites73.5%
lift--.f64N/A
lift-fma.f64N/A
associate--l+N/A
sub-negate-revN/A
*-commutativeN/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f6474.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6474.0%
Applied rewrites74.0%
if -4.9999999999999996e74 < (*.f64 x y) < 5.0000000000000001e99Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6471.5%
Applied rewrites71.5%
if 5.0000000000000001e99 < (*.f64 x y) Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
Taylor expanded in a around 0
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6473.5%
Applied rewrites73.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (fma t z (* x y)) (* a (* c i))))))
(if (<= (* x y) -5e+74)
t_1
(if (<= (* x y) 5e+99)
(* 2.0 (- (* t z) (* (fma b c a) (* i c))))
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(t, z, (x * y)) - (a * (c * i)));
double tmp;
if ((x * y) <= -5e+74) {
tmp = t_1;
} else if ((x * y) <= 5e+99) {
tmp = 2.0 * ((t * z) - (fma(b, c, a) * (i * c)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(fma(t, z, Float64(x * y)) - Float64(a * Float64(c * i)))) tmp = 0.0 if (Float64(x * y) <= -5e+74) tmp = t_1; elseif (Float64(x * y) <= 5e+99) tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(fma(b, c, a) * Float64(i * c)))); 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[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+74], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+99], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(N[(b * c + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := 2 \cdot \left(\mathsf{fma}\left(t, z, x \cdot y\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+99}:\\
\;\;\;\;2 \cdot \left(t \cdot z - \mathsf{fma}\left(b, c, a\right) \cdot \left(i \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 x y) < -4.9999999999999996e74 or 5.0000000000000001e99 < (*.f64 x y) Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
Taylor expanded in a around 0
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6473.5%
Applied rewrites73.5%
if -4.9999999999999996e74 < (*.f64 x y) < 5.0000000000000001e99Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6471.5%
Applied rewrites71.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* t z) (* (fma b c a) (* i c)))))
(t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -5e+90)
t_1
(if (<= t_2 2e+51) (* 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 * ((t * z) - (fma(b, c, a) * (i * c)));
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+90) {
tmp = t_1;
} else if (t_2 <= 2e+51) {
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(Float64(t * z) - Float64(fma(b, c, a) * Float64(i * c)))) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -5e+90) tmp = t_1; elseif (t_2 <= 2e+51) 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[(t * z), $MachinePrecision] - N[(N[(b * c + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $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, -5e+90], t$95$1, If[LessEqual[t$95$2, 2e+51], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := 2 \cdot \left(t \cdot z - \mathsf{fma}\left(b, c, a\right) \cdot \left(i \cdot c\right)\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+51}:\\
\;\;\;\;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) < -5.0000000000000004e90 or 2e51 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.8%
Applied rewrites68.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6471.5%
Applied rewrites71.5%
if -5.0000000000000004e90 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e51Initial program 90.5%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -5e+90)
(* (fma b c a) (* (* i c) -2.0))
(if (<= t_1 5e+70)
(* 2.0 (fma t z (* x y)))
(* (* (fma b c a) c) (* i -2.0))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if (t_1 <= -5e+90) {
tmp = fma(b, c, a) * ((i * c) * -2.0);
} else if (t_1 <= 5e+70) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = (fma(b, c, a) * c) * (i * -2.0);
}
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+90) tmp = Float64(fma(b, c, a) * Float64(Float64(i * c) * -2.0)); elseif (t_1 <= 5e+70) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(Float64(fma(b, c, a) * c) * Float64(i * -2.0)); 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+90], N[(N[(b * c + a), $MachinePrecision] * N[(N[(i * c), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+70], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]]]]
\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^{+90}:\\
\;\;\;\;\mathsf{fma}\left(b, c, a\right) \cdot \left(\left(i \cdot c\right) \cdot -2\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+70}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot \left(i \cdot -2\right)\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000004e90Initial program 90.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6447.4%
Applied rewrites47.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
add-flip-revN/A
sub-flipN/A
lift-*.f64N/A
remove-double-negN/A
lower-fma.f64N/A
Applied rewrites49.3%
if -5.0000000000000004e90 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e70Initial program 90.5%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
if 5.0000000000000002e70 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6447.4%
Applied rewrites47.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
add-flip-revN/A
sub-flipN/A
lift-*.f64N/A
remove-double-negN/A
lower-fma.f64N/A
lower-*.f6447.4%
Applied rewrites47.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (fma b c a) c) (* i -2.0)))
(t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -5e+90)
t_1
(if (<= t_2 5e+70) (* 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 = (fma(b, c, a) * c) * (i * -2.0);
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -5e+90) {
tmp = t_1;
} else if (t_2 <= 5e+70) {
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(Float64(fma(b, c, a) * c) * Float64(i * -2.0)) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -5e+90) tmp = t_1; elseif (t_2 <= 5e+70) 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[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+90], t$95$1, If[LessEqual[t$95$2, 5e+70], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot \left(i \cdot -2\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+70}:\\
\;\;\;\;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) < -5.0000000000000004e90 or 5.0000000000000002e70 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6447.4%
Applied rewrites47.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
add-flip-revN/A
sub-flipN/A
lift-*.f64N/A
remove-double-negN/A
lower-fma.f64N/A
lower-*.f6447.4%
Applied rewrites47.4%
if -5.0000000000000004e90 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e70Initial program 90.5%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -4e+273)
(* (* b c) (* (* i c) -2.0))
(if (<= t_1 5e+246)
(* 2.0 (fma t z (* x y)))
(* -2.0 (* c (* b (* c i))))))))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 <= -4e+273) {
tmp = (b * c) * ((i * c) * -2.0);
} else if (t_1 <= 5e+246) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = -2.0 * (c * (b * (c * i)));
}
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 <= -4e+273) tmp = Float64(Float64(b * c) * Float64(Float64(i * c) * -2.0)); elseif (t_1 <= 5e+246) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); 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, -4e+273], N[(N[(b * c), $MachinePrecision] * N[(N[(i * c), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+246], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $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 -4 \cdot 10^{+273}:\\
\;\;\;\;\left(b \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot -2\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+246}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -3.9999999999999998e273Initial program 90.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6447.4%
Applied rewrites47.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
add-flip-revN/A
sub-flipN/A
lift-*.f64N/A
remove-double-negN/A
lower-fma.f64N/A
Applied rewrites49.3%
Taylor expanded in a around 0
lower-*.f6434.2%
Applied rewrites34.2%
if -3.9999999999999998e273 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999998e246Initial program 90.5%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
if 4.9999999999999998e246 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6447.4%
Applied rewrites47.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-*.f6434.5%
Applied rewrites34.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* b (* c i)))))
(t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 -4e+273)
t_1
(if (<= t_2 5e+246) (* 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 * (c * (b * (c * i)));
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -4e+273) {
tmp = t_1;
} else if (t_2 <= 5e+246) {
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(c * Float64(b * Float64(c * i)))) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= -4e+273) tmp = t_1; elseif (t_2 <= 5e+246) 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[(c * N[(b * N[(c * i), $MachinePrecision]), $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, -4e+273], t$95$1, If[LessEqual[t$95$2, 5e+246], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+246}:\\
\;\;\;\;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) < -3.9999999999999998e273 or 4.9999999999999998e246 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6447.4%
Applied rewrites47.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-*.f6434.5%
Applied rewrites34.5%
if -3.9999999999999998e273 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999998e246Initial program 90.5%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 -1e+197)
(* -2.0 (* a (* c i)))
(if (<= t_1 2e+133)
(* 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 t_1 = ((a + (b * c)) * c) * i;
double tmp;
if (t_1 <= -1e+197) {
tmp = -2.0 * (a * (c * i));
} else if (t_1 <= 2e+133) {
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) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_1 <= -1e+197) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (t_1 <= 2e+133) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(Float64(Float64(-2.0 * a) * c) * i); 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+197], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+133], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-2.0 * a), $MachinePrecision] * c), $MachinePrecision] * i), $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^{+197}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+133}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-2 \cdot a\right) \cdot c\right) \cdot i\\
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999995e196Initial program 90.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6425.1%
Applied rewrites25.1%
if -9.9999999999999995e196 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e133Initial program 90.5%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
if 2e133 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 90.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6425.1%
Applied rewrites25.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6423.0%
Applied rewrites23.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ y y) x)))
(if (<= (* x y) -2e+226)
t_1
(if (<= (* x y) -5e+53)
(* -2.0 (* a (* c i)))
(if (<= (* x y) 2e-61)
(* (+ t t) z)
(if (<= (* x y) 5e+99) (* (* (* i a) -2.0) c) t_1))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y + y) * x;
double tmp;
if ((x * y) <= -2e+226) {
tmp = t_1;
} else if ((x * y) <= -5e+53) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 2e-61) {
tmp = (t + t) * z;
} else if ((x * y) <= 5e+99) {
tmp = ((i * a) * -2.0) * c;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, 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 = (y + y) * x
if ((x * y) <= (-2d+226)) then
tmp = t_1
else if ((x * y) <= (-5d+53)) then
tmp = (-2.0d0) * (a * (c * i))
else if ((x * y) <= 2d-61) then
tmp = (t + t) * z
else if ((x * y) <= 5d+99) then
tmp = ((i * a) * (-2.0d0)) * c
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y + y) * x;
double tmp;
if ((x * y) <= -2e+226) {
tmp = t_1;
} else if ((x * y) <= -5e+53) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 2e-61) {
tmp = (t + t) * z;
} else if ((x * y) <= 5e+99) {
tmp = ((i * a) * -2.0) * c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (y + y) * x tmp = 0 if (x * y) <= -2e+226: tmp = t_1 elif (x * y) <= -5e+53: tmp = -2.0 * (a * (c * i)) elif (x * y) <= 2e-61: tmp = (t + t) * z elif (x * y) <= 5e+99: tmp = ((i * a) * -2.0) * c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y + y) * x) tmp = 0.0 if (Float64(x * y) <= -2e+226) tmp = t_1; elseif (Float64(x * y) <= -5e+53) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (Float64(x * y) <= 2e-61) tmp = Float64(Float64(t + t) * z); elseif (Float64(x * y) <= 5e+99) tmp = Float64(Float64(Float64(i * a) * -2.0) * c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (y + y) * x; tmp = 0.0; if ((x * y) <= -2e+226) tmp = t_1; elseif ((x * y) <= -5e+53) tmp = -2.0 * (a * (c * i)); elseif ((x * y) <= 2e-61) tmp = (t + t) * z; elseif ((x * y) <= 5e+99) tmp = ((i * a) * -2.0) * c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y + y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+226], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e+53], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-61], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+99], N[(N[(N[(i * a), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := \left(y + y\right) \cdot x\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+53}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-61}:\\
\;\;\;\;\left(t + t\right) \cdot z\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+99}:\\
\;\;\;\;\left(\left(i \cdot a\right) \cdot -2\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 x y) < -1.9999999999999999e226 or 5.0000000000000001e99 < (*.f64 x y) Initial program 90.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
count-2N/A
lift-+.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
if -1.9999999999999999e226 < (*.f64 x y) < -5.0000000000000004e53Initial program 90.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6425.1%
Applied rewrites25.1%
if -5.0000000000000004e53 < (*.f64 x y) < 2.0000000000000001e-61Initial program 90.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6428.4%
Applied rewrites28.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6428.4%
Applied rewrites28.4%
if 2.0000000000000001e-61 < (*.f64 x y) < 5.0000000000000001e99Initial program 90.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6425.1%
Applied rewrites25.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.6%
Applied rewrites21.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ y y) x)))
(if (<= (* x y) -2e+226)
t_1
(if (<= (* x y) -5e+53)
(* -2.0 (* a (* c i)))
(if (<= (* x y) 2e-61)
(* (+ t t) z)
(if (<= (* x y) 5e+99) (* (* (* -2.0 a) c) i) t_1))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y + y) * x;
double tmp;
if ((x * y) <= -2e+226) {
tmp = t_1;
} else if ((x * y) <= -5e+53) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 2e-61) {
tmp = (t + t) * z;
} else if ((x * y) <= 5e+99) {
tmp = ((-2.0 * a) * c) * 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 = (y + y) * x
if ((x * y) <= (-2d+226)) then
tmp = t_1
else if ((x * y) <= (-5d+53)) then
tmp = (-2.0d0) * (a * (c * i))
else if ((x * y) <= 2d-61) then
tmp = (t + t) * z
else if ((x * y) <= 5d+99) then
tmp = (((-2.0d0) * a) * c) * 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 = (y + y) * x;
double tmp;
if ((x * y) <= -2e+226) {
tmp = t_1;
} else if ((x * y) <= -5e+53) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 2e-61) {
tmp = (t + t) * z;
} else if ((x * y) <= 5e+99) {
tmp = ((-2.0 * a) * c) * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (y + y) * x tmp = 0 if (x * y) <= -2e+226: tmp = t_1 elif (x * y) <= -5e+53: tmp = -2.0 * (a * (c * i)) elif (x * y) <= 2e-61: tmp = (t + t) * z elif (x * y) <= 5e+99: tmp = ((-2.0 * a) * c) * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y + y) * x) tmp = 0.0 if (Float64(x * y) <= -2e+226) tmp = t_1; elseif (Float64(x * y) <= -5e+53) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (Float64(x * y) <= 2e-61) tmp = Float64(Float64(t + t) * z); elseif (Float64(x * y) <= 5e+99) tmp = Float64(Float64(Float64(-2.0 * a) * c) * i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (y + y) * x; tmp = 0.0; if ((x * y) <= -2e+226) tmp = t_1; elseif ((x * y) <= -5e+53) tmp = -2.0 * (a * (c * i)); elseif ((x * y) <= 2e-61) tmp = (t + t) * z; elseif ((x * y) <= 5e+99) tmp = ((-2.0 * a) * c) * 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[(y + y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+226], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e+53], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-61], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+99], N[(N[(N[(-2.0 * a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := \left(y + y\right) \cdot x\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+53}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-61}:\\
\;\;\;\;\left(t + t\right) \cdot z\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+99}:\\
\;\;\;\;\left(\left(-2 \cdot a\right) \cdot c\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 x y) < -1.9999999999999999e226 or 5.0000000000000001e99 < (*.f64 x y) Initial program 90.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
count-2N/A
lift-+.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
if -1.9999999999999999e226 < (*.f64 x y) < -5.0000000000000004e53Initial program 90.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6425.1%
Applied rewrites25.1%
if -5.0000000000000004e53 < (*.f64 x y) < 2.0000000000000001e-61Initial program 90.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6428.4%
Applied rewrites28.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6428.4%
Applied rewrites28.4%
if 2.0000000000000001e-61 < (*.f64 x y) < 5.0000000000000001e99Initial program 90.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6425.1%
Applied rewrites25.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6423.0%
Applied rewrites23.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i)))) (t_2 (* (+ y y) x)))
(if (<= (* x y) -2e+226)
t_2
(if (<= (* x y) -5e+53)
t_1
(if (<= (* x y) 2e-61)
(* (+ t t) z)
(if (<= (* x y) 5e+99) t_1 t_2))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (a * (c * i));
double t_2 = (y + y) * x;
double tmp;
if ((x * y) <= -2e+226) {
tmp = t_2;
} else if ((x * y) <= -5e+53) {
tmp = t_1;
} else if ((x * y) <= 2e-61) {
tmp = (t + t) * z;
} else if ((x * y) <= 5e+99) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) * (a * (c * i))
t_2 = (y + y) * x
if ((x * y) <= (-2d+226)) then
tmp = t_2
else if ((x * y) <= (-5d+53)) then
tmp = t_1
else if ((x * y) <= 2d-61) then
tmp = (t + t) * z
else if ((x * y) <= 5d+99) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (a * (c * i));
double t_2 = (y + y) * x;
double tmp;
if ((x * y) <= -2e+226) {
tmp = t_2;
} else if ((x * y) <= -5e+53) {
tmp = t_1;
} else if ((x * y) <= 2e-61) {
tmp = (t + t) * z;
} else if ((x * y) <= 5e+99) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) t_2 = (y + y) * x tmp = 0 if (x * y) <= -2e+226: tmp = t_2 elif (x * y) <= -5e+53: tmp = t_1 elif (x * y) <= 2e-61: tmp = (t + t) * z elif (x * y) <= 5e+99: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) t_2 = Float64(Float64(y + y) * x) tmp = 0.0 if (Float64(x * y) <= -2e+226) tmp = t_2; elseif (Float64(x * y) <= -5e+53) tmp = t_1; elseif (Float64(x * y) <= 2e-61) tmp = Float64(Float64(t + t) * z); elseif (Float64(x * y) <= 5e+99) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (a * (c * i)); t_2 = (y + y) * x; tmp = 0.0; if ((x * y) <= -2e+226) tmp = t_2; elseif ((x * y) <= -5e+53) tmp = t_1; elseif ((x * y) <= 2e-61) tmp = (t + t) * z; elseif ((x * y) <= 5e+99) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+226], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5e+53], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-61], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+99], t$95$1, t$95$2]]]]]]
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
t_2 := \left(y + y\right) \cdot x\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+226}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-61}:\\
\;\;\;\;\left(t + t\right) \cdot z\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 x y) < -1.9999999999999999e226 or 5.0000000000000001e99 < (*.f64 x y) Initial program 90.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
count-2N/A
lift-+.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
if -1.9999999999999999e226 < (*.f64 x y) < -5.0000000000000004e53 or 2.0000000000000001e-61 < (*.f64 x y) < 5.0000000000000001e99Initial program 90.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6425.1%
Applied rewrites25.1%
if -5.0000000000000004e53 < (*.f64 x y) < 2.0000000000000001e-61Initial program 90.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6428.4%
Applied rewrites28.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6428.4%
Applied rewrites28.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ y y) x)))
(if (<= (* x y) -4e+95)
t_1
(if (<= (* x y) 2e+100) (* (+ t t) z) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y + y) * x;
double tmp;
if ((x * y) <= -4e+95) {
tmp = t_1;
} else if ((x * y) <= 2e+100) {
tmp = (t + t) * z;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (y + y) * x
if ((x * y) <= (-4d+95)) then
tmp = t_1
else if ((x * y) <= 2d+100) then
tmp = (t + t) * z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y + y) * x;
double tmp;
if ((x * y) <= -4e+95) {
tmp = t_1;
} else if ((x * y) <= 2e+100) {
tmp = (t + t) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (y + y) * x tmp = 0 if (x * y) <= -4e+95: tmp = t_1 elif (x * y) <= 2e+100: tmp = (t + t) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y + y) * x) tmp = 0.0 if (Float64(x * y) <= -4e+95) tmp = t_1; elseif (Float64(x * y) <= 2e+100) tmp = Float64(Float64(t + t) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (y + y) * x; tmp = 0.0; if ((x * y) <= -4e+95) tmp = t_1; elseif ((x * y) <= 2e+100) tmp = (t + t) * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y + y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4e+95], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+100], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(y + y\right) \cdot x\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+100}:\\
\;\;\;\;\left(t + t\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 x y) < -4.0000000000000001e95 or 2e100 < (*.f64 x y) Initial program 90.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
count-2N/A
lift-+.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
if -4.0000000000000001e95 < (*.f64 x y) < 2e100Initial program 90.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6428.4%
Applied rewrites28.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6428.4%
Applied rewrites28.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]
\left(t + t\right) \cdot z
Initial program 90.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6428.4%
Applied rewrites28.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6428.4%
Applied rewrites28.4%
herbie shell --seed 2025212
(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))))