
(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]
\begin{array}{l}
\\
\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
\end{array}
Herbie found 18 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]
\begin{array}{l}
\\
\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
\end{array}
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (* k j) 27.0 (* (* a t) 4.0))))
(if (<= x -1e-87)
(- (fma (fma (* 18.0 t) (* z y) (* -4.0 i)) x (* c b)) t_1)
(if (<= x 2.8e-174)
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
(* j (* k 27.0)))
(fma c b (- (* (fma (* (* z y) t) 18.0 (* -4.0 i)) x) 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((k * j), 27.0, ((a * t) * 4.0));
double tmp;
if (x <= -1e-87) {
tmp = fma(fma((18.0 * t), (z * y), (-4.0 * i)), x, (c * b)) - t_1;
} else if (x <= 2.8e-174) {
tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - (j * (k * 27.0));
} else {
tmp = fma(c, b, ((fma(((z * y) * t), 18.0, (-4.0 * i)) * x) - t_1));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(k * j), 27.0, Float64(Float64(a * t) * 4.0)) tmp = 0.0 if (x <= -1e-87) tmp = Float64(fma(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)), x, Float64(c * b)) - t_1); elseif (x <= 2.8e-174) tmp = 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(j * Float64(k * 27.0))); else tmp = fma(c, b, Float64(Float64(fma(Float64(Float64(z * y) * t), 18.0, Float64(-4.0 * i)) * x) - t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(k * j), $MachinePrecision] * 27.0 + N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e-87], N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x + N[(c * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 2.8e-174], 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[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * b + N[(N[(N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{-87}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right), x, c \cdot b\right) - t\_1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-174}:\\
\;\;\;\;\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) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right) \cdot x - t\_1\right)\\
\end{array}
\end{array}
if x < -1.00000000000000002e-87Initial program 79.9%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites89.8%
if -1.00000000000000002e-87 < x < 2.79999999999999999e-174Initial program 95.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6495.7
Applied rewrites95.7%
if 2.79999999999999999e-174 < x Initial program 81.4%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites88.4%
Applied rewrites89.6%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= z 1e+81)
(fma
c
b
(-
(* (fma (* (* z y) t) 18.0 (* -4.0 i)) x)
(fma (* k j) 27.0 (* (* a t) 4.0))))
(*
(-
(fma (* (* y x) t) 18.0 (/ (* c b) z))
(fma (/ (fma i x (* a t)) z) 4.0 (* (/ (* k j) z) 27.0)))
z)))
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 (z <= 1e+81) {
tmp = fma(c, b, ((fma(((z * y) * t), 18.0, (-4.0 * i)) * x) - fma((k * j), 27.0, ((a * t) * 4.0))));
} else {
tmp = (fma(((y * x) * t), 18.0, ((c * b) / z)) - fma((fma(i, x, (a * t)) / z), 4.0, (((k * j) / z) * 27.0))) * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (z <= 1e+81) tmp = fma(c, b, Float64(Float64(fma(Float64(Float64(z * y) * t), 18.0, Float64(-4.0 * i)) * x) - fma(Float64(k * j), 27.0, Float64(Float64(a * t) * 4.0)))); else tmp = Float64(Float64(fma(Float64(Float64(y * x) * t), 18.0, Float64(Float64(c * b) / z)) - fma(Float64(fma(i, x, Float64(a * t)) / z), 4.0, Float64(Float64(Float64(k * j) / z) * 27.0))) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[z, 1e+81], N[(c * b + N[(N[(N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(k * j), $MachinePrecision] * 27.0 + N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * t), $MachinePrecision] * 18.0 + N[(N[(c * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * 4.0 + N[(N[(N[(k * j), $MachinePrecision] / z), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{+81}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right) \cdot x - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot t, 18, \frac{c \cdot b}{z}\right) - \mathsf{fma}\left(\frac{\mathsf{fma}\left(i, x, a \cdot t\right)}{z}, 4, \frac{k \cdot j}{z} \cdot 27\right)\right) \cdot z\\
\end{array}
\end{array}
if z < 9.99999999999999921e80Initial program 85.8%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites89.6%
Applied rewrites90.7%
if 9.99999999999999921e80 < z Initial program 82.1%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites79.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.9%
(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))
(* (* j 27.0) k))
INFINITY)
(-
(fma (fma (* 18.0 t) (* z y) (* -4.0 i)) x (* c b))
(fma (* k j) 27.0 (* (* a t) 4.0)))
(* (* (- (* (/ (* (* z y) t) i) 18.0) 4.0) i) 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)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = fma(fma((18.0 * t), (z * y), (-4.0 * i)), x, (c * b)) - fma((k * j), 27.0, ((a * t) * 4.0));
} else {
tmp = ((((((z * y) * t) / i) * 18.0) - 4.0) * i) * 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(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)) <= Inf) tmp = Float64(fma(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)), x, Float64(c * b)) - fma(Float64(k * j), 27.0, Float64(Float64(a * t) * 4.0))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * y) * t) / i) * 18.0) - 4.0) * i) * 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[(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], Infinity], N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x + N[(c * b), $MachinePrecision]), $MachinePrecision] - N[(N[(k * j), $MachinePrecision] * 27.0 + N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] / i), $MachinePrecision] * 18.0), $MachinePrecision] - 4.0), $MachinePrecision] * i), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right), x, c \cdot b\right) - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\left(z \cdot y\right) \cdot t}{i} \cdot 18 - 4\right) \cdot i\right) \cdot x\\
\end{array}
\end{array}
if (-.f64 (-.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)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 95.0%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites93.6%
if +inf.0 < (-.f64 (-.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)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 0.0%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites37.0%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6463.2
Applied rewrites63.2%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6463.9
Applied rewrites63.9%
(FPCore (x y z t a b c i j k) :precision binary64 (fma c b (- (* (fma (* (* z y) t) 18.0 (* -4.0 i)) x) (fma (* k j) 27.0 (* (* a t) 4.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return fma(c, b, ((fma(((z * y) * t), 18.0, (-4.0 * i)) * x) - fma((k * j), 27.0, ((a * t) * 4.0))));
}
function code(x, y, z, t, a, b, c, i, j, k) return fma(c, b, Float64(Float64(fma(Float64(Float64(z * y) * t), 18.0, Float64(-4.0 * i)) * x) - fma(Float64(k * j), 27.0, Float64(Float64(a * t) * 4.0)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(c * b + N[(N[(N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(k * j), $MachinePrecision] * 27.0 + N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, b, \mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right) \cdot x - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\right)\right)
\end{array}
Initial program 85.1%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites87.7%
Applied rewrites88.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+84)
(- (* (fma (* 18.0 t) (* z y) (* -4.0 i)) x) t_1)
(if (<= t_1 1e+160)
(fma (* 18.0 t) (* (* z y) x) (- (* c b) (* 4.0 (fma a t (* i x)))))
(- (fma c b (* -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 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+84) {
tmp = (fma((18.0 * t), (z * y), (-4.0 * i)) * x) - t_1;
} else if (t_1 <= 1e+160) {
tmp = fma((18.0 * t), ((z * y) * x), ((c * b) - (4.0 * fma(a, t, (i * x)))));
} else {
tmp = fma(c, b, (-4.0 * (a * t))) - t_1;
}
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 <= -2e+84) tmp = Float64(Float64(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)) * x) - t_1); elseif (t_1 <= 1e+160) tmp = fma(Float64(18.0 * t), Float64(Float64(z * y) * x), Float64(Float64(c * b) - Float64(4.0 * fma(a, t, Float64(i * x))))); else tmp = Float64(fma(c, b, Float64(-4.0 * Float64(a * t))) - t_1); end return 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, -2e+84], N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 1e+160], N[(N[(18.0 * t), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * b + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x - t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t\right)\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.00000000000000012e84Initial program 82.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6473.9
Applied rewrites73.9%
if -2.00000000000000012e84 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000001e160Initial program 87.1%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6482.1
Applied rewrites82.1%
if 1.00000000000000001e160 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 78.9%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6473.9
Applied rewrites73.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= x -1.65e-46)
(- (* (fma (* 18.0 t) (* z y) (* -4.0 i)) x) t_1)
(if (<= x 0.00085)
(- (fma c b (* -4.0 (* a t))) t_1)
(fma (fma (* (* z y) t) 18.0 (* -4.0 i)) x (* c b))))))
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 (x <= -1.65e-46) {
tmp = (fma((18.0 * t), (z * y), (-4.0 * i)) * x) - t_1;
} else if (x <= 0.00085) {
tmp = fma(c, b, (-4.0 * (a * t))) - t_1;
} else {
tmp = fma(fma(((z * y) * t), 18.0, (-4.0 * i)), x, (c * b));
}
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 (x <= -1.65e-46) tmp = Float64(Float64(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)) * x) - t_1); elseif (x <= 0.00085) tmp = Float64(fma(c, b, Float64(-4.0 * Float64(a * t))) - t_1); else tmp = fma(fma(Float64(Float64(z * y) * t), 18.0, Float64(-4.0 * i)), x, Float64(c * b)); end return 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[x, -1.65e-46], N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 0.00085], N[(N[(c * b + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x + N[(c * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x - t\_1\\
\mathbf{elif}\;x \leq 0.00085:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right), x, c \cdot b\right)\\
\end{array}
\end{array}
if x < -1.65000000000000007e-46Initial program 78.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6473.2
Applied rewrites73.2%
if -1.65000000000000007e-46 < x < 8.49999999999999953e-4Initial program 94.6%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6479.1
Applied rewrites79.1%
if 8.49999999999999953e-4 < x Initial program 75.3%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6471.5
Applied rewrites71.5%
Taylor expanded in a around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-+r+N/A
Applied rewrites75.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (fma (* (* z y) t) 18.0 (* -4.0 i)) x (* c b))))
(if (<= x -8.2e+40)
t_1
(if (<= x 0.00085) (- (fma c b (* -4.0 (* a t))) (* (* j 27.0) k)) 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(fma(((z * y) * t), 18.0, (-4.0 * i)), x, (c * b));
double tmp;
if (x <= -8.2e+40) {
tmp = t_1;
} else if (x <= 0.00085) {
tmp = fma(c, b, (-4.0 * (a * t))) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(fma(Float64(Float64(z * y) * t), 18.0, Float64(-4.0 * i)), x, Float64(c * b)) tmp = 0.0 if (x <= -8.2e+40) tmp = t_1; elseif (x <= 0.00085) tmp = Float64(fma(c, b, Float64(-4.0 * Float64(a * t))) - Float64(Float64(j * 27.0) * k)); 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[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x + N[(c * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.2e+40], t$95$1, If[LessEqual[x, 0.00085], N[(N[(c * b + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right), x, c \cdot b\right)\\
\mathbf{if}\;x \leq -8.2 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 0.00085:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.2000000000000003e40 or 8.49999999999999953e-4 < x Initial program 75.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6472.5
Applied rewrites72.5%
Taylor expanded in a around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-+r+N/A
Applied rewrites75.8%
if -8.2000000000000003e40 < x < 8.49999999999999953e-4Initial program 94.2%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6477.4
Applied rewrites77.4%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (fma (* 18.0 t) (* z y) (* -4.0 i)) x)))
(if (<= x -6.8e+69)
t_1
(if (<= x 8.5e+56) (- (fma c b (* -4.0 (* a t))) (* (* j 27.0) k)) 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 * t), (z * y), (-4.0 * i)) * x;
double tmp;
if (x <= -6.8e+69) {
tmp = t_1;
} else if (x <= 8.5e+56) {
tmp = fma(c, b, (-4.0 * (a * t))) - ((j * 27.0) * k);
} 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 * t), Float64(z * y), Float64(-4.0 * i)) * x) tmp = 0.0 if (x <= -6.8e+69) tmp = t_1; elseif (x <= 8.5e+56) tmp = Float64(fma(c, b, Float64(-4.0 * Float64(a * t))) - Float64(Float64(j * 27.0) * k)); 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 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -6.8e+69], t$95$1, If[LessEqual[x, 8.5e+56], N[(N[(c * b + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.79999999999999973e69 or 8.4999999999999998e56 < x Initial program 73.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6468.8
Applied rewrites68.8%
if -6.79999999999999973e69 < x < 8.4999999999999998e56Initial program 93.2%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6474.8
Applied rewrites74.8%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+83)
(- (* (* -4.0 i) x) t_1)
(if (<= t_1 5e+145)
(fma c b (* (fma i x (* a t)) -4.0))
(- (* c b) (* j (* k 27.0)))))))
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 <= -2e+83) {
tmp = ((-4.0 * i) * x) - t_1;
} else if (t_1 <= 5e+145) {
tmp = fma(c, b, (fma(i, x, (a * t)) * -4.0));
} else {
tmp = (c * b) - (j * (k * 27.0));
}
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 <= -2e+83) tmp = Float64(Float64(Float64(-4.0 * i) * x) - t_1); elseif (t_1 <= 5e+145) tmp = fma(c, b, Float64(fma(i, x, Float64(a * t)) * -4.0)); else tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); end return 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, -2e+83], N[(N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 5e+145], N[(c * b + N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+83}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x - t\_1\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+145}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(i, x, a \cdot t\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.00000000000000006e83Initial program 82.6%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.3
Applied rewrites64.3%
if -2.00000000000000006e83 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.99999999999999967e145Initial program 87.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6482.5
Applied rewrites82.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f6469.6
Applied rewrites69.6%
if 4.99999999999999967e145 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 79.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6467.9
Applied rewrites67.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.1
Applied rewrites68.1%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma c b (* (* -4.0 a) t))))
(if (<= (* b c) -4e+76)
t_1
(if (<= (* b c) 5e+72) (- (* (* -4.0 i) x) (* (* j 27.0) k)) 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, ((-4.0 * a) * t));
double tmp;
if ((b * c) <= -4e+76) {
tmp = t_1;
} else if ((b * c) <= 5e+72) {
tmp = ((-4.0 * i) * x) - ((j * 27.0) * k);
} 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(-4.0 * a) * t)) tmp = 0.0 if (Float64(b * c) <= -4e+76) tmp = t_1; elseif (Float64(b * c) <= 5e+72) tmp = Float64(Float64(Float64(-4.0 * i) * x) - Float64(Float64(j * 27.0) * k)); 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), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -4e+76], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 5e+72], N[(N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, \left(-4 \cdot a\right) \cdot t\right)\\
\mathbf{if}\;b \cdot c \leq -4 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+72}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -4.0000000000000002e76 or 4.99999999999999992e72 < (*.f64 b c) Initial program 82.1%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites85.4%
Applied rewrites88.4%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
if -4.0000000000000002e76 < (*.f64 b c) < 4.99999999999999992e72Initial program 87.0%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.6
Applied rewrites50.6%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -1e+23)
(fma c b (* (* k j) -27.0))
(if (<= t_1 5e+137)
(fma c b (* (* -4.0 a) t))
(- (* c b) (* j (* k 27.0)))))))
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+23) {
tmp = fma(c, b, ((k * j) * -27.0));
} else if (t_1 <= 5e+137) {
tmp = fma(c, b, ((-4.0 * a) * t));
} else {
tmp = (c * b) - (j * (k * 27.0));
}
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+23) tmp = fma(c, b, Float64(Float64(k * j) * -27.0)); elseif (t_1 <= 5e+137) tmp = fma(c, b, Float64(Float64(-4.0 * a) * t)); else tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); end return 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+23], N[(c * b + N[(N[(k * j), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+137], N[(c * b + N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(k \cdot j\right) \cdot -27\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(-4 \cdot a\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.9999999999999992e22Initial program 83.4%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites85.5%
Applied rewrites87.3%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6461.3
Applied rewrites61.3%
if -9.9999999999999992e22 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000000000002e137Initial program 87.0%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites89.7%
Applied rewrites90.4%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6449.6
Applied rewrites49.6%
if 5.0000000000000002e137 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 79.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6467.0
Applied rewrites67.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Applied rewrites67.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma c b (* (* k j) -27.0))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -1e+23)
t_1
(if (<= t_2 5e+137) (fma c b (* (* -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, ((k * j) * -27.0));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+23) {
tmp = t_1;
} else if (t_2 <= 5e+137) {
tmp = fma(c, b, ((-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(k * j) * -27.0)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -1e+23) tmp = t_1; elseif (t_2 <= 5e+137) tmp = fma(c, b, Float64(Float64(-4.0 * 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[(k * j), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+23], t$95$1, If[LessEqual[t$95$2, 5e+137], N[(c * b + N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, \left(k \cdot j\right) \cdot -27\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(-4 \cdot a\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.9999999999999992e22 or 5.0000000000000002e137 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 82.1%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites84.5%
Applied rewrites86.4%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6464.2
Applied rewrites64.2%
if -9.9999999999999992e22 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000000000002e137Initial program 87.0%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites89.7%
Applied rewrites90.4%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6449.6
Applied rewrites49.6%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma c b (* (* -4.0 a) t))))
(if (<= (* b c) -5e+61)
t_1
(if (<= (* b c) 5e+133) (* (fma i x (* a t)) -4.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(c, b, ((-4.0 * a) * t));
double tmp;
if ((b * c) <= -5e+61) {
tmp = t_1;
} else if ((b * c) <= 5e+133) {
tmp = fma(i, x, (a * t)) * -4.0;
} 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(-4.0 * a) * t)) tmp = 0.0 if (Float64(b * c) <= -5e+61) tmp = t_1; elseif (Float64(b * c) <= 5e+133) tmp = Float64(fma(i, x, Float64(a * t)) * -4.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[(c * b + N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -5e+61], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 5e+133], N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, \left(-4 \cdot a\right) \cdot t\right)\\
\mathbf{if}\;b \cdot c \leq -5 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+133}:\\
\;\;\;\;\mathsf{fma}\left(i, x, a \cdot t\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -5.00000000000000018e61 or 4.99999999999999961e133 < (*.f64 b c) Initial program 81.3%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites85.0%
Applied rewrites88.2%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6462.5
Applied rewrites62.5%
if -5.00000000000000018e61 < (*.f64 b c) < 4.99999999999999961e133Initial program 87.2%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6466.5
Applied rewrites66.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f6450.4
Applied rewrites50.4%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6445.4
Applied rewrites45.4%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (* a t) -4.0 (* c b))))
(if (<= (* b c) -5e+61)
t_1
(if (<= (* b c) 5e+133) (* (fma i x (* a t)) -4.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((a * t), -4.0, (c * b));
double tmp;
if ((b * c) <= -5e+61) {
tmp = t_1;
} else if ((b * c) <= 5e+133) {
tmp = fma(i, x, (a * t)) * -4.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(a * t), -4.0, Float64(c * b)) tmp = 0.0 if (Float64(b * c) <= -5e+61) tmp = t_1; elseif (Float64(b * c) <= 5e+133) tmp = Float64(fma(i, x, Float64(a * t)) * -4.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[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -5e+61], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 5e+133], N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right)\\
\mathbf{if}\;b \cdot c \leq -5 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+133}:\\
\;\;\;\;\mathsf{fma}\left(i, x, a \cdot t\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -5.00000000000000018e61 or 4.99999999999999961e133 < (*.f64 b c) Initial program 81.3%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6475.3
Applied rewrites75.3%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.5
Applied rewrites61.5%
if -5.00000000000000018e61 < (*.f64 b c) < 4.99999999999999961e133Initial program 87.2%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6466.5
Applied rewrites66.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f6450.4
Applied rewrites50.4%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6445.4
Applied rewrites45.4%
(FPCore (x y z t a b c i j k) :precision binary64 (if (<= (* b c) -5e+61) (* c b) (if (<= (* b c) 5e+181) (* (fma i x (* a t)) -4.0) (* c b))))
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) <= -5e+61) {
tmp = c * b;
} else if ((b * c) <= 5e+181) {
tmp = fma(i, x, (a * t)) * -4.0;
} else {
tmp = c * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -5e+61) tmp = Float64(c * b); elseif (Float64(b * c) <= 5e+181) tmp = Float64(fma(i, x, Float64(a * t)) * -4.0); else tmp = Float64(c * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -5e+61], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5e+181], N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], N[(c * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -5 \cdot 10^{+61}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+181}:\\
\;\;\;\;\mathsf{fma}\left(i, x, a \cdot t\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -5.00000000000000018e61 or 5.0000000000000003e181 < (*.f64 b c) Initial program 80.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6454.6
Applied rewrites54.6%
if -5.00000000000000018e61 < (*.f64 b c) < 5.0000000000000003e181Initial program 87.1%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6466.8
Applied rewrites66.8%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f6450.8
Applied rewrites50.8%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6445.0
Applied rewrites45.0%
(FPCore (x y z t a b c i j k) :precision binary64 (if (<= (* b c) -4e+76) (* c b) (if (<= (* b c) 1e+170) (* (* -27.0 k) j) (* c b))))
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) <= -4e+76) {
tmp = c * b;
} else if ((b * c) <= 1e+170) {
tmp = (-27.0 * k) * j;
} else {
tmp = c * b;
}
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) :: tmp
if ((b * c) <= (-4d+76)) then
tmp = c * b
else if ((b * c) <= 1d+170) then
tmp = ((-27.0d0) * k) * j
else
tmp = c * b
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 tmp;
if ((b * c) <= -4e+76) {
tmp = c * b;
} else if ((b * c) <= 1e+170) {
tmp = (-27.0 * k) * j;
} else {
tmp = c * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -4e+76: tmp = c * b elif (b * c) <= 1e+170: tmp = (-27.0 * k) * j else: tmp = c * b return tmp
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -4e+76) tmp = Float64(c * b); elseif (Float64(b * c) <= 1e+170) tmp = Float64(Float64(-27.0 * k) * j); else tmp = Float64(c * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0; if ((b * c) <= -4e+76) tmp = c * b; elseif ((b * c) <= 1e+170) tmp = (-27.0 * k) * j; else tmp = c * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -4e+76], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1e+170], N[(N[(-27.0 * k), $MachinePrecision] * j), $MachinePrecision], N[(c * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -4 \cdot 10^{+76}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq 10^{+170}:\\
\;\;\;\;\left(-27 \cdot k\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -4.0000000000000002e76 or 1.00000000000000003e170 < (*.f64 b c) Initial program 80.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6455.4
Applied rewrites55.4%
if -4.0000000000000002e76 < (*.f64 b c) < 1.00000000000000003e170Initial program 87.2%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.6
Applied rewrites28.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6428.6
Applied rewrites28.6%
(FPCore (x y z t a b c i j k) :precision binary64 (if (<= (* b c) -4e+76) (* c b) (if (<= (* b c) 1e+170) (* -27.0 (* k j)) (* c b))))
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) <= -4e+76) {
tmp = c * b;
} else if ((b * c) <= 1e+170) {
tmp = -27.0 * (k * j);
} else {
tmp = c * b;
}
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) :: tmp
if ((b * c) <= (-4d+76)) then
tmp = c * b
else if ((b * c) <= 1d+170) then
tmp = (-27.0d0) * (k * j)
else
tmp = c * b
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 tmp;
if ((b * c) <= -4e+76) {
tmp = c * b;
} else if ((b * c) <= 1e+170) {
tmp = -27.0 * (k * j);
} else {
tmp = c * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -4e+76: tmp = c * b elif (b * c) <= 1e+170: tmp = -27.0 * (k * j) else: tmp = c * b return tmp
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -4e+76) tmp = Float64(c * b); elseif (Float64(b * c) <= 1e+170) tmp = Float64(-27.0 * Float64(k * j)); else tmp = Float64(c * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0; if ((b * c) <= -4e+76) tmp = c * b; elseif ((b * c) <= 1e+170) tmp = -27.0 * (k * j); else tmp = c * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -4e+76], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1e+170], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], N[(c * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -4 \cdot 10^{+76}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq 10^{+170}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -4.0000000000000002e76 or 1.00000000000000003e170 < (*.f64 b c) Initial program 80.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6455.4
Applied rewrites55.4%
if -4.0000000000000002e76 < (*.f64 b c) < 1.00000000000000003e170Initial program 87.2%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.6
Applied rewrites28.6%
(FPCore (x y z t a b c i j k) :precision binary64 (* c b))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return c * b;
}
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 = c * b
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 c * b;
}
def code(x, y, z, t, a, b, c, i, j, k): return c * b
function code(x, y, z, t, a, b, c, i, j, k) return Float64(c * b) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = c * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(c * b), $MachinePrecision]
\begin{array}{l}
\\
c \cdot b
\end{array}
Initial program 85.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6422.9
Applied rewrites22.9%
herbie shell --seed 2025120
(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)))