
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
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)
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
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
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)
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
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (fma (- i) (* j y) (* b (fma (- c) z (* a i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(-i, (j * y), (b * fma(-c, z, (a * i))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(Float64(-i), Float64(j * y), Float64(b * fma(Float64(-c), z, Float64(a * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[((-i) * N[(j * y), $MachinePrecision] + N[(b * N[((-c) * z + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, b \cdot \mathsf{fma}\left(-c, z, a \cdot i\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 91.2%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 0.0%
Taylor expanded in c around 0
Applied rewrites41.6%
Taylor expanded in b around inf
Applied rewrites61.5%
Final simplification87.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- b) (fma (- a) i (* c z)))))
(if (<= x -1.15e+106)
(fma (fma (- a) t (* z y)) x t_1)
(if (<= x -1.05e-11)
(fma (- i) (* j y) (* b (fma (- c) z (* a i))))
(if (<= x -5.5e-142)
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (* c t)))
(if (<= x 3.4e+40)
(fma (fma (- i) y (* c t)) j t_1)
(fma x (fma (- a) t (* y z)) (* c (fma (- b) z (* j t))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -b * fma(-a, i, (c * z));
double tmp;
if (x <= -1.15e+106) {
tmp = fma(fma(-a, t, (z * y)), x, t_1);
} else if (x <= -1.05e-11) {
tmp = fma(-i, (j * y), (b * fma(-c, z, (a * i))));
} else if (x <= -5.5e-142) {
tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * (c * t));
} else if (x <= 3.4e+40) {
tmp = fma(fma(-i, y, (c * t)), j, t_1);
} else {
tmp = fma(x, fma(-a, t, (y * z)), (c * fma(-b, z, (j * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-b) * fma(Float64(-a), i, Float64(c * z))) tmp = 0.0 if (x <= -1.15e+106) tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, t_1); elseif (x <= -1.05e-11) tmp = fma(Float64(-i), Float64(j * y), Float64(b * fma(Float64(-c), z, Float64(a * i)))); elseif (x <= -5.5e-142) tmp = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(c * t))); elseif (x <= 3.4e+40) tmp = fma(fma(Float64(-i), y, Float64(c * t)), j, t_1); else tmp = fma(x, fma(Float64(-a), t, Float64(y * z)), Float64(c * fma(Float64(-b), z, Float64(j * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-b) * N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+106], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + t$95$1), $MachinePrecision], If[LessEqual[x, -1.05e-11], N[((-i) * N[(j * y), $MachinePrecision] + N[(b * N[((-c) * z + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e-142], N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.4e+40], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j + t$95$1), $MachinePrecision], N[(x * N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(c * N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, t\_1\right)\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, b \cdot \mathsf{fma}\left(-c, z, a \cdot i\right)\right)\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-142}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t\right)\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-i, y, c \cdot t\right), j, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-a, t, y \cdot z\right), c \cdot \mathsf{fma}\left(-b, z, j \cdot t\right)\right)\\
\end{array}
\end{array}
if x < -1.1500000000000001e106Initial program 81.7%
Taylor expanded in j around 0
Applied rewrites89.1%
if -1.1500000000000001e106 < x < -1.0499999999999999e-11Initial program 48.5%
Taylor expanded in c around 0
Applied rewrites65.4%
Taylor expanded in b around inf
Applied rewrites82.3%
if -1.0499999999999999e-11 < x < -5.50000000000000023e-142Initial program 76.1%
Taylor expanded in y around 0
Applied rewrites70.1%
if -5.50000000000000023e-142 < x < 3.39999999999999989e40Initial program 83.2%
Taylor expanded in x around 0
Applied rewrites85.8%
if 3.39999999999999989e40 < x Initial program 80.6%
Taylor expanded in c around 0
Applied rewrites92.2%
Taylor expanded in i around 0
Applied rewrites86.9%
Final simplification84.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- b) (fma (- a) i (* c z)))))
(if (<= x -1.15e+106)
(fma (fma (- a) t (* z y)) x t_1)
(if (<= x -1.05e-11)
(fma (- i) (* j y) (* b (fma (- c) z (* a i))))
(if (<= x -3.2e-143)
(+ (* (- a) (fma t x (* (- b) i))) (* j (- (* c t) (* i y))))
(if (<= x 3.4e+40)
(fma (fma (- i) y (* c t)) j t_1)
(fma x (fma (- a) t (* y z)) (* c (fma (- b) z (* j t))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -b * fma(-a, i, (c * z));
double tmp;
if (x <= -1.15e+106) {
tmp = fma(fma(-a, t, (z * y)), x, t_1);
} else if (x <= -1.05e-11) {
tmp = fma(-i, (j * y), (b * fma(-c, z, (a * i))));
} else if (x <= -3.2e-143) {
tmp = (-a * fma(t, x, (-b * i))) + (j * ((c * t) - (i * y)));
} else if (x <= 3.4e+40) {
tmp = fma(fma(-i, y, (c * t)), j, t_1);
} else {
tmp = fma(x, fma(-a, t, (y * z)), (c * fma(-b, z, (j * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-b) * fma(Float64(-a), i, Float64(c * z))) tmp = 0.0 if (x <= -1.15e+106) tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, t_1); elseif (x <= -1.05e-11) tmp = fma(Float64(-i), Float64(j * y), Float64(b * fma(Float64(-c), z, Float64(a * i)))); elseif (x <= -3.2e-143) tmp = Float64(Float64(Float64(-a) * fma(t, x, Float64(Float64(-b) * i))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); elseif (x <= 3.4e+40) tmp = fma(fma(Float64(-i), y, Float64(c * t)), j, t_1); else tmp = fma(x, fma(Float64(-a), t, Float64(y * z)), Float64(c * fma(Float64(-b), z, Float64(j * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-b) * N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+106], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + t$95$1), $MachinePrecision], If[LessEqual[x, -1.05e-11], N[((-i) * N[(j * y), $MachinePrecision] + N[(b * N[((-c) * z + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.2e-143], N[(N[((-a) * N[(t * x + N[((-b) * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.4e+40], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j + t$95$1), $MachinePrecision], N[(x * N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(c * N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, t\_1\right)\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, b \cdot \mathsf{fma}\left(-c, z, a \cdot i\right)\right)\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-143}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(-b\right) \cdot i\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-i, y, c \cdot t\right), j, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-a, t, y \cdot z\right), c \cdot \mathsf{fma}\left(-b, z, j \cdot t\right)\right)\\
\end{array}
\end{array}
if x < -1.1500000000000001e106Initial program 81.7%
Taylor expanded in j around 0
Applied rewrites89.1%
if -1.1500000000000001e106 < x < -1.0499999999999999e-11Initial program 48.5%
Taylor expanded in c around 0
Applied rewrites65.4%
Taylor expanded in b around inf
Applied rewrites82.3%
if -1.0499999999999999e-11 < x < -3.1999999999999998e-143Initial program 76.1%
Taylor expanded in a around -inf
Applied rewrites66.6%
if -3.1999999999999998e-143 < x < 3.39999999999999989e40Initial program 83.2%
Taylor expanded in x around 0
Applied rewrites85.8%
if 3.39999999999999989e40 < x Initial program 80.6%
Taylor expanded in c around 0
Applied rewrites92.2%
Taylor expanded in i around 0
Applied rewrites86.9%
Final simplification83.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- b) (fma (- a) i (* c z)))))
(if (<= x -1.15e+106)
(fma (fma (- a) t (* z y)) x t_1)
(if (<= x -1.05e-11)
(fma (- i) (* j y) (* b (fma (- c) z (* a i))))
(if (<= x 3.4e+40)
(fma (fma (- i) y (* c t)) j t_1)
(fma x (fma (- a) t (* y z)) (* c (fma (- b) z (* j t)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -b * fma(-a, i, (c * z));
double tmp;
if (x <= -1.15e+106) {
tmp = fma(fma(-a, t, (z * y)), x, t_1);
} else if (x <= -1.05e-11) {
tmp = fma(-i, (j * y), (b * fma(-c, z, (a * i))));
} else if (x <= 3.4e+40) {
tmp = fma(fma(-i, y, (c * t)), j, t_1);
} else {
tmp = fma(x, fma(-a, t, (y * z)), (c * fma(-b, z, (j * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-b) * fma(Float64(-a), i, Float64(c * z))) tmp = 0.0 if (x <= -1.15e+106) tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, t_1); elseif (x <= -1.05e-11) tmp = fma(Float64(-i), Float64(j * y), Float64(b * fma(Float64(-c), z, Float64(a * i)))); elseif (x <= 3.4e+40) tmp = fma(fma(Float64(-i), y, Float64(c * t)), j, t_1); else tmp = fma(x, fma(Float64(-a), t, Float64(y * z)), Float64(c * fma(Float64(-b), z, Float64(j * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-b) * N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+106], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + t$95$1), $MachinePrecision], If[LessEqual[x, -1.05e-11], N[((-i) * N[(j * y), $MachinePrecision] + N[(b * N[((-c) * z + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.4e+40], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j + t$95$1), $MachinePrecision], N[(x * N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(c * N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, t\_1\right)\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, b \cdot \mathsf{fma}\left(-c, z, a \cdot i\right)\right)\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-i, y, c \cdot t\right), j, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-a, t, y \cdot z\right), c \cdot \mathsf{fma}\left(-b, z, j \cdot t\right)\right)\\
\end{array}
\end{array}
if x < -1.1500000000000001e106Initial program 81.7%
Taylor expanded in j around 0
Applied rewrites89.1%
if -1.1500000000000001e106 < x < -1.0499999999999999e-11Initial program 48.5%
Taylor expanded in c around 0
Applied rewrites65.4%
Taylor expanded in b around inf
Applied rewrites82.3%
if -1.0499999999999999e-11 < x < 3.39999999999999989e40Initial program 81.5%
Taylor expanded in x around 0
Applied rewrites78.2%
if 3.39999999999999989e40 < x Initial program 80.6%
Taylor expanded in c around 0
Applied rewrites92.2%
Taylor expanded in i around 0
Applied rewrites86.9%
Final simplification82.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- i) (* j y) (* b (fma (- c) z (* a i))))))
(if (<= x -1.2e+106)
(fma (fma (- a) t (* z y)) x (* (- b) (* c z)))
(if (<= x -8.5e-12)
t_1
(if (<= x -5.6e-182)
(+ (* (- a) (* t x)) (* j (- (* c t) (* i y))))
(if (<= x 4.6e+49)
t_1
(fma x (fma (- a) t (* y z)) (* c (* (- b) z)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, (j * y), (b * fma(-c, z, (a * i))));
double tmp;
if (x <= -1.2e+106) {
tmp = fma(fma(-a, t, (z * y)), x, (-b * (c * z)));
} else if (x <= -8.5e-12) {
tmp = t_1;
} else if (x <= -5.6e-182) {
tmp = (-a * (t * x)) + (j * ((c * t) - (i * y)));
} else if (x <= 4.6e+49) {
tmp = t_1;
} else {
tmp = fma(x, fma(-a, t, (y * z)), (c * (-b * z)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(-i), Float64(j * y), Float64(b * fma(Float64(-c), z, Float64(a * i)))) tmp = 0.0 if (x <= -1.2e+106) tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * Float64(c * z))); elseif (x <= -8.5e-12) tmp = t_1; elseif (x <= -5.6e-182) tmp = Float64(Float64(Float64(-a) * Float64(t * x)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); elseif (x <= 4.6e+49) tmp = t_1; else tmp = fma(x, fma(Float64(-a), t, Float64(y * z)), Float64(c * Float64(Float64(-b) * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-i) * N[(j * y), $MachinePrecision] + N[(b * N[((-c) * z + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+106], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-12], t$95$1, If[LessEqual[x, -5.6e-182], N[(N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.6e+49], t$95$1, N[(x * N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(c * N[((-b) * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j \cdot y, b \cdot \mathsf{fma}\left(-c, z, a \cdot i\right)\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-182}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-a, t, y \cdot z\right), c \cdot \left(\left(-b\right) \cdot z\right)\right)\\
\end{array}
\end{array}
if x < -1.2e106Initial program 81.7%
Taylor expanded in c around 0
Applied rewrites81.7%
Taylor expanded in i around 0
Applied rewrites84.6%
Taylor expanded in y around inf
Applied rewrites64.9%
Taylor expanded in j around 0
Applied rewrites86.8%
if -1.2e106 < x < -8.4999999999999997e-12 or -5.59999999999999986e-182 < x < 4.60000000000000004e49Initial program 75.8%
Taylor expanded in c around 0
Applied rewrites72.6%
Taylor expanded in b around inf
Applied rewrites70.1%
if -8.4999999999999997e-12 < x < -5.59999999999999986e-182Initial program 79.9%
Taylor expanded in t around inf
Applied rewrites64.3%
if 4.60000000000000004e49 < x Initial program 80.6%
Taylor expanded in c around 0
Applied rewrites92.2%
Taylor expanded in i around 0
Applied rewrites86.9%
Taylor expanded in z around inf
Applied rewrites77.5%
Final simplification73.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- i) (* j y) (* b (fma (- c) z (* a i)))))
(t_2 (fma (- a) t (* z y))))
(if (<= x -1.2e+106)
(fma t_2 x (* (- b) (* c z)))
(if (<= x -8.5e-12)
t_1
(if (<= x -5.6e-182)
(+ (* (- a) (* t x)) (* j (- (* c t) (* i y))))
(if (<= x 8.8e+159) t_1 (* t_2 x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, (j * y), (b * fma(-c, z, (a * i))));
double t_2 = fma(-a, t, (z * y));
double tmp;
if (x <= -1.2e+106) {
tmp = fma(t_2, x, (-b * (c * z)));
} else if (x <= -8.5e-12) {
tmp = t_1;
} else if (x <= -5.6e-182) {
tmp = (-a * (t * x)) + (j * ((c * t) - (i * y)));
} else if (x <= 8.8e+159) {
tmp = t_1;
} else {
tmp = t_2 * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(-i), Float64(j * y), Float64(b * fma(Float64(-c), z, Float64(a * i)))) t_2 = fma(Float64(-a), t, Float64(z * y)) tmp = 0.0 if (x <= -1.2e+106) tmp = fma(t_2, x, Float64(Float64(-b) * Float64(c * z))); elseif (x <= -8.5e-12) tmp = t_1; elseif (x <= -5.6e-182) tmp = Float64(Float64(Float64(-a) * Float64(t * x)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); elseif (x <= 8.8e+159) tmp = t_1; else tmp = Float64(t_2 * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-i) * N[(j * y), $MachinePrecision] + N[(b * N[((-c) * z + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+106], N[(t$95$2 * x + N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-12], t$95$1, If[LessEqual[x, -5.6e-182], N[(N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.8e+159], t$95$1, N[(t$95$2 * x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j \cdot y, b \cdot \mathsf{fma}\left(-c, z, a \cdot i\right)\right)\\
t_2 := \mathsf{fma}\left(-a, t, z \cdot y\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, x, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-182}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot x\\
\end{array}
\end{array}
if x < -1.2e106Initial program 81.7%
Taylor expanded in c around 0
Applied rewrites81.7%
Taylor expanded in i around 0
Applied rewrites84.6%
Taylor expanded in y around inf
Applied rewrites64.9%
Taylor expanded in j around 0
Applied rewrites86.8%
if -1.2e106 < x < -8.4999999999999997e-12 or -5.59999999999999986e-182 < x < 8.7999999999999997e159Initial program 76.9%
Taylor expanded in c around 0
Applied rewrites74.8%
Taylor expanded in b around inf
Applied rewrites68.1%
if -8.4999999999999997e-12 < x < -5.59999999999999986e-182Initial program 79.9%
Taylor expanded in t around inf
Applied rewrites64.3%
if 8.7999999999999997e159 < x Initial program 79.2%
Taylor expanded in x around inf
Applied rewrites85.5%
Final simplification72.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- i) (* j y) (* b (fma (- c) z (* a i)))))
(t_2 (fma (- a) t (* z y))))
(if (<= x -1.2e+106)
(fma t_2 x (* (- b) (* c z)))
(if (<= x -1.9e-27)
t_1
(if (<= x -1.5e-181)
(+ (* (* z y) x) (* j (- (* c t) (* i y))))
(if (<= x 8.8e+159) t_1 (* t_2 x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, (j * y), (b * fma(-c, z, (a * i))));
double t_2 = fma(-a, t, (z * y));
double tmp;
if (x <= -1.2e+106) {
tmp = fma(t_2, x, (-b * (c * z)));
} else if (x <= -1.9e-27) {
tmp = t_1;
} else if (x <= -1.5e-181) {
tmp = ((z * y) * x) + (j * ((c * t) - (i * y)));
} else if (x <= 8.8e+159) {
tmp = t_1;
} else {
tmp = t_2 * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(-i), Float64(j * y), Float64(b * fma(Float64(-c), z, Float64(a * i)))) t_2 = fma(Float64(-a), t, Float64(z * y)) tmp = 0.0 if (x <= -1.2e+106) tmp = fma(t_2, x, Float64(Float64(-b) * Float64(c * z))); elseif (x <= -1.9e-27) tmp = t_1; elseif (x <= -1.5e-181) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); elseif (x <= 8.8e+159) tmp = t_1; else tmp = Float64(t_2 * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-i) * N[(j * y), $MachinePrecision] + N[(b * N[((-c) * z + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+106], N[(t$95$2 * x + N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e-27], t$95$1, If[LessEqual[x, -1.5e-181], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.8e+159], t$95$1, N[(t$95$2 * x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j \cdot y, b \cdot \mathsf{fma}\left(-c, z, a \cdot i\right)\right)\\
t_2 := \mathsf{fma}\left(-a, t, z \cdot y\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, x, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-181}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot x\\
\end{array}
\end{array}
if x < -1.2e106Initial program 81.7%
Taylor expanded in c around 0
Applied rewrites81.7%
Taylor expanded in i around 0
Applied rewrites84.6%
Taylor expanded in y around inf
Applied rewrites64.9%
Taylor expanded in j around 0
Applied rewrites86.8%
if -1.2e106 < x < -1.9e-27 or -1.49999999999999987e-181 < x < 8.7999999999999997e159Initial program 76.5%
Taylor expanded in c around 0
Applied rewrites74.6%
Taylor expanded in b around inf
Applied rewrites66.9%
if -1.9e-27 < x < -1.49999999999999987e-181Initial program 82.0%
Taylor expanded in y around inf
Applied rewrites68.5%
if 8.7999999999999997e159 < x Initial program 79.2%
Taylor expanded in x around inf
Applied rewrites85.5%
Final simplification72.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- i) (* j y) (* b (fma (- c) z (* a i)))))
(t_2 (fma (- a) t (* z y))))
(if (<= x -1.2e+106)
(fma t_2 x (* (- b) (* c z)))
(if (<= x -2.3e-27)
t_1
(if (<= x -5.8e-181)
(fma x (* y z) (* c (fma (- b) z (* j t))))
(if (<= x 8.8e+159) t_1 (* t_2 x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, (j * y), (b * fma(-c, z, (a * i))));
double t_2 = fma(-a, t, (z * y));
double tmp;
if (x <= -1.2e+106) {
tmp = fma(t_2, x, (-b * (c * z)));
} else if (x <= -2.3e-27) {
tmp = t_1;
} else if (x <= -5.8e-181) {
tmp = fma(x, (y * z), (c * fma(-b, z, (j * t))));
} else if (x <= 8.8e+159) {
tmp = t_1;
} else {
tmp = t_2 * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(-i), Float64(j * y), Float64(b * fma(Float64(-c), z, Float64(a * i)))) t_2 = fma(Float64(-a), t, Float64(z * y)) tmp = 0.0 if (x <= -1.2e+106) tmp = fma(t_2, x, Float64(Float64(-b) * Float64(c * z))); elseif (x <= -2.3e-27) tmp = t_1; elseif (x <= -5.8e-181) tmp = fma(x, Float64(y * z), Float64(c * fma(Float64(-b), z, Float64(j * t)))); elseif (x <= 8.8e+159) tmp = t_1; else tmp = Float64(t_2 * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-i) * N[(j * y), $MachinePrecision] + N[(b * N[((-c) * z + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+106], N[(t$95$2 * x + N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.3e-27], t$95$1, If[LessEqual[x, -5.8e-181], N[(x * N[(y * z), $MachinePrecision] + N[(c * N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.8e+159], t$95$1, N[(t$95$2 * x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j \cdot y, b \cdot \mathsf{fma}\left(-c, z, a \cdot i\right)\right)\\
t_2 := \mathsf{fma}\left(-a, t, z \cdot y\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, x, \left(-b\right) \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-181}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z, c \cdot \mathsf{fma}\left(-b, z, j \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot x\\
\end{array}
\end{array}
if x < -1.2e106Initial program 81.7%
Taylor expanded in c around 0
Applied rewrites81.7%
Taylor expanded in i around 0
Applied rewrites84.6%
Taylor expanded in y around inf
Applied rewrites64.9%
Taylor expanded in j around 0
Applied rewrites86.8%
if -1.2e106 < x < -2.2999999999999999e-27 or -5.7999999999999996e-181 < x < 8.7999999999999997e159Initial program 76.4%
Taylor expanded in c around 0
Applied rewrites74.4%
Taylor expanded in b around inf
Applied rewrites66.6%
if -2.2999999999999999e-27 < x < -5.7999999999999996e-181Initial program 82.6%
Taylor expanded in c around 0
Applied rewrites70.5%
Taylor expanded in i around 0
Applied rewrites67.9%
Taylor expanded in y around inf
Applied rewrites63.4%
if 8.7999999999999997e159 < x Initial program 79.2%
Taylor expanded in x around inf
Applied rewrites85.5%
Final simplification71.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i a (* (- c) z)) b)) (t_2 (* (fma (- a) t (* z y)) x)))
(if (<= x -1.55e+90)
t_2
(if (<= x -0.54)
t_1
(if (<= x -5.5e-181)
(* (fma (- a) x (* j c)) t)
(if (<= x -1.35e-229)
t_1
(if (<= x 3.1e-25)
(* (fma (- i) y (* c t)) j)
(if (<= x 8e+63) 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 t_1 = fma(i, a, (-c * z)) * b;
double t_2 = fma(-a, t, (z * y)) * x;
double tmp;
if (x <= -1.55e+90) {
tmp = t_2;
} else if (x <= -0.54) {
tmp = t_1;
} else if (x <= -5.5e-181) {
tmp = fma(-a, x, (j * c)) * t;
} else if (x <= -1.35e-229) {
tmp = t_1;
} else if (x <= 3.1e-25) {
tmp = fma(-i, y, (c * t)) * j;
} else if (x <= 8e+63) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, a, Float64(Float64(-c) * z)) * b) t_2 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.55e+90) tmp = t_2; elseif (x <= -0.54) tmp = t_1; elseif (x <= -5.5e-181) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); elseif (x <= -1.35e-229) tmp = t_1; elseif (x <= 3.1e-25) tmp = Float64(fma(Float64(-i), y, Float64(c * t)) * j); elseif (x <= 8e+63) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.55e+90], t$95$2, If[LessEqual[x, -0.54], t$95$1, If[LessEqual[x, -5.5e-181], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[x, -1.35e-229], t$95$1, If[LessEqual[x, 3.1e-25], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[x, 8e+63], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
t_2 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -0.54:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-181}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-229}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-25}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1.54999999999999994e90 or 8.00000000000000046e63 < x Initial program 80.6%
Taylor expanded in x around inf
Applied rewrites75.0%
if -1.54999999999999994e90 < x < -0.54000000000000004 or -5.50000000000000033e-181 < x < -1.3499999999999999e-229 or 3.09999999999999995e-25 < x < 8.00000000000000046e63Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites74.8%
if -0.54000000000000004 < x < -5.50000000000000033e-181Initial program 76.0%
Taylor expanded in t around inf
Applied rewrites56.3%
if -1.3499999999999999e-229 < x < 3.09999999999999995e-25Initial program 79.2%
Taylor expanded in j around inf
Applied rewrites59.0%
Final simplification67.1%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= i -6e+70) (not (<= i 2.15e+169))) (fma (- i) (* j y) (* b (fma (- c) z (* a i)))) (fma x (fma (- a) t (* y z)) (* c (fma (- b) z (* j t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((i <= -6e+70) || !(i <= 2.15e+169)) {
tmp = fma(-i, (j * y), (b * fma(-c, z, (a * i))));
} else {
tmp = fma(x, fma(-a, t, (y * z)), (c * fma(-b, z, (j * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((i <= -6e+70) || !(i <= 2.15e+169)) tmp = fma(Float64(-i), Float64(j * y), Float64(b * fma(Float64(-c), z, Float64(a * i)))); else tmp = fma(x, fma(Float64(-a), t, Float64(y * z)), Float64(c * fma(Float64(-b), z, Float64(j * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[i, -6e+70], N[Not[LessEqual[i, 2.15e+169]], $MachinePrecision]], N[((-i) * N[(j * y), $MachinePrecision] + N[(b * N[((-c) * z + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(c * N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -6 \cdot 10^{+70} \lor \neg \left(i \leq 2.15 \cdot 10^{+169}\right):\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, b \cdot \mathsf{fma}\left(-c, z, a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-a, t, y \cdot z\right), c \cdot \mathsf{fma}\left(-b, z, j \cdot t\right)\right)\\
\end{array}
\end{array}
if i < -5.99999999999999952e70 or 2.1500000000000001e169 < i Initial program 64.8%
Taylor expanded in c around 0
Applied rewrites70.0%
Taylor expanded in b around inf
Applied rewrites82.8%
if -5.99999999999999952e70 < i < 2.1500000000000001e169Initial program 83.8%
Taylor expanded in c around 0
Applied rewrites80.7%
Taylor expanded in i around 0
Applied rewrites73.8%
Final simplification76.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i a (* (- c) z)) b)) (t_2 (* (fma (- a) t (* z y)) x)))
(if (<= x -1.55e+90)
t_2
(if (<= x -0.54)
t_1
(if (<= x -2.9e-62)
(* (fma (- a) x (* j c)) t)
(if (<= x -1.36e-294)
(* (fma j t (* (- b) z)) c)
(if (<= x 8e+63) 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 t_1 = fma(i, a, (-c * z)) * b;
double t_2 = fma(-a, t, (z * y)) * x;
double tmp;
if (x <= -1.55e+90) {
tmp = t_2;
} else if (x <= -0.54) {
tmp = t_1;
} else if (x <= -2.9e-62) {
tmp = fma(-a, x, (j * c)) * t;
} else if (x <= -1.36e-294) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 8e+63) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, a, Float64(Float64(-c) * z)) * b) t_2 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.55e+90) tmp = t_2; elseif (x <= -0.54) tmp = t_1; elseif (x <= -2.9e-62) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); elseif (x <= -1.36e-294) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 8e+63) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.55e+90], t$95$2, If[LessEqual[x, -0.54], t$95$1, If[LessEqual[x, -2.9e-62], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[x, -1.36e-294], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 8e+63], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
t_2 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -0.54:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-62}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{elif}\;x \leq -1.36 \cdot 10^{-294}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1.54999999999999994e90 or 8.00000000000000046e63 < x Initial program 80.6%
Taylor expanded in x around inf
Applied rewrites75.0%
if -1.54999999999999994e90 < x < -0.54000000000000004 or -1.36000000000000003e-294 < x < 8.00000000000000046e63Initial program 76.2%
Taylor expanded in b around inf
Applied rewrites50.6%
if -0.54000000000000004 < x < -2.89999999999999986e-62Initial program 62.4%
Taylor expanded in t around inf
Applied rewrites56.4%
if -2.89999999999999986e-62 < x < -1.36000000000000003e-294Initial program 84.8%
Taylor expanded in c around inf
Applied rewrites64.2%
Final simplification62.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i a (* (- c) z)) b)))
(if (<= x -1.22e+247)
(* (- a) (* t x))
(if (<= x -4.8e+97)
(* (* y x) z)
(if (<= x -3.9e-54)
t_1
(if (<= x -5.8e-182)
(* (* j t) c)
(if (<= x 4.9e+160) t_1 (* (* x z) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(i, a, (-c * z)) * b;
double tmp;
if (x <= -1.22e+247) {
tmp = -a * (t * x);
} else if (x <= -4.8e+97) {
tmp = (y * x) * z;
} else if (x <= -3.9e-54) {
tmp = t_1;
} else if (x <= -5.8e-182) {
tmp = (j * t) * c;
} else if (x <= 4.9e+160) {
tmp = t_1;
} else {
tmp = (x * z) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, a, Float64(Float64(-c) * z)) * b) tmp = 0.0 if (x <= -1.22e+247) tmp = Float64(Float64(-a) * Float64(t * x)); elseif (x <= -4.8e+97) tmp = Float64(Float64(y * x) * z); elseif (x <= -3.9e-54) tmp = t_1; elseif (x <= -5.8e-182) tmp = Float64(Float64(j * t) * c); elseif (x <= 4.9e+160) tmp = t_1; else tmp = Float64(Float64(x * z) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[x, -1.22e+247], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e+97], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, -3.9e-54], t$95$1, If[LessEqual[x, -5.8e-182], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 4.9e+160], t$95$1, N[(N[(x * z), $MachinePrecision] * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;x \leq -1.22 \cdot 10^{+247}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{+97}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;x \leq -3.9 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-182}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot z\right) \cdot y\\
\end{array}
\end{array}
if x < -1.22000000000000006e247Initial program 68.6%
Taylor expanded in c around 0
Applied rewrites81.3%
Taylor expanded in i around 0
Applied rewrites93.8%
Taylor expanded in y around inf
Applied rewrites69.2%
Taylor expanded in a around inf
Applied rewrites68.9%
if -1.22000000000000006e247 < x < -4.8e97Initial program 89.9%
Taylor expanded in t around 0
Applied rewrites64.6%
Taylor expanded in x around inf
Applied rewrites52.5%
Applied rewrites58.8%
if -4.8e97 < x < -3.9e-54 or -5.79999999999999974e-182 < x < 4.9000000000000002e160Initial program 75.6%
Taylor expanded in b around inf
Applied rewrites46.5%
if -3.9e-54 < x < -5.79999999999999974e-182Initial program 88.2%
Taylor expanded in c around inf
Applied rewrites61.9%
Taylor expanded in z around 0
Applied rewrites49.6%
if 4.9000000000000002e160 < x Initial program 79.2%
Taylor expanded in y around inf
Applied rewrites59.4%
Taylor expanded in x around inf
Applied rewrites59.5%
Final simplification51.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) t (* z y)) x)))
(if (<= x -6.6e+84)
t_1
(if (<= x -1.75e-36)
(* (- i) (fma j y (* (- a) b)))
(if (<= x 3.1e-25)
(* (fma (- i) y (* c t)) j)
(if (<= x 8e+63) (* (fma i a (* (- c) z)) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, t, (z * y)) * x;
double tmp;
if (x <= -6.6e+84) {
tmp = t_1;
} else if (x <= -1.75e-36) {
tmp = -i * fma(j, y, (-a * b));
} else if (x <= 3.1e-25) {
tmp = fma(-i, y, (c * t)) * j;
} else if (x <= 8e+63) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -6.6e+84) tmp = t_1; elseif (x <= -1.75e-36) tmp = Float64(Float64(-i) * fma(j, y, Float64(Float64(-a) * b))); elseif (x <= 3.1e-25) tmp = Float64(fma(Float64(-i), y, Float64(c * t)) * j); elseif (x <= 8e+63) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -6.6e+84], t$95$1, If[LessEqual[x, -1.75e-36], N[((-i) * N[(j * y + N[((-a) * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e-25], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[x, 8e+63], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -6.6 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-36}:\\
\;\;\;\;\left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-25}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.60000000000000034e84 or 8.00000000000000046e63 < x Initial program 78.9%
Taylor expanded in x around inf
Applied rewrites74.5%
if -6.60000000000000034e84 < x < -1.75e-36Initial program 54.6%
Taylor expanded in i around -inf
Applied rewrites57.6%
if -1.75e-36 < x < 3.09999999999999995e-25Initial program 81.5%
Taylor expanded in j around inf
Applied rewrites57.0%
if 3.09999999999999995e-25 < x < 8.00000000000000046e63Initial program 99.9%
Taylor expanded in b around inf
Applied rewrites75.5%
Final simplification64.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) t (* z y)) x)))
(if (<= x -6.6e+84)
t_1
(if (<= x -2e-37)
(* (- a) (fma t x (* (- b) i)))
(if (<= x 3.1e-25)
(* (fma (- i) y (* c t)) j)
(if (<= x 8e+63) (* (fma i a (* (- c) z)) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, t, (z * y)) * x;
double tmp;
if (x <= -6.6e+84) {
tmp = t_1;
} else if (x <= -2e-37) {
tmp = -a * fma(t, x, (-b * i));
} else if (x <= 3.1e-25) {
tmp = fma(-i, y, (c * t)) * j;
} else if (x <= 8e+63) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -6.6e+84) tmp = t_1; elseif (x <= -2e-37) tmp = Float64(Float64(-a) * fma(t, x, Float64(Float64(-b) * i))); elseif (x <= 3.1e-25) tmp = Float64(fma(Float64(-i), y, Float64(c * t)) * j); elseif (x <= 8e+63) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -6.6e+84], t$95$1, If[LessEqual[x, -2e-37], N[((-a) * N[(t * x + N[((-b) * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e-25], N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[x, 8e+63], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -6.6 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-37}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(-b\right) \cdot i\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-25}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.60000000000000034e84 or 8.00000000000000046e63 < x Initial program 78.9%
Taylor expanded in x around inf
Applied rewrites74.5%
if -6.60000000000000034e84 < x < -2.00000000000000013e-37Initial program 54.6%
Taylor expanded in a around -inf
Applied rewrites55.4%
if -2.00000000000000013e-37 < x < 3.09999999999999995e-25Initial program 81.5%
Taylor expanded in j around inf
Applied rewrites57.0%
if 3.09999999999999995e-25 < x < 8.00000000000000046e63Initial program 99.9%
Taylor expanded in b around inf
Applied rewrites75.5%
Final simplification64.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i a (* (- c) z)) b)) (t_2 (* (fma (- a) t (* z y)) x)))
(if (<= x -1.55e+90)
t_2
(if (<= x -8e-52)
t_1
(if (<= x -1.36e-294)
(* (fma j t (* (- b) z)) c)
(if (<= x 8e+63) 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 t_1 = fma(i, a, (-c * z)) * b;
double t_2 = fma(-a, t, (z * y)) * x;
double tmp;
if (x <= -1.55e+90) {
tmp = t_2;
} else if (x <= -8e-52) {
tmp = t_1;
} else if (x <= -1.36e-294) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 8e+63) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, a, Float64(Float64(-c) * z)) * b) t_2 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.55e+90) tmp = t_2; elseif (x <= -8e-52) tmp = t_1; elseif (x <= -1.36e-294) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 8e+63) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.55e+90], t$95$2, If[LessEqual[x, -8e-52], t$95$1, If[LessEqual[x, -1.36e-294], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 8e+63], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
t_2 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.36 \cdot 10^{-294}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1.54999999999999994e90 or 8.00000000000000046e63 < x Initial program 80.6%
Taylor expanded in x around inf
Applied rewrites75.0%
if -1.54999999999999994e90 < x < -8.0000000000000001e-52 or -1.36000000000000003e-294 < x < 8.00000000000000046e63Initial program 73.5%
Taylor expanded in b around inf
Applied rewrites47.2%
if -8.0000000000000001e-52 < x < -1.36000000000000003e-294Initial program 85.4%
Taylor expanded in c around inf
Applied rewrites63.7%
Final simplification60.9%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= a -3.2e+70)
(* (- a) (fma t x (* (- b) i)))
(if (<= a 1.86e+80)
(fma x (* y z) (* c (fma (- b) z (* j t))))
(* (- a) (- (* t x) (* b i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -3.2e+70) {
tmp = -a * fma(t, x, (-b * i));
} else if (a <= 1.86e+80) {
tmp = fma(x, (y * z), (c * fma(-b, z, (j * t))));
} else {
tmp = -a * ((t * x) - (b * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -3.2e+70) tmp = Float64(Float64(-a) * fma(t, x, Float64(Float64(-b) * i))); elseif (a <= 1.86e+80) tmp = fma(x, Float64(y * z), Float64(c * fma(Float64(-b), z, Float64(j * t)))); else tmp = Float64(Float64(-a) * Float64(Float64(t * x) - Float64(b * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -3.2e+70], N[((-a) * N[(t * x + N[((-b) * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.86e+80], N[(x * N[(y * z), $MachinePrecision] + N[(c * N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+70}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(-b\right) \cdot i\right)\\
\mathbf{elif}\;a \leq 1.86 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z, c \cdot \mathsf{fma}\left(-b, z, j \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x - b \cdot i\right)\\
\end{array}
\end{array}
if a < -3.2000000000000002e70Initial program 69.3%
Taylor expanded in a around -inf
Applied rewrites76.5%
if -3.2000000000000002e70 < a < 1.8599999999999999e80Initial program 83.2%
Taylor expanded in c around 0
Applied rewrites79.1%
Taylor expanded in i around 0
Applied rewrites70.6%
Taylor expanded in y around inf
Applied rewrites65.0%
if 1.8599999999999999e80 < a Initial program 69.9%
Taylor expanded in c around 0
Applied rewrites71.8%
Taylor expanded in j around -inf
Applied rewrites74.2%
Taylor expanded in a around -inf
Applied rewrites66.7%
Final simplification67.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma y x (* (- b) c)) z)))
(if (<= x -7.5e+45)
t_1
(if (<= x -1.36e-294)
(* (fma j t (* (- b) z)) c)
(if (<= x 5.1e+45) (* (fma i a (* (- c) z)) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(y, x, (-b * c)) * z;
double tmp;
if (x <= -7.5e+45) {
tmp = t_1;
} else if (x <= -1.36e-294) {
tmp = fma(j, t, (-b * z)) * c;
} else if (x <= 5.1e+45) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(y, x, Float64(Float64(-b) * c)) * z) tmp = 0.0 if (x <= -7.5e+45) tmp = t_1; elseif (x <= -1.36e-294) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (x <= 5.1e+45) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[x, -7.5e+45], t$95$1, If[LessEqual[x, -1.36e-294], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 5.1e+45], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.36 \cdot 10^{-294}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.50000000000000058e45 or 5.0999999999999997e45 < x Initial program 78.9%
Taylor expanded in z around inf
Applied rewrites59.2%
if -7.50000000000000058e45 < x < -1.36000000000000003e-294Initial program 73.8%
Taylor expanded in c around inf
Applied rewrites51.3%
if -1.36000000000000003e-294 < x < 5.0999999999999997e45Initial program 82.0%
Taylor expanded in b around inf
Applied rewrites47.0%
Final simplification53.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma j t (* (- b) z)) c)))
(if (<= c -1.06e-169)
t_1
(if (<= c 3.4e-206)
(* (* x z) y)
(if (<= c 4.6e+130) (* (fma i a (* (- c) z)) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(j, t, (-b * z)) * c;
double tmp;
if (c <= -1.06e-169) {
tmp = t_1;
} else if (c <= 3.4e-206) {
tmp = (x * z) * y;
} else if (c <= 4.6e+130) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(j, t, Float64(Float64(-b) * z)) * c) tmp = 0.0 if (c <= -1.06e-169) tmp = t_1; elseif (c <= 3.4e-206) tmp = Float64(Float64(x * z) * y); elseif (c <= 4.6e+130) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -1.06e-169], t$95$1, If[LessEqual[c, 3.4e-206], N[(N[(x * z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[c, 4.6e+130], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{if}\;c \leq -1.06 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 3.4 \cdot 10^{-206}:\\
\;\;\;\;\left(x \cdot z\right) \cdot y\\
\mathbf{elif}\;c \leq 4.6 \cdot 10^{+130}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.06e-169 or 4.60000000000000042e130 < c Initial program 71.5%
Taylor expanded in c around inf
Applied rewrites55.1%
if -1.06e-169 < c < 3.39999999999999985e-206Initial program 90.5%
Taylor expanded in y around inf
Applied rewrites57.0%
Taylor expanded in x around inf
Applied rewrites41.7%
if 3.39999999999999985e-206 < c < 4.60000000000000042e130Initial program 82.1%
Taylor expanded in b around inf
Applied rewrites48.7%
Final simplification50.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -1.22e+247)
(* (- a) (* t x))
(if (<= x -6.6e+84)
(* (* y x) z)
(if (<= x -1.75e-36)
(* a (* b i))
(if (<= x 5.2e+14) (* (* j t) c) (* (* x z) y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -1.22e+247) {
tmp = -a * (t * x);
} else if (x <= -6.6e+84) {
tmp = (y * x) * z;
} else if (x <= -1.75e-36) {
tmp = a * (b * i);
} else if (x <= 5.2e+14) {
tmp = (j * t) * c;
} else {
tmp = (x * z) * y;
}
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)
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) :: tmp
if (x <= (-1.22d+247)) then
tmp = -a * (t * x)
else if (x <= (-6.6d+84)) then
tmp = (y * x) * z
else if (x <= (-1.75d-36)) then
tmp = a * (b * i)
else if (x <= 5.2d+14) then
tmp = (j * t) * c
else
tmp = (x * z) * y
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 tmp;
if (x <= -1.22e+247) {
tmp = -a * (t * x);
} else if (x <= -6.6e+84) {
tmp = (y * x) * z;
} else if (x <= -1.75e-36) {
tmp = a * (b * i);
} else if (x <= 5.2e+14) {
tmp = (j * t) * c;
} else {
tmp = (x * z) * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -1.22e+247: tmp = -a * (t * x) elif x <= -6.6e+84: tmp = (y * x) * z elif x <= -1.75e-36: tmp = a * (b * i) elif x <= 5.2e+14: tmp = (j * t) * c else: tmp = (x * z) * y return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -1.22e+247) tmp = Float64(Float64(-a) * Float64(t * x)); elseif (x <= -6.6e+84) tmp = Float64(Float64(y * x) * z); elseif (x <= -1.75e-36) tmp = Float64(a * Float64(b * i)); elseif (x <= 5.2e+14) tmp = Float64(Float64(j * t) * c); else tmp = Float64(Float64(x * z) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -1.22e+247) tmp = -a * (t * x); elseif (x <= -6.6e+84) tmp = (y * x) * z; elseif (x <= -1.75e-36) tmp = a * (b * i); elseif (x <= 5.2e+14) tmp = (j * t) * c; else tmp = (x * z) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -1.22e+247], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.6e+84], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, -1.75e-36], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+14], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], N[(N[(x * z), $MachinePrecision] * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.22 \cdot 10^{+247}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{+84}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-36}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+14}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot z\right) \cdot y\\
\end{array}
\end{array}
if x < -1.22000000000000006e247Initial program 68.6%
Taylor expanded in c around 0
Applied rewrites81.3%
Taylor expanded in i around 0
Applied rewrites93.8%
Taylor expanded in y around inf
Applied rewrites69.2%
Taylor expanded in a around inf
Applied rewrites68.9%
if -1.22000000000000006e247 < x < -6.60000000000000034e84Initial program 81.9%
Taylor expanded in t around 0
Applied rewrites58.9%
Taylor expanded in x around inf
Applied rewrites50.9%
Applied rewrites56.7%
if -6.60000000000000034e84 < x < -1.75e-36Initial program 54.6%
Taylor expanded in t around 0
Applied rewrites57.8%
Taylor expanded in a around inf
Applied rewrites38.3%
if -1.75e-36 < x < 5.2e14Initial program 81.9%
Taylor expanded in c around inf
Applied rewrites50.0%
Taylor expanded in z around 0
Applied rewrites36.9%
if 5.2e14 < x Initial program 83.2%
Taylor expanded in y around inf
Applied rewrites51.2%
Taylor expanded in x around inf
Applied rewrites44.6%
Final simplification43.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* x z) y)))
(if (<= x -6.5e+84)
t_1
(if (<= x -1.75e-36)
(* a (* b i))
(if (<= x 5.2e+14) (* (* j t) c) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (x * z) * y;
double tmp;
if (x <= -6.5e+84) {
tmp = t_1;
} else if (x <= -1.75e-36) {
tmp = a * (b * i);
} else if (x <= 5.2e+14) {
tmp = (j * t) * c;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = (x * z) * y
if (x <= (-6.5d+84)) then
tmp = t_1
else if (x <= (-1.75d-36)) then
tmp = a * (b * i)
else if (x <= 5.2d+14) then
tmp = (j * t) * c
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (x * z) * y;
double tmp;
if (x <= -6.5e+84) {
tmp = t_1;
} else if (x <= -1.75e-36) {
tmp = a * (b * i);
} else if (x <= 5.2e+14) {
tmp = (j * t) * c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (x * z) * y tmp = 0 if x <= -6.5e+84: tmp = t_1 elif x <= -1.75e-36: tmp = a * (b * i) elif x <= 5.2e+14: tmp = (j * t) * c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * z) * y) tmp = 0.0 if (x <= -6.5e+84) tmp = t_1; elseif (x <= -1.75e-36) tmp = Float64(a * Float64(b * i)); elseif (x <= 5.2e+14) tmp = Float64(Float64(j * t) * c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (x * z) * y; tmp = 0.0; if (x <= -6.5e+84) tmp = t_1; elseif (x <= -1.75e-36) tmp = a * (b * i); elseif (x <= 5.2e+14) tmp = (j * t) * c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(x * z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[x, -6.5e+84], t$95$1, If[LessEqual[x, -1.75e-36], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+14], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot z\right) \cdot y\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-36}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+14}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.50000000000000027e84 or 5.2e14 < x Initial program 80.7%
Taylor expanded in y around inf
Applied rewrites52.8%
Taylor expanded in x around inf
Applied rewrites46.6%
if -6.50000000000000027e84 < x < -1.75e-36Initial program 54.6%
Taylor expanded in t around 0
Applied rewrites57.8%
Taylor expanded in a around inf
Applied rewrites38.3%
if -1.75e-36 < x < 5.2e14Initial program 81.9%
Taylor expanded in c around inf
Applied rewrites50.0%
Taylor expanded in z around 0
Applied rewrites36.9%
Final simplification41.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -6.6e+84)
(* (* y x) z)
(if (<= x -1.75e-36)
(* a (* b i))
(if (<= x 5.2e+14) (* (* j t) c) (* x (* y z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -6.6e+84) {
tmp = (y * x) * z;
} else if (x <= -1.75e-36) {
tmp = a * (b * i);
} else if (x <= 5.2e+14) {
tmp = (j * t) * c;
} else {
tmp = x * (y * z);
}
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)
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) :: tmp
if (x <= (-6.6d+84)) then
tmp = (y * x) * z
else if (x <= (-1.75d-36)) then
tmp = a * (b * i)
else if (x <= 5.2d+14) then
tmp = (j * t) * c
else
tmp = x * (y * z)
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 tmp;
if (x <= -6.6e+84) {
tmp = (y * x) * z;
} else if (x <= -1.75e-36) {
tmp = a * (b * i);
} else if (x <= 5.2e+14) {
tmp = (j * t) * c;
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -6.6e+84: tmp = (y * x) * z elif x <= -1.75e-36: tmp = a * (b * i) elif x <= 5.2e+14: tmp = (j * t) * c else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -6.6e+84) tmp = Float64(Float64(y * x) * z); elseif (x <= -1.75e-36) tmp = Float64(a * Float64(b * i)); elseif (x <= 5.2e+14) tmp = Float64(Float64(j * t) * c); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -6.6e+84) tmp = (y * x) * z; elseif (x <= -1.75e-36) tmp = a * (b * i); elseif (x <= 5.2e+14) tmp = (j * t) * c; else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -6.6e+84], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, -1.75e-36], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+14], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+84}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-36}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+14}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if x < -6.60000000000000034e84Initial program 77.6%
Taylor expanded in t around 0
Applied rewrites58.6%
Taylor expanded in x around inf
Applied rewrites43.1%
Applied rewrites46.9%
if -6.60000000000000034e84 < x < -1.75e-36Initial program 54.6%
Taylor expanded in t around 0
Applied rewrites57.8%
Taylor expanded in a around inf
Applied rewrites38.3%
if -1.75e-36 < x < 5.2e14Initial program 81.9%
Taylor expanded in c around inf
Applied rewrites50.0%
Taylor expanded in z around 0
Applied rewrites36.9%
if 5.2e14 < x Initial program 83.2%
Taylor expanded in t around 0
Applied rewrites62.3%
Taylor expanded in x around inf
Applied rewrites43.0%
Final simplification40.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= a -1.7e+70) (not (<= a 1.1e-23))) (* a (* b i)) (* x (* y z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((a <= -1.7e+70) || !(a <= 1.1e-23)) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
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)
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) :: tmp
if ((a <= (-1.7d+70)) .or. (.not. (a <= 1.1d-23))) then
tmp = a * (b * i)
else
tmp = x * (y * z)
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 tmp;
if ((a <= -1.7e+70) || !(a <= 1.1e-23)) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (a <= -1.7e+70) or not (a <= 1.1e-23): tmp = a * (b * i) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((a <= -1.7e+70) || !(a <= 1.1e-23)) tmp = Float64(a * Float64(b * i)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((a <= -1.7e+70) || ~((a <= 1.1e-23))) tmp = a * (b * i); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[a, -1.7e+70], N[Not[LessEqual[a, 1.1e-23]], $MachinePrecision]], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+70} \lor \neg \left(a \leq 1.1 \cdot 10^{-23}\right):\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if a < -1.7e70 or 1.1e-23 < a Initial program 72.2%
Taylor expanded in t around 0
Applied rewrites56.3%
Taylor expanded in a around inf
Applied rewrites39.9%
if -1.7e70 < a < 1.1e-23Initial program 83.3%
Taylor expanded in t around 0
Applied rewrites60.8%
Taylor expanded in x around inf
Applied rewrites30.0%
Final simplification34.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= x -6.6e+84) (* (* y x) z) (if (<= x 8e+63) (* (* a i) b) (* x (* y z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -6.6e+84) {
tmp = (y * x) * z;
} else if (x <= 8e+63) {
tmp = (a * i) * b;
} else {
tmp = x * (y * z);
}
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)
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) :: tmp
if (x <= (-6.6d+84)) then
tmp = (y * x) * z
else if (x <= 8d+63) then
tmp = (a * i) * b
else
tmp = x * (y * z)
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 tmp;
if (x <= -6.6e+84) {
tmp = (y * x) * z;
} else if (x <= 8e+63) {
tmp = (a * i) * b;
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -6.6e+84: tmp = (y * x) * z elif x <= 8e+63: tmp = (a * i) * b else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -6.6e+84) tmp = Float64(Float64(y * x) * z); elseif (x <= 8e+63) tmp = Float64(Float64(a * i) * b); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -6.6e+84) tmp = (y * x) * z; elseif (x <= 8e+63) tmp = (a * i) * b; else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -6.6e+84], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, 8e+63], N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+84}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+63}:\\
\;\;\;\;\left(a \cdot i\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if x < -6.60000000000000034e84Initial program 77.6%
Taylor expanded in t around 0
Applied rewrites58.6%
Taylor expanded in x around inf
Applied rewrites43.1%
Applied rewrites46.9%
if -6.60000000000000034e84 < x < 8.00000000000000046e63Initial program 78.0%
Taylor expanded in b around inf
Applied rewrites43.1%
Taylor expanded in z around 0
Applied rewrites28.0%
if 8.00000000000000046e63 < x Initial program 80.3%
Taylor expanded in t around 0
Applied rewrites59.5%
Taylor expanded in x around inf
Applied rewrites46.4%
Final simplification35.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= x -6.6e+84) (* (* y x) z) (if (<= x 8e+63) (* a (* b i)) (* x (* y z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -6.6e+84) {
tmp = (y * x) * z;
} else if (x <= 8e+63) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
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)
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) :: tmp
if (x <= (-6.6d+84)) then
tmp = (y * x) * z
else if (x <= 8d+63) then
tmp = a * (b * i)
else
tmp = x * (y * z)
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 tmp;
if (x <= -6.6e+84) {
tmp = (y * x) * z;
} else if (x <= 8e+63) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -6.6e+84: tmp = (y * x) * z elif x <= 8e+63: tmp = a * (b * i) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -6.6e+84) tmp = Float64(Float64(y * x) * z); elseif (x <= 8e+63) tmp = Float64(a * Float64(b * i)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -6.6e+84) tmp = (y * x) * z; elseif (x <= 8e+63) tmp = a * (b * i); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -6.6e+84], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, 8e+63], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+84}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+63}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if x < -6.60000000000000034e84Initial program 77.6%
Taylor expanded in t around 0
Applied rewrites58.6%
Taylor expanded in x around inf
Applied rewrites43.1%
Applied rewrites46.9%
if -6.60000000000000034e84 < x < 8.00000000000000046e63Initial program 78.0%
Taylor expanded in t around 0
Applied rewrites58.6%
Taylor expanded in a around inf
Applied rewrites27.4%
if 8.00000000000000046e63 < x Initial program 80.3%
Taylor expanded in t around 0
Applied rewrites59.5%
Taylor expanded in x around inf
Applied rewrites46.4%
Final simplification34.9%
(FPCore (x y z t a b c i j) :precision binary64 (* a (* b i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (b * i);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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
code = a * (b * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (b * i);
}
def code(x, y, z, t, a, b, c, i, j): return a * (b * i)
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(b * i)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * (b * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(b \cdot i\right)
\end{array}
Initial program 78.4%
Taylor expanded in t around 0
Applied rewrites58.8%
Taylor expanded in a around inf
Applied rewrites22.1%
Final simplification22.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(/
(* j (- (pow (* c t) 2.0) (pow (* i y) 2.0)))
(+ (* c t) (* i y)))))
(t_2
(-
(* x (- (* z y) (* a t)))
(- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))
(if (< t -8.120978919195912e-33)
t_2
(if (< t -4.712553818218485e-169)
t_1
(if (< t -7.633533346031584e-308)
t_2
(if (< t 1.0535888557455487e-139) 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 t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (pow((c * t), 2.0) - pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ** 2.0d0) - ((i * y) ** 2.0d0))) / ((c * t) + (i * y)))
t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
if (t < (-8.120978919195912d-33)) then
tmp = t_2
else if (t < (-4.712553818218485d-169)) then
tmp = t_1
else if (t < (-7.633533346031584d-308)) then
tmp = t_2
else if (t < 1.0535888557455487d-139) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (Math.pow((c * t), 2.0) - Math.pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (math.pow((c * t), 2.0) - math.pow((i * y), 2.0))) / ((c * t) + (i * y))) t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)) tmp = 0 if t < -8.120978919195912e-33: tmp = t_2 elif t < -4.712553818218485e-169: tmp = t_1 elif t < -7.633533346031584e-308: tmp = t_2 elif t < 1.0535888557455487e-139: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(Float64(j * Float64((Float64(c * t) ^ 2.0) - (Float64(i * y) ^ 2.0))) / Float64(Float64(c * t) + Float64(i * y)))) t_2 = Float64(Float64(x * Float64(Float64(z * y) - Float64(a * t))) - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) - Float64(Float64(Float64(c * t) - Float64(y * i)) * j))) tmp = 0.0 if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ^ 2.0) - ((i * y) ^ 2.0))) / ((c * t) + (i * y))); t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)); tmp = 0.0; if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(j * N[(N[Power[N[(c * t), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(i * y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * t), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -8.120978919195912e-33], t$95$2, If[Less[t, -4.712553818218485e-169], t$95$1, If[Less[t, -7.633533346031584e-308], t$95$2, If[Less[t, 1.0535888557455487e-139], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\
t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\
\mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025026
(FPCore (x y z t a b c i j)
:name "Linear.Matrix:det33 from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1015122364899489/125000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -942510763643697/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -238547917063487/3125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 10535888557455487/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))