
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
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, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
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, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(fma
c
b
(fma
(fma -4.0 a (* z (* y (* 18.0 x))))
t
(fma (* -27.0 j) k (* (* -4.0 x) i))))))
(if (<= t -5.5e-75)
t_1
(if (<= t 4e-31)
(fma
(* (* t (* 18.0 x)) z)
y
(fma
(* a t)
-4.0
(fma (* k j) -27.0 (fma (* -4.0 x) i (* c b)))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma(c, b, fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, fma((-27.0 * j), k, ((-4.0 * x) * i))));
double tmp;
if (t <= -5.5e-75) {
tmp = t_1;
} else if (t <= 4e-31) {
tmp = fma(((t * (18.0 * x)) * z), y, fma((a * t), -4.0, fma((k * j), -27.0, fma((-4.0 * x), i, (c * b)))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(c, b, fma(fma(-4.0, a, Float64(z * Float64(y * Float64(18.0 * x)))), t, fma(Float64(-27.0 * j), k, Float64(Float64(-4.0 * x) * i)))) tmp = 0.0 if (t <= -5.5e-75) tmp = t_1; elseif (t <= 4e-31) tmp = fma(Float64(Float64(t * Float64(18.0 * x)) * z), y, fma(Float64(a * t), -4.0, fma(Float64(k * j), -27.0, fma(Float64(-4.0 * x), i, Float64(c * b))))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(c * b + N[(N[(-4.0 * a + N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(-4.0 * x), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e-75], t$95$1, If[LessEqual[t, 4e-31], N[(N[(N[(t * N[(18.0 * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(k * j), $MachinePrecision] * -27.0 + N[(N[(-4.0 * x), $MachinePrecision] * i + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right), t, \mathsf{fma}\left(-27 \cdot j, k, \left(-4 \cdot x\right) \cdot i\right)\right)\right)\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot \left(18 \cdot x\right)\right) \cdot z, y, \mathsf{fma}\left(a \cdot t, -4, \mathsf{fma}\left(k \cdot j, -27, \mathsf{fma}\left(-4 \cdot x, i, c \cdot b\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -5.5000000000000003e-75 or 4.0000000000000003e-31 < t Initial program 84.7%
Applied rewrites89.3%
if -5.5000000000000003e-75 < t < 4.0000000000000003e-31Initial program 84.7%
Applied rewrites86.8%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
INFINITY)
(fma
c
b
(fma
(fma -4.0 a (* z (* y (* 18.0 x))))
t
(fma (* -27.0 j) k (* (* -4.0 x) i))))
(* (fma (* 18.0 y) (* t z) (* i -4.0)) x)))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= ((double) INFINITY)) {
tmp = fma(c, b, fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, fma((-27.0 * j), k, ((-4.0 * x) * i))));
} else {
tmp = fma((18.0 * y), (t * z), (i * -4.0)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) <= Inf) tmp = fma(c, b, fma(fma(-4.0, a, Float64(z * Float64(y * Float64(18.0 * x)))), t, fma(Float64(-27.0 * j), k, Float64(Float64(-4.0 * x) * i)))); else tmp = Float64(fma(Float64(18.0 * y), Float64(t * z), Float64(i * -4.0)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * b + N[(N[(-4.0 * a + N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(-4.0 * x), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * y), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right), t, \mathsf{fma}\left(-27 \cdot j, k, \left(-4 \cdot x\right) \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot y, t \cdot z, i \cdot -4\right) \cdot x\\
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < +inf.0Initial program 84.7%
Applied rewrites89.3%
if +inf.0 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f6441.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
Applied rewrites42.7%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -2.8e+136)
(- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) (* (* j 27.0) k))
(if (<= x 3.2e+252)
(fma c b (fma (* -4.0 a) t (fma (* -27.0 j) k (* (* -4.0 x) i))))
(* (fma (* 18.0 y) (* t z) (* i -4.0)) x))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2.8e+136) {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - ((j * 27.0) * k);
} else if (x <= 3.2e+252) {
tmp = fma(c, b, fma((-4.0 * a), t, fma((-27.0 * j), k, ((-4.0 * x) * i))));
} else {
tmp = fma((18.0 * y), (t * z), (i * -4.0)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -2.8e+136) tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - Float64(Float64(j * 27.0) * k)); elseif (x <= 3.2e+252) tmp = fma(c, b, fma(Float64(-4.0 * a), t, fma(Float64(-27.0 * j), k, Float64(Float64(-4.0 * x) * i)))); else tmp = Float64(fma(Float64(18.0 * y), Float64(t * z), Float64(i * -4.0)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -2.8e+136], N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.2e+252], N[(c * b + N[(N[(-4.0 * a), $MachinePrecision] * t + N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(-4.0 * x), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * y), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+136}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+252}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(-4 \cdot a, t, \mathsf{fma}\left(-27 \cdot j, k, \left(-4 \cdot x\right) \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot y, t \cdot z, i \cdot -4\right) \cdot x\\
\end{array}
if x < -2.8000000000000002e136Initial program 84.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.6%
Applied rewrites58.6%
if -2.8000000000000002e136 < x < 3.2000000000000002e252Initial program 84.7%
Applied rewrites89.3%
Taylor expanded in x around 0
lower-*.f6479.1%
Applied rewrites79.1%
if 3.2000000000000002e252 < x Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f6441.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
Applied rewrites42.7%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -2.3e+130)
(- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) (* (* j 27.0) k))
(if (<= x 1.1e+109)
(fma c b (fma -27.0 (* j k) (* -4.0 (* a t))))
(* (fma (* 18.0 y) (* t z) (* i -4.0)) x))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2.3e+130) {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - ((j * 27.0) * k);
} else if (x <= 1.1e+109) {
tmp = fma(c, b, fma(-27.0, (j * k), (-4.0 * (a * t))));
} else {
tmp = fma((18.0 * y), (t * z), (i * -4.0)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -2.3e+130) tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - Float64(Float64(j * 27.0) * k)); elseif (x <= 1.1e+109) tmp = fma(c, b, fma(-27.0, Float64(j * k), Float64(-4.0 * Float64(a * t)))); else tmp = Float64(fma(Float64(18.0 * y), Float64(t * z), Float64(i * -4.0)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -2.3e+130], N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.1e+109], N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * y), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+130}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(-27, j \cdot k, -4 \cdot \left(a \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot y, t \cdot z, i \cdot -4\right) \cdot x\\
\end{array}
if x < -2.3000000000000002e130Initial program 84.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.6%
Applied rewrites58.6%
if -2.3000000000000002e130 < x < 1.1e109Initial program 84.7%
Applied rewrites89.3%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.3%
Applied rewrites62.3%
if 1.1e109 < x Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f6441.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
Applied rewrites42.7%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (fma (* 18.0 y) (* t z) (* i -4.0)) x)))
(if (<= x -2.3e+130)
t_1
(if (<= x 1.1e+109)
(fma c b (fma -27.0 (* j k) (* -4.0 (* a t))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma((18.0 * y), (t * z), (i * -4.0)) * x;
double tmp;
if (x <= -2.3e+130) {
tmp = t_1;
} else if (x <= 1.1e+109) {
tmp = fma(c, b, fma(-27.0, (j * k), (-4.0 * (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(fma(Float64(18.0 * y), Float64(t * z), Float64(i * -4.0)) * x) tmp = 0.0 if (x <= -2.3e+130) tmp = t_1; elseif (x <= 1.1e+109) tmp = fma(c, b, fma(-27.0, Float64(j * k), Float64(-4.0 * Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(18.0 * y), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -2.3e+130], t$95$1, If[LessEqual[x, 1.1e+109], N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(18 \cdot y, t \cdot z, i \cdot -4\right) \cdot x\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(-27, j \cdot k, -4 \cdot \left(a \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -2.3000000000000002e130 or 1.1e109 < x Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f6441.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
Applied rewrites42.7%
if -2.3000000000000002e130 < x < 1.1e109Initial program 84.7%
Applied rewrites89.3%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.3%
Applied rewrites62.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma c b (- (* (* 27.0 j) k))))
(t_2 (* (fma (* 18.0 y) (* t z) (* i -4.0)) x)))
(if (<= x -4.8e+27)
t_2
(if (<= x -2.15e-218)
t_1
(if (<= x 3.1e-60)
(fma (* t a) -4.0 (* (* k j) -27.0))
(if (<= x 90000.0) t_1 t_2))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma(c, b, -((27.0 * j) * k));
double t_2 = fma((18.0 * y), (t * z), (i * -4.0)) * x;
double tmp;
if (x <= -4.8e+27) {
tmp = t_2;
} else if (x <= -2.15e-218) {
tmp = t_1;
} else if (x <= 3.1e-60) {
tmp = fma((t * a), -4.0, ((k * j) * -27.0));
} else if (x <= 90000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(c, b, Float64(-Float64(Float64(27.0 * j) * k))) t_2 = Float64(fma(Float64(18.0 * y), Float64(t * z), Float64(i * -4.0)) * x) tmp = 0.0 if (x <= -4.8e+27) tmp = t_2; elseif (x <= -2.15e-218) tmp = t_1; elseif (x <= 3.1e-60) tmp = fma(Float64(t * a), -4.0, Float64(Float64(k * j) * -27.0)); elseif (x <= 90000.0) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(c * b + (-N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(18.0 * y), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -4.8e+27], t$95$2, If[LessEqual[x, -2.15e-218], t$95$1, If[LessEqual[x, 3.1e-60], N[(N[(t * a), $MachinePrecision] * -4.0 + N[(N[(k * j), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 90000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right)\\
t_2 := \mathsf{fma}\left(18 \cdot y, t \cdot z, i \cdot -4\right) \cdot x\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{-218}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-60}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, \left(k \cdot j\right) \cdot -27\right)\\
\mathbf{elif}\;x \leq 90000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if x < -4.8e27 or 9e4 < x Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f6441.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.7%
Applied rewrites42.7%
if -4.8e27 < x < -2.15e-218 or 3.0999999999999999e-60 < x < 9e4Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.1%
Applied rewrites42.1%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6445.0%
Applied rewrites45.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f6445.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.4%
Applied rewrites45.4%
if -2.15e-218 < x < 3.0999999999999999e-60Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in b around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.9%
Applied rewrites41.9%
lift-*.f64N/A
mul-1-negN/A
lift-fma.f64N/A
lift-*.f64N/A
distribute-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.9%
Applied rewrites41.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (fma i -4.0 (* 18.0 (* (* y z) t))) x)))
(if (<= x -4.8e+27)
t_1
(if (<= x -2.15e-218)
(fma c b (- (* (* 27.0 j) k)))
(if (<= x 8.5e+96) (fma (* t a) -4.0 (* (* k j) -27.0)) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma(i, -4.0, (18.0 * ((y * z) * t))) * x;
double tmp;
if (x <= -4.8e+27) {
tmp = t_1;
} else if (x <= -2.15e-218) {
tmp = fma(c, b, -((27.0 * j) * k));
} else if (x <= 8.5e+96) {
tmp = fma((t * a), -4.0, ((k * j) * -27.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(fma(i, -4.0, Float64(18.0 * Float64(Float64(y * z) * t))) * x) tmp = 0.0 if (x <= -4.8e+27) tmp = t_1; elseif (x <= -2.15e-218) tmp = fma(c, b, Float64(-Float64(Float64(27.0 * j) * k))); elseif (x <= 8.5e+96) tmp = fma(Float64(t * a), -4.0, Float64(Float64(k * j) * -27.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(i * -4.0 + N[(18.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -4.8e+27], t$95$1, If[LessEqual[x, -2.15e-218], N[(c * b + (-N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision])), $MachinePrecision], If[LessEqual[x, 8.5e+96], N[(N[(t * a), $MachinePrecision] * -4.0 + N[(N[(k * j), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, -4, 18 \cdot \left(\left(y \cdot z\right) \cdot t\right)\right) \cdot x\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{-218}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right)\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+96}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, \left(k \cdot j\right) \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -4.8e27 or 8.5000000000000002e96 < x Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f6441.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7%
Applied rewrites41.7%
if -4.8e27 < x < -2.15e-218Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.1%
Applied rewrites42.1%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6445.0%
Applied rewrites45.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f6445.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.4%
Applied rewrites45.4%
if -2.15e-218 < x < 8.5000000000000002e96Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in b around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.9%
Applied rewrites41.9%
lift-*.f64N/A
mul-1-negN/A
lift-fma.f64N/A
lift-*.f64N/A
distribute-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.9%
Applied rewrites41.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= (* b c) -2e+152)
(- (* b c) (* 4.0 (* a t)))
(if (<= (* b c) -2e-168)
(- (* -4.0 (* i x)) (* (* j 27.0) k))
(if (<= (* b c) 2e+87)
(fma (* t a) -4.0 (* (* k j) -27.0))
(fma c b (- (* (* 27.0 j) k)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -2e+152) {
tmp = (b * c) - (4.0 * (a * t));
} else if ((b * c) <= -2e-168) {
tmp = (-4.0 * (i * x)) - ((j * 27.0) * k);
} else if ((b * c) <= 2e+87) {
tmp = fma((t * a), -4.0, ((k * j) * -27.0));
} else {
tmp = fma(c, b, -((27.0 * j) * k));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -2e+152) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); elseif (Float64(b * c) <= -2e-168) tmp = Float64(Float64(-4.0 * Float64(i * x)) - Float64(Float64(j * 27.0) * k)); elseif (Float64(b * c) <= 2e+87) tmp = fma(Float64(t * a), -4.0, Float64(Float64(k * j) * -27.0)); else tmp = fma(c, b, Float64(-Float64(Float64(27.0 * j) * k))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -2e+152], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2e-168], N[(N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+87], N[(N[(t * a), $MachinePrecision] * -4.0 + N[(N[(k * j), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(c * b + (-N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+152}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;b \cdot c \leq -2 \cdot 10^{-168}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, \left(k \cdot j\right) \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right)\\
\end{array}
if (*.f64 b c) < -2.0000000000000001e152Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.1%
Applied rewrites42.1%
if -2.0000000000000001e152 < (*.f64 b c) < -2.0000000000000001e-168Initial program 84.7%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6441.6%
Applied rewrites41.6%
if -2.0000000000000001e-168 < (*.f64 b c) < 1.9999999999999999e87Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in b around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.9%
Applied rewrites41.9%
lift-*.f64N/A
mul-1-negN/A
lift-fma.f64N/A
lift-*.f64N/A
distribute-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.9%
Applied rewrites41.9%
if 1.9999999999999999e87 < (*.f64 b c) Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.1%
Applied rewrites42.1%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6445.0%
Applied rewrites45.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f6445.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.4%
Applied rewrites45.4%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= (* b c) -2e+79)
(- (* b c) (* 4.0 (* a t)))
(if (<= (* b c) 2e+87)
(fma (* t a) -4.0 (* (* k j) -27.0))
(fma c b (- (* (* 27.0 j) k))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -2e+79) {
tmp = (b * c) - (4.0 * (a * t));
} else if ((b * c) <= 2e+87) {
tmp = fma((t * a), -4.0, ((k * j) * -27.0));
} else {
tmp = fma(c, b, -((27.0 * j) * k));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -2e+79) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); elseif (Float64(b * c) <= 2e+87) tmp = fma(Float64(t * a), -4.0, Float64(Float64(k * j) * -27.0)); else tmp = fma(c, b, Float64(-Float64(Float64(27.0 * j) * k))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -2e+79], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+87], N[(N[(t * a), $MachinePrecision] * -4.0 + N[(N[(k * j), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(c * b + (-N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+79}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, \left(k \cdot j\right) \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right)\\
\end{array}
if (*.f64 b c) < -1.9999999999999999e79Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.1%
Applied rewrites42.1%
if -1.9999999999999999e79 < (*.f64 b c) < 1.9999999999999999e87Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in b around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.9%
Applied rewrites41.9%
lift-*.f64N/A
mul-1-negN/A
lift-fma.f64N/A
lift-*.f64N/A
distribute-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.9%
Applied rewrites41.9%
if 1.9999999999999999e87 < (*.f64 b c) Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.1%
Applied rewrites42.1%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6445.0%
Applied rewrites45.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f6445.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.4%
Applied rewrites45.4%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma c b (- (* (* 27.0 j) k)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -1e+151)
t_1
(if (<= t_2 2e+127) (- (* b c) (* 4.0 (* a t))) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma(c, b, -((27.0 * j) * k));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+151) {
tmp = t_1;
} else if (t_2 <= 2e+127) {
tmp = (b * c) - (4.0 * (a * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(c, b, Float64(-Float64(Float64(27.0 * j) * k))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -1e+151) tmp = t_1; elseif (t_2 <= 2e+127) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(c * b + (-N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+151], t$95$1, If[LessEqual[t$95$2, 2e+127], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+127}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e151 or 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.1%
Applied rewrites42.1%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6445.0%
Applied rewrites45.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f6445.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.4%
Applied rewrites45.4%
if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.1%
Applied rewrites42.1%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* (fmin j k) 27.0) (fmax j k))))
(if (<= t_1 -1e+151)
(* -27.0 (* (fmin j k) (fmax j k)))
(if (<= t_1 2e+131)
(- (* b c) (* 4.0 (* a t)))
(* (* (fmax j k) -27.0) (fmin j k))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (fmin(j, k) * 27.0) * fmax(j, k);
double tmp;
if (t_1 <= -1e+151) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (t_1 <= 2e+131) {
tmp = (b * c) - (4.0 * (a * t));
} else {
tmp = (fmax(j, k) * -27.0) * fmin(j, k);
}
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, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (fmin(j, k) * 27.0d0) * fmax(j, k)
if (t_1 <= (-1d+151)) then
tmp = (-27.0d0) * (fmin(j, k) * fmax(j, k))
else if (t_1 <= 2d+131) then
tmp = (b * c) - (4.0d0 * (a * t))
else
tmp = (fmax(j, k) * (-27.0d0)) * fmin(j, k)
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 j, double k) {
double t_1 = (fmin(j, k) * 27.0) * fmax(j, k);
double tmp;
if (t_1 <= -1e+151) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (t_1 <= 2e+131) {
tmp = (b * c) - (4.0 * (a * t));
} else {
tmp = (fmax(j, k) * -27.0) * fmin(j, k);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (fmin(j, k) * 27.0) * fmax(j, k) tmp = 0 if t_1 <= -1e+151: tmp = -27.0 * (fmin(j, k) * fmax(j, k)) elif t_1 <= 2e+131: tmp = (b * c) - (4.0 * (a * t)) else: tmp = (fmax(j, k) * -27.0) * fmin(j, k) return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(fmin(j, k) * 27.0) * fmax(j, k)) tmp = 0.0 if (t_1 <= -1e+151) tmp = Float64(-27.0 * Float64(fmin(j, k) * fmax(j, k))); elseif (t_1 <= 2e+131) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t))); else tmp = Float64(Float64(fmax(j, k) * -27.0) * fmin(j, k)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (min(j, k) * 27.0) * max(j, k); tmp = 0.0; if (t_1 <= -1e+151) tmp = -27.0 * (min(j, k) * max(j, k)); elseif (t_1 <= 2e+131) tmp = (b * c) - (4.0 * (a * t)); else tmp = (max(j, k) * -27.0) * min(j, k); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[Min[j, k], $MachinePrecision] * 27.0), $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+151], N[(-27.0 * N[(N[Min[j, k], $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+131], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Max[j, k], $MachinePrecision] * -27.0), $MachinePrecision] * N[Min[j, k], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(j, k\right) \cdot 27\right) \cdot \mathsf{max}\left(j, k\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;-27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+131}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{max}\left(j, k\right) \cdot -27\right) \cdot \mathsf{min}\left(j, k\right)\\
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e151Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999998e131Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6442.1%
Applied rewrites42.1%
if 1.9999999999999998e131 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* a t)))
(t_2 (* (* (fmin j k) 27.0) (fmax j k))))
(if (<= t_2 -1e+151)
(* -27.0 (* (fmin j k) (fmax j k)))
(if (<= t_2 -5e-235)
t_1
(if (<= t_2 5e-170)
(* -1.0 (* 4.0 (* i x)))
(if (<= t_2 2e+127)
t_1
(* (* (fmax j k) -27.0) (fmin j k))))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (a * t);
double t_2 = (fmin(j, k) * 27.0) * fmax(j, k);
double tmp;
if (t_2 <= -1e+151) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (t_2 <= -5e-235) {
tmp = t_1;
} else if (t_2 <= 5e-170) {
tmp = -1.0 * (4.0 * (i * x));
} else if (t_2 <= 2e+127) {
tmp = t_1;
} else {
tmp = (fmax(j, k) * -27.0) * fmin(j, k);
}
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, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (a * t)
t_2 = (fmin(j, k) * 27.0d0) * fmax(j, k)
if (t_2 <= (-1d+151)) then
tmp = (-27.0d0) * (fmin(j, k) * fmax(j, k))
else if (t_2 <= (-5d-235)) then
tmp = t_1
else if (t_2 <= 5d-170) then
tmp = (-1.0d0) * (4.0d0 * (i * x))
else if (t_2 <= 2d+127) then
tmp = t_1
else
tmp = (fmax(j, k) * (-27.0d0)) * fmin(j, k)
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 j, double k) {
double t_1 = -4.0 * (a * t);
double t_2 = (fmin(j, k) * 27.0) * fmax(j, k);
double tmp;
if (t_2 <= -1e+151) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (t_2 <= -5e-235) {
tmp = t_1;
} else if (t_2 <= 5e-170) {
tmp = -1.0 * (4.0 * (i * x));
} else if (t_2 <= 2e+127) {
tmp = t_1;
} else {
tmp = (fmax(j, k) * -27.0) * fmin(j, k);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (a * t) t_2 = (fmin(j, k) * 27.0) * fmax(j, k) tmp = 0 if t_2 <= -1e+151: tmp = -27.0 * (fmin(j, k) * fmax(j, k)) elif t_2 <= -5e-235: tmp = t_1 elif t_2 <= 5e-170: tmp = -1.0 * (4.0 * (i * x)) elif t_2 <= 2e+127: tmp = t_1 else: tmp = (fmax(j, k) * -27.0) * fmin(j, k) return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(a * t)) t_2 = Float64(Float64(fmin(j, k) * 27.0) * fmax(j, k)) tmp = 0.0 if (t_2 <= -1e+151) tmp = Float64(-27.0 * Float64(fmin(j, k) * fmax(j, k))); elseif (t_2 <= -5e-235) tmp = t_1; elseif (t_2 <= 5e-170) tmp = Float64(-1.0 * Float64(4.0 * Float64(i * x))); elseif (t_2 <= 2e+127) tmp = t_1; else tmp = Float64(Float64(fmax(j, k) * -27.0) * fmin(j, k)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = -4.0 * (a * t); t_2 = (min(j, k) * 27.0) * max(j, k); tmp = 0.0; if (t_2 <= -1e+151) tmp = -27.0 * (min(j, k) * max(j, k)); elseif (t_2 <= -5e-235) tmp = t_1; elseif (t_2 <= 5e-170) tmp = -1.0 * (4.0 * (i * x)); elseif (t_2 <= 2e+127) tmp = t_1; else tmp = (max(j, k) * -27.0) * min(j, k); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Min[j, k], $MachinePrecision] * 27.0), $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+151], N[(-27.0 * N[(N[Min[j, k], $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-235], t$95$1, If[LessEqual[t$95$2, 5e-170], N[(-1.0 * N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+127], t$95$1, N[(N[(N[Max[j, k], $MachinePrecision] * -27.0), $MachinePrecision] * N[Min[j, k], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
t_2 := \left(\mathsf{min}\left(j, k\right) \cdot 27\right) \cdot \mathsf{max}\left(j, k\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;-27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-235}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-170}:\\
\;\;\;\;-1 \cdot \left(4 \cdot \left(i \cdot x\right)\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{max}\left(j, k\right) \cdot -27\right) \cdot \mathsf{min}\left(j, k\right)\\
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e151Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999998e-235 or 5.0000000000000001e-170 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6421.2%
Applied rewrites21.2%
if -4.9999999999999998e-235 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000000000001e-170Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6420.9%
Applied rewrites20.9%
if 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* (fmin j k) 27.0) (fmax j k))))
(if (<= t_1 -1e+151)
(* -27.0 (* (fmin j k) (fmax j k)))
(if (<= t_1 2e+127)
(* -4.0 (* a t))
(* (* (fmax j k) -27.0) (fmin j k))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (fmin(j, k) * 27.0) * fmax(j, k);
double tmp;
if (t_1 <= -1e+151) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (t_1 <= 2e+127) {
tmp = -4.0 * (a * t);
} else {
tmp = (fmax(j, k) * -27.0) * fmin(j, k);
}
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, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (fmin(j, k) * 27.0d0) * fmax(j, k)
if (t_1 <= (-1d+151)) then
tmp = (-27.0d0) * (fmin(j, k) * fmax(j, k))
else if (t_1 <= 2d+127) then
tmp = (-4.0d0) * (a * t)
else
tmp = (fmax(j, k) * (-27.0d0)) * fmin(j, k)
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 j, double k) {
double t_1 = (fmin(j, k) * 27.0) * fmax(j, k);
double tmp;
if (t_1 <= -1e+151) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (t_1 <= 2e+127) {
tmp = -4.0 * (a * t);
} else {
tmp = (fmax(j, k) * -27.0) * fmin(j, k);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (fmin(j, k) * 27.0) * fmax(j, k) tmp = 0 if t_1 <= -1e+151: tmp = -27.0 * (fmin(j, k) * fmax(j, k)) elif t_1 <= 2e+127: tmp = -4.0 * (a * t) else: tmp = (fmax(j, k) * -27.0) * fmin(j, k) return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(fmin(j, k) * 27.0) * fmax(j, k)) tmp = 0.0 if (t_1 <= -1e+151) tmp = Float64(-27.0 * Float64(fmin(j, k) * fmax(j, k))); elseif (t_1 <= 2e+127) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(fmax(j, k) * -27.0) * fmin(j, k)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (min(j, k) * 27.0) * max(j, k); tmp = 0.0; if (t_1 <= -1e+151) tmp = -27.0 * (min(j, k) * max(j, k)); elseif (t_1 <= 2e+127) tmp = -4.0 * (a * t); else tmp = (max(j, k) * -27.0) * min(j, k); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[Min[j, k], $MachinePrecision] * 27.0), $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+151], N[(-27.0 * N[(N[Min[j, k], $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+127], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Max[j, k], $MachinePrecision] * -27.0), $MachinePrecision] * N[Min[j, k], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(j, k\right) \cdot 27\right) \cdot \mathsf{max}\left(j, k\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;-27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+127}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{max}\left(j, k\right) \cdot -27\right) \cdot \mathsf{min}\left(j, k\right)\\
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e151Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6421.2%
Applied rewrites21.2%
if 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -1e+151)
(* -27.0 (* j k))
(if (<= t_1 2e+127) (* -4.0 (* a t)) (* (* j -27.0) k)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -1e+151) {
tmp = -27.0 * (j * k);
} else if (t_1 <= 2e+127) {
tmp = -4.0 * (a * t);
} else {
tmp = (j * -27.0) * k;
}
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, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-1d+151)) then
tmp = (-27.0d0) * (j * k)
else if (t_1 <= 2d+127) then
tmp = (-4.0d0) * (a * t)
else
tmp = (j * (-27.0d0)) * k
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 j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -1e+151) {
tmp = -27.0 * (j * k);
} else if (t_1 <= 2e+127) {
tmp = -4.0 * (a * t);
} else {
tmp = (j * -27.0) * k;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -1e+151: tmp = -27.0 * (j * k) elif t_1 <= 2e+127: tmp = -4.0 * (a * t) else: tmp = (j * -27.0) * k return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -1e+151) tmp = Float64(-27.0 * Float64(j * k)); elseif (t_1 <= 2e+127) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(j * -27.0) * k); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (j * 27.0) * k; tmp = 0.0; if (t_1 <= -1e+151) tmp = -27.0 * (j * k); elseif (t_1 <= 2e+127) tmp = -4.0 * (a * t); else tmp = (j * -27.0) * k; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+151], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+127], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+127}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot -27\right) \cdot k\\
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e151Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6421.2%
Applied rewrites21.2%
if 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6424.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6424.2%
Applied rewrites24.2%
(FPCore (x y z t a b c i j k) :precision binary64 (let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k))) (if (<= t_2 -1e+151) t_1 (if (<= t_2 2e+127) (* -4.0 (* a t)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+151) {
tmp = t_1;
} else if (t_2 <= 2e+127) {
tmp = -4.0 * (a * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-1d+151)) then
tmp = t_1
else if (t_2 <= 2d+127) then
tmp = (-4.0d0) * (a * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+151) {
tmp = t_1;
} else if (t_2 <= 2e+127) {
tmp = -4.0 * (a * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -1e+151: tmp = t_1 elif t_2 <= 2e+127: tmp = -4.0 * (a * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -1e+151) tmp = t_1; elseif (t_2 <= 2e+127) tmp = Float64(-4.0 * Float64(a * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = -27.0 * (j * k); t_2 = (j * 27.0) * k; tmp = 0.0; if (t_2 <= -1e+151) tmp = t_1; elseif (t_2 <= 2e+127) tmp = -4.0 * (a * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+151], t$95$1, If[LessEqual[t$95$2, 2e+127], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+127}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e151 or 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6421.2%
Applied rewrites21.2%
(FPCore (x y z t a b c i j k) :precision binary64 (* -4.0 (* a t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -4.0 * (a * t);
}
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, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
code = (-4.0d0) * (a * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -4.0 * (a * t);
}
def code(x, y, z, t, a, b, c, i, j, k): return -4.0 * (a * t)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(-4.0 * Float64(a * t)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = -4.0 * (a * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]
-4 \cdot \left(a \cdot t\right)
Initial program 84.7%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5%
Applied rewrites61.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6421.2%
Applied rewrites21.2%
herbie shell --seed 2025212
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))