
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c)) (* (* x 4) i)) (* (* j 27) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c)) (* (* x 4) i)) (* (* j 27) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* x 4) i)) (t_2 (* (* j 27) k)))
(if (<=
(-
(-
(+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c))
t_1)
t_2)
INFINITY)
(- (- (- (* c b) (* (- (* 4 a) (* z (* y (* 18 x)))) t)) t_1) t_2)
(* (- (* -4 a) (* (* (* z y) x) -18)) t))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (x * 4.0) * i;
double t_2 = (j * 27.0) * k;
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - t_1) - t_2) <= ((double) INFINITY)) {
tmp = (((c * b) - (((4.0 * a) - (z * (y * (18.0 * x)))) * t)) - t_1) - t_2;
} else {
tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (x * 4.0) * i;
double t_2 = (j * 27.0) * k;
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - t_1) - t_2) <= Double.POSITIVE_INFINITY) {
tmp = (((c * b) - (((4.0 * a) - (z * (y * (18.0 * x)))) * t)) - t_1) - t_2;
} else {
tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (x * 4.0) * i t_2 = (j * 27.0) * k tmp = 0 if ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - t_1) - t_2) <= math.inf: tmp = (((c * b) - (((4.0 * a) - (z * (y * (18.0 * x)))) * t)) - t_1) - t_2 else: tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(x * 4.0) * i) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - t_1) - t_2) <= Inf) tmp = Float64(Float64(Float64(Float64(c * b) - Float64(Float64(Float64(4.0 * a) - Float64(z * Float64(y * Float64(18.0 * x)))) * t)) - t_1) - t_2); else tmp = Float64(Float64(Float64(-4.0 * a) - Float64(Float64(Float64(z * y) * x) * -18.0)) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (x * 4.0) * i; t_2 = (j * 27.0) * k; tmp = 0.0; if (((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - t_1) - t_2) <= Inf) tmp = (((c * b) - (((4.0 * a) - (z * (y * (18.0 * x)))) * t)) - t_1) - t_2; else tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], Infinity], N[(N[(N[(N[(c * b), $MachinePrecision] - N[(N[(N[(4 * a), $MachinePrecision] - N[(z * N[(y * N[(18 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(N[(-4 * a), $MachinePrecision] - N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * -18), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(x \cdot 4\right) \cdot i\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - t\_1\right) - t\_2 \leq \infty:\\
\;\;\;\;\left(\left(c \cdot b - \left(4 \cdot a - z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right) \cdot t\right) - t\_1\right) - t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot a - \left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t\\
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 85.6%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites87.4%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
Applied rewrites42.2%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c))
(* (* x 4) i))
INFINITY)
(-
(-
(* c b)
(- (* x (- (* i 4) (* (* (* y 18) t) z))) (* (* -4 a) t)))
(* (* j 27) k))
(* (- (* -4 a) (* (* (* z y) x) -18)) t)))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= ((double) INFINITY)) {
tmp = ((c * b) - ((x * ((i * 4.0) - (((y * 18.0) * t) * z))) - ((-4.0 * a) * t))) - ((j * 27.0) * k);
} else {
tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= Double.POSITIVE_INFINITY) {
tmp = ((c * b) - ((x * ((i * 4.0) - (((y * 18.0) * t) * z))) - ((-4.0 * a) * t))) - ((j * 27.0) * k);
} else {
tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= math.inf: tmp = ((c * b) - ((x * ((i * 4.0) - (((y * 18.0) * t) * z))) - ((-4.0 * a) * t))) - ((j * 27.0) * k) else: tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t return tmp
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) <= Inf) tmp = Float64(Float64(Float64(c * b) - Float64(Float64(x * Float64(Float64(i * 4.0) - Float64(Float64(Float64(y * 18.0) * t) * z))) - Float64(Float64(-4.0 * a) * t))) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(Float64(-4.0 * a) - Float64(Float64(Float64(z * y) * x) * -18.0)) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0; if ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= Inf) tmp = ((c * b) - ((x * ((i * 4.0) - (((y * 18.0) * t) * z))) - ((-4.0 * a) * t))) - ((j * 27.0) * k); else tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(x * 18), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(c * b), $MachinePrecision] - N[(N[(x * N[(N[(i * 4), $MachinePrecision] - N[(N[(N[(y * 18), $MachinePrecision] * t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(-4 * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4 * a), $MachinePrecision] - N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * -18), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq \infty:\\
\;\;\;\;\left(c \cdot b - \left(x \cdot \left(i \cdot 4 - \left(\left(y \cdot 18\right) \cdot t\right) \cdot z\right) - \left(-4 \cdot a\right) \cdot t\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot a - \left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t\\
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < +inf.0Initial program 85.6%
lift--.f64N/A
sub-negate-revN/A
lift-+.f64N/A
associate--r+N/A
sub-negateN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--r+N/A
Applied rewrites87.3%
if +inf.0 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
Applied rewrites42.2%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27) k)) (t_2 (* (* x 4) i)))
(if (<=
y
-5742252960529749/110427941548649020598956093796432407239217743554726184882600387580788736)
(- (- (+ (* 18 (* (* (* t x) z) y)) (* b c)) t_2) t_1)
(if (<= y 499999999999999972787615493521408)
(- (- (+ (* -4 (* a t)) (* b c)) t_2) t_1)
(- (- (+ (* 18 (* (* y t) (* z x))) (* b c)) t_2) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * 4.0) * i;
double tmp;
if (y <= -5.2e-56) {
tmp = (((18.0 * (((t * x) * z) * y)) + (b * c)) - t_2) - t_1;
} else if (y <= 5e+32) {
tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1;
} else {
tmp = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (x * 4.0d0) * i
if (y <= (-5.2d-56)) then
tmp = (((18.0d0 * (((t * x) * z) * y)) + (b * c)) - t_2) - t_1
else if (y <= 5d+32) then
tmp = ((((-4.0d0) * (a * t)) + (b * c)) - t_2) - t_1
else
tmp = (((18.0d0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * 4.0) * i;
double tmp;
if (y <= -5.2e-56) {
tmp = (((18.0 * (((t * x) * z) * y)) + (b * c)) - t_2) - t_1;
} else if (y <= 5e+32) {
tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1;
} else {
tmp = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (x * 4.0) * i tmp = 0 if y <= -5.2e-56: tmp = (((18.0 * (((t * x) * z) * y)) + (b * c)) - t_2) - t_1 elif y <= 5e+32: tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1 else: tmp = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(x * 4.0) * i) tmp = 0.0 if (y <= -5.2e-56) tmp = Float64(Float64(Float64(Float64(18.0 * Float64(Float64(Float64(t * x) * z) * y)) + Float64(b * c)) - t_2) - t_1); elseif (y <= 5e+32) tmp = Float64(Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b * c)) - t_2) - t_1); else tmp = Float64(Float64(Float64(Float64(18.0 * Float64(Float64(y * t) * Float64(z * x))) + Float64(b * c)) - t_2) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (j * 27.0) * k; t_2 = (x * 4.0) * i; tmp = 0.0; if (y <= -5.2e-56) tmp = (((18.0 * (((t * x) * z) * y)) + (b * c)) - t_2) - t_1; elseif (y <= 5e+32) tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1; else tmp = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[y, -5742252960529749/110427941548649020598956093796432407239217743554726184882600387580788736], N[(N[(N[(N[(18 * N[(N[(N[(t * x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[y, 499999999999999972787615493521408], N[(N[(N[(N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(N[(18 * N[(N[(y * t), $MachinePrecision] * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(x \cdot 4\right) \cdot i\\
\mathbf{if}\;y \leq \frac{-5742252960529749}{110427941548649020598956093796432407239217743554726184882600387580788736}:\\
\;\;\;\;\left(\left(18 \cdot \left(\left(\left(t \cdot x\right) \cdot z\right) \cdot y\right) + b \cdot c\right) - t\_2\right) - t\_1\\
\mathbf{elif}\;y \leq 499999999999999972787615493521408:\\
\;\;\;\;\left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - t\_2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(z \cdot x\right)\right) + b \cdot c\right) - t\_2\right) - t\_1\\
\end{array}
if y < -5.1999999999999999e-56Initial program 85.6%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.0%
Applied rewrites72.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6474.3%
Applied rewrites74.3%
if -5.1999999999999999e-56 < y < 4.9999999999999997e32Initial program 85.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6476.9%
Applied rewrites76.9%
if 4.9999999999999997e32 < y Initial program 85.6%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.0%
Applied rewrites72.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6474.3%
Applied rewrites74.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.8%
Applied rewrites72.8%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27) k))
(t_2 (* (* x 4) i))
(t_3 (- (- (+ (* 18 (* (* y t) (* z x))) (* b c)) t_2) t_1)))
(if (<=
y
-2845706385096283/237142198758023568227473377297792835283496928595231875152809132048206089502588928)
t_3
(if (<= y 499999999999999972787615493521408)
(- (- (+ (* -4 (* a t)) (* b c)) t_2) t_1)
t_3))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * 4.0) * i;
double t_3 = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1;
double tmp;
if (y <= -1.2e-65) {
tmp = t_3;
} else if (y <= 5e+32) {
tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1;
} else {
tmp = t_3;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (x * 4.0d0) * i
t_3 = (((18.0d0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1
if (y <= (-1.2d-65)) then
tmp = t_3
else if (y <= 5d+32) then
tmp = ((((-4.0d0) * (a * t)) + (b * c)) - t_2) - t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * 4.0) * i;
double t_3 = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1;
double tmp;
if (y <= -1.2e-65) {
tmp = t_3;
} else if (y <= 5e+32) {
tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (x * 4.0) * i t_3 = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1 tmp = 0 if y <= -1.2e-65: tmp = t_3 elif y <= 5e+32: tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(x * 4.0) * i) t_3 = Float64(Float64(Float64(Float64(18.0 * Float64(Float64(y * t) * Float64(z * x))) + Float64(b * c)) - t_2) - t_1) tmp = 0.0 if (y <= -1.2e-65) tmp = t_3; elseif (y <= 5e+32) tmp = Float64(Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b * c)) - t_2) - t_1); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (j * 27.0) * k; t_2 = (x * 4.0) * i; t_3 = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1; tmp = 0.0; if (y <= -1.2e-65) tmp = t_3; elseif (y <= 5e+32) tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(18 * N[(N[(y * t), $MachinePrecision] * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[y, -2845706385096283/237142198758023568227473377297792835283496928595231875152809132048206089502588928], t$95$3, If[LessEqual[y, 499999999999999972787615493521408], N[(N[(N[(N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(x \cdot 4\right) \cdot i\\
t_3 := \left(\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(z \cdot x\right)\right) + b \cdot c\right) - t\_2\right) - t\_1\\
\mathbf{if}\;y \leq \frac{-2845706385096283}{237142198758023568227473377297792835283496928595231875152809132048206089502588928}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 499999999999999972787615493521408:\\
\;\;\;\;\left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - t\_2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if y < -1.2000000000000001e-65 or 4.9999999999999997e32 < y Initial program 85.6%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.0%
Applied rewrites72.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6474.3%
Applied rewrites74.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.8%
Applied rewrites72.8%
if -1.2000000000000001e-65 < y < 4.9999999999999997e32Initial program 85.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6476.9%
Applied rewrites76.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27) k))
(t_2 (- (- (+ (* -4 (* a t)) (* b c)) (* (* x 4) i)) t_1)))
(if (<=
i
-5699856385590521/2923003274661805836407369665432566039311865085952)
t_2
(if (<= i 165000000000000006632430067329163597803683840)
(- (- (* c b) (* t (- (* -18 (* x (* y z))) (* -4 a)))) t_1)
t_2))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1;
double tmp;
if (i <= -1.95e-33) {
tmp = t_2;
} else if (i <= 1.65e+44) {
tmp = ((c * b) - (t * ((-18.0 * (x * (y * z))) - (-4.0 * a)))) - 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, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = ((((-4.0d0) * (a * t)) + (b * c)) - ((x * 4.0d0) * i)) - t_1
if (i <= (-1.95d-33)) then
tmp = t_2
else if (i <= 1.65d+44) then
tmp = ((c * b) - (t * (((-18.0d0) * (x * (y * z))) - ((-4.0d0) * a)))) - 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 k) {
double t_1 = (j * 27.0) * k;
double t_2 = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1;
double tmp;
if (i <= -1.95e-33) {
tmp = t_2;
} else if (i <= 1.65e+44) {
tmp = ((c * b) - (t * ((-18.0 * (x * (y * z))) - (-4.0 * a)))) - t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1 tmp = 0 if i <= -1.95e-33: tmp = t_2 elif i <= 1.65e+44: tmp = ((c * b) - (t * ((-18.0 * (x * (y * z))) - (-4.0 * a)))) - t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1) tmp = 0.0 if (i <= -1.95e-33) tmp = t_2; elseif (i <= 1.65e+44) tmp = Float64(Float64(Float64(c * b) - Float64(t * Float64(Float64(-18.0 * Float64(x * Float64(y * z))) - Float64(-4.0 * a)))) - t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (j * 27.0) * k; t_2 = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1; tmp = 0.0; if (i <= -1.95e-33) tmp = t_2; elseif (i <= 1.65e+44) tmp = ((c * b) - (t * ((-18.0 * (x * (y * z))) - (-4.0 * a)))) - t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[i, -5699856385590521/2923003274661805836407369665432566039311865085952], t$95$2, If[LessEqual[i, 165000000000000006632430067329163597803683840], N[(N[(N[(c * b), $MachinePrecision] - N[(t * N[(N[(-18 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-4 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\
\mathbf{if}\;i \leq \frac{-5699856385590521}{2923003274661805836407369665432566039311865085952}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq 165000000000000006632430067329163597803683840:\\
\;\;\;\;\left(c \cdot b - t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if i < -1.9499999999999999e-33 or 1.6500000000000001e44 < i Initial program 85.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6476.9%
Applied rewrites76.9%
if -1.9499999999999999e-33 < i < 1.6500000000000001e44Initial program 85.6%
lift--.f64N/A
sub-negate-revN/A
lift-+.f64N/A
associate--r+N/A
sub-negateN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--r+N/A
Applied rewrites87.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6475.3%
Applied rewrites75.3%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27) k)))
(if (<=
z
-2149999999999999983215760153657234083458312685028243658712690827188642584106117192746173589162156737740730956670518817363394711836001371787940231885473955640210060285460453435891311503029604697813901201313619575978480932794055418723306624184382819241285638963855745875968)
(* (- (* -4 a) (* (* (* z y) x) -18)) t)
(if (<=
z
265000000000000009063349824290444205526937045929817852706150376195619110587156230233275072774144)
(- (- (+ (* -4 (* a t)) (* b c)) (* (* x 4) i)) t_1)
(- (* x (- (* 18 (* t (* y z))) (* 4 i))) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (z <= -2.15e+270) {
tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
} else if (z <= 2.65e+95) {
tmp = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1;
} else {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (z <= (-2.15d+270)) then
tmp = (((-4.0d0) * a) - (((z * y) * x) * (-18.0d0))) * t
else if (z <= 2.65d+95) then
tmp = ((((-4.0d0) * (a * t)) + (b * c)) - ((x * 4.0d0) * i)) - t_1
else
tmp = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (z <= -2.15e+270) {
tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
} else if (z <= 2.65e+95) {
tmp = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1;
} else {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if z <= -2.15e+270: tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t elif z <= 2.65e+95: tmp = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1 else: tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (z <= -2.15e+270) tmp = Float64(Float64(Float64(-4.0 * a) - Float64(Float64(Float64(z * y) * x) * -18.0)) * t); elseif (z <= 2.65e+95) tmp = Float64(Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (j * 27.0) * k; tmp = 0.0; if (z <= -2.15e+270) tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t; elseif (z <= 2.65e+95) tmp = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1; else tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[z, -2149999999999999983215760153657234083458312685028243658712690827188642584106117192746173589162156737740730956670518817363394711836001371787940231885473955640210060285460453435891311503029604697813901201313619575978480932794055418723306624184382819241285638963855745875968], N[(N[(N[(-4 * a), $MachinePrecision] - N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * -18), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 265000000000000009063349824290444205526937045929817852706150376195619110587156230233275072774144], N[(N[(N[(N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * N[(N[(18 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;z \leq -2149999999999999983215760153657234083458312685028243658712690827188642584106117192746173589162156737740730956670518817363394711836001371787940231885473955640210060285460453435891311503029604697813901201313619575978480932794055418723306624184382819241285638963855745875968:\\
\;\;\;\;\left(-4 \cdot a - \left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t\\
\mathbf{elif}\;z \leq 265000000000000009063349824290444205526937045929817852706150376195619110587156230233275072774144:\\
\;\;\;\;\left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - t\_1\\
\end{array}
if z < -2.15e270Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
Applied rewrites42.2%
if -2.15e270 < z < 2.6500000000000001e95Initial program 85.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6476.9%
Applied rewrites76.9%
if 2.6500000000000001e95 < z Initial program 85.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.0%
Applied rewrites58.0%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(- (* x (- (* 18 (* t (* y z))) (* 4 i))) (* (* j 27) k))))
(if (<=
x
-3754664711579725/4171849679533027504677776769862406473833407270227837441302815640277772901915313574263597826048)
t_1
(if (<= x 5000000000000000000000)
(- (* b c) (+ (* 4 (* a t)) (* 27 (* j k))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - ((j * 27.0) * k);
double tmp;
if (x <= -9e-79) {
tmp = t_1;
} else if (x <= 5e+21) {
tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - ((j * 27.0d0) * k)
if (x <= (-9d-79)) then
tmp = t_1
else if (x <= 5d+21) then
tmp = (b * c) - ((4.0d0 * (a * t)) + (27.0d0 * (j * k)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - ((j * 27.0) * k);
double tmp;
if (x <= -9e-79) {
tmp = t_1;
} else if (x <= 5e+21) {
tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - ((j * 27.0) * k) tmp = 0 if x <= -9e-79: tmp = t_1 elif x <= 5e+21: tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (x <= -9e-79) tmp = t_1; elseif (x <= 5e+21) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(a * t)) + Float64(27.0 * Float64(j * k)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - ((j * 27.0) * k); tmp = 0.0; if (x <= -9e-79) tmp = t_1; elseif (x <= 5e+21) tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(x * N[(N[(18 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3754664711579725/4171849679533027504677776769862406473833407270227837441302815640277772901915313574263597826048], t$95$1, If[LessEqual[x, 5000000000000000000000], N[(N[(b * c), $MachinePrecision] - N[(N[(4 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(27 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq \frac{-3754664711579725}{4171849679533027504677776769862406473833407270227837441302815640277772901915313574263597826048}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5000000000000000000000:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -9.0000000000000006e-79 or 5e21 < x Initial program 85.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.0%
Applied rewrites58.0%
if -9.0000000000000006e-79 < x < 5e21Initial program 85.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.8%
Applied rewrites61.8%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (- (* -4 a) (* (* (* z y) x) -18)) t)))
(if (<= t -115000000000000009854233063830914200523552953066323968)
t_1
(if (<= t 309999999999999986587086119803813888)
(- (- (* b c) (* (* x 4) i)) (* (* j 27) k))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
double tmp;
if (t <= -1.15e+53) {
tmp = t_1;
} else if (t <= 3.1e+35) {
tmp = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (((-4.0d0) * a) - (((z * y) * x) * (-18.0d0))) * t
if (t <= (-1.15d+53)) then
tmp = t_1
else if (t <= 3.1d+35) then
tmp = ((b * c) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
double tmp;
if (t <= -1.15e+53) {
tmp = t_1;
} else if (t <= 3.1e+35) {
tmp = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t tmp = 0 if t <= -1.15e+53: tmp = t_1 elif t <= 3.1e+35: tmp = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(-4.0 * a) - Float64(Float64(Float64(z * y) * x) * -18.0)) * t) tmp = 0.0 if (t <= -1.15e+53) tmp = t_1; elseif (t <= 3.1e+35) tmp = Float64(Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t; tmp = 0.0; if (t <= -1.15e+53) tmp = t_1; elseif (t <= 3.1e+35) tmp = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(-4 * a), $MachinePrecision] - N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * -18), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -115000000000000009854233063830914200523552953066323968], t$95$1, If[LessEqual[t, 309999999999999986587086119803813888], N[(N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(-4 \cdot a - \left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t\\
\mathbf{if}\;t \leq -115000000000000009854233063830914200523552953066323968:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 309999999999999986587086119803813888:\\
\;\;\;\;\left(b \cdot c - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.1500000000000001e53 or 3.0999999999999999e35 < t Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
Applied rewrites42.2%
if -1.1500000000000001e53 < t < 3.0999999999999999e35Initial program 85.6%
Taylor expanded in t around 0
lower-*.f6460.9%
Applied rewrites60.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c))
(* (* x 4) i))
500000000000000026252380127602210124352234290554079577457927057755901228994454097893185687540223932021852221916441939088471261617680215287822396092393353491424193600463287901868915116897394045029684476617485399972540559519483820440037326371390071247289629394410028421419057834736098193432729700270080)
(- (* b c) (+ (* 4 (* a t)) (* 27 (* j k))))
(* (- (* -4 a) (* (* (* z y) x) -18)) t)))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= 5e+299) {
tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k)));
} else {
tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) <= 5d+299) then
tmp = (b * c) - ((4.0d0 * (a * t)) + (27.0d0 * (j * k)))
else
tmp = (((-4.0d0) * a) - (((z * y) * x) * (-18.0d0))) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= 5e+299) {
tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k)));
} else {
tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= 5e+299: tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k))) else: tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t return tmp
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) <= 5e+299) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(a * t)) + Float64(27.0 * Float64(j * k)))); else tmp = Float64(Float64(Float64(-4.0 * a) - Float64(Float64(Float64(z * y) * x) * -18.0)) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0; if ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= 5e+299) tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k))); else tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(x * 18), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], 500000000000000026252380127602210124352234290554079577457927057755901228994454097893185687540223932021852221916441939088471261617680215287822396092393353491424193600463287901868915116897394045029684476617485399972540559519483820440037326371390071247289629394410028421419057834736098193432729700270080], N[(N[(b * c), $MachinePrecision] - N[(N[(4 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(27 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4 * a), $MachinePrecision] - N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * -18), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq 500000000000000026252380127602210124352234290554079577457927057755901228994454097893185687540223932021852221916441939088471261617680215287822396092393353491424193600463287901868915116897394045029684476617485399972540559519483820440037326371390071247289629394410028421419057834736098193432729700270080:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot a - \left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t\\
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 5.0000000000000003e299Initial program 85.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.8%
Applied rewrites61.8%
if 5.0000000000000003e299 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
Applied rewrites42.2%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (- (* -4 a) (* (* (* z y) x) -18)) t)))
(if (<= t -115000000000000009854233063830914200523552953066323968)
t_1
(if (<= t 309999999999999986587086119803813888)
(- (* -4 (* i x)) (* (* j 27) k))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
double tmp;
if (t <= -1.15e+53) {
tmp = t_1;
} else if (t <= 3.1e+35) {
tmp = (-4.0 * (i * x)) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (((-4.0d0) * a) - (((z * y) * x) * (-18.0d0))) * t
if (t <= (-1.15d+53)) then
tmp = t_1
else if (t <= 3.1d+35) then
tmp = ((-4.0d0) * (i * x)) - ((j * 27.0d0) * k)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
double tmp;
if (t <= -1.15e+53) {
tmp = t_1;
} else if (t <= 3.1e+35) {
tmp = (-4.0 * (i * x)) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t tmp = 0 if t <= -1.15e+53: tmp = t_1 elif t <= 3.1e+35: tmp = (-4.0 * (i * x)) - ((j * 27.0) * k) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(-4.0 * a) - Float64(Float64(Float64(z * y) * x) * -18.0)) * t) tmp = 0.0 if (t <= -1.15e+53) tmp = t_1; elseif (t <= 3.1e+35) tmp = Float64(Float64(-4.0 * Float64(i * x)) - Float64(Float64(j * 27.0) * k)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t; tmp = 0.0; if (t <= -1.15e+53) tmp = t_1; elseif (t <= 3.1e+35) tmp = (-4.0 * (i * x)) - ((j * 27.0) * k); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(-4 * a), $MachinePrecision] - N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * -18), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -115000000000000009854233063830914200523552953066323968], t$95$1, If[LessEqual[t, 309999999999999986587086119803813888], N[(N[(-4 * N[(i * x), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(-4 \cdot a - \left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t\\
\mathbf{if}\;t \leq -115000000000000009854233063830914200523552953066323968:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 309999999999999986587086119803813888:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.1500000000000001e53 or 3.0999999999999999e35 < t Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2%
Applied rewrites42.2%
if -1.1500000000000001e53 < t < 3.0999999999999999e35Initial program 85.6%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6440.9%
Applied rewrites40.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4 (* a t))))
(if (<=
t
-36999999999999998013523185326902518588573030841927864909525323459853864075718309492230153372314528295171680829384298988405904949413203309958110488113628167666612606588412077996649549454119914153886314509272909035421273372741986299150336)
t_1
(if (<= t 2899999999999999847417951577157133841358248453603328)
(- (* -4 (* i x)) (* (* j 27) k))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (a * t);
double tmp;
if (t <= -3.7e+235) {
tmp = t_1;
} else if (t <= 2.9e+51) {
tmp = (-4.0 * (i * x)) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * t)
if (t <= (-3.7d+235)) then
tmp = t_1
else if (t <= 2.9d+51) then
tmp = ((-4.0d0) * (i * x)) - ((j * 27.0d0) * k)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (a * t);
double tmp;
if (t <= -3.7e+235) {
tmp = t_1;
} else if (t <= 2.9e+51) {
tmp = (-4.0 * (i * x)) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (a * t) tmp = 0 if t <= -3.7e+235: tmp = t_1 elif t <= 2.9e+51: tmp = (-4.0 * (i * x)) - ((j * 27.0) * k) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(a * t)) tmp = 0.0 if (t <= -3.7e+235) tmp = t_1; elseif (t <= 2.9e+51) tmp = Float64(Float64(-4.0 * Float64(i * x)) - Float64(Float64(j * 27.0) * k)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = -4.0 * (a * t); tmp = 0.0; if (t <= -3.7e+235) tmp = t_1; elseif (t <= 2.9e+51) tmp = (-4.0 * (i * x)) - ((j * 27.0) * k); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -36999999999999998013523185326902518588573030841927864909525323459853864075718309492230153372314528295171680829384298988405904949413203309958110488113628167666612606588412077996649549454119914153886314509272909035421273372741986299150336], t$95$1, If[LessEqual[t, 2899999999999999847417951577157133841358248453603328], N[(N[(-4 * N[(i * x), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;t \leq -36999999999999998013523185326902518588573030841927864909525323459853864075718309492230153372314528295171680829384298988405904949413203309958110488113628167666612606588412077996649549454119914153886314509272909035421273372741986299150336:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2899999999999999847417951577157133841358248453603328:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.6999999999999998e235 or 2.8999999999999998e51 < t Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.7%
Applied rewrites21.7%
if -3.6999999999999998e235 < t < 2.8999999999999998e51Initial program 85.6%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6440.9%
Applied rewrites40.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(fmin j k)
-114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264)
(* -27 (* (fmin j k) (fmax j k)))
(if (<=
(fmin j k)
8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648)
(* -4 (* a t))
(* (* -27 (fmax j k)) (fmin j k)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (fmin(j, k) <= -1.15e+128) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (fmin(j, k) <= 2.45e-54) {
tmp = -4.0 * (a * t);
} else {
tmp = (-27.0 * fmax(j, k)) * fmin(j, k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (fmin(j, k) <= (-1.15d+128)) then
tmp = (-27.0d0) * (fmin(j, k) * fmax(j, k))
else if (fmin(j, k) <= 2.45d-54) then
tmp = (-4.0d0) * (a * t)
else
tmp = ((-27.0d0) * fmax(j, k)) * fmin(j, k)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (fmin(j, k) <= -1.15e+128) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (fmin(j, k) <= 2.45e-54) {
tmp = -4.0 * (a * t);
} else {
tmp = (-27.0 * fmax(j, k)) * fmin(j, k);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if fmin(j, k) <= -1.15e+128: tmp = -27.0 * (fmin(j, k) * fmax(j, k)) elif fmin(j, k) <= 2.45e-54: tmp = -4.0 * (a * t) else: tmp = (-27.0 * fmax(j, k)) * fmin(j, k) return tmp
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (fmin(j, k) <= -1.15e+128) tmp = Float64(-27.0 * Float64(fmin(j, k) * fmax(j, k))); elseif (fmin(j, k) <= 2.45e-54) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(-27.0 * fmax(j, k)) * fmin(j, k)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0; if (min(j, k) <= -1.15e+128) tmp = -27.0 * (min(j, k) * max(j, k)); elseif (min(j, k) <= 2.45e-54) tmp = -4.0 * (a * t); else tmp = (-27.0 * max(j, k)) * min(j, k); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[Min[j, k], $MachinePrecision], -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264], N[(-27 * N[(N[Min[j, k], $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[j, k], $MachinePrecision], 8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648], N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(-27 * N[Max[j, k], $MachinePrecision]), $MachinePrecision] * N[Min[j, k], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(j, k\right) \leq -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264:\\
\;\;\;\;-27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\
\mathbf{elif}\;\mathsf{min}\left(j, k\right) \leq \frac{8454639274818441}{3450873173395281893717377931138512726225554486085193277581262111899648}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot \mathsf{max}\left(j, k\right)\right) \cdot \mathsf{min}\left(j, k\right)\\
\end{array}
if j < -1.15e128Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
if -1.15e128 < j < 2.4500000000000001e-54Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.7%
Applied rewrites21.7%
if 2.4500000000000001e-54 < j Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(fmin j k)
-114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264)
(* -27 (* (fmin j k) (fmax j k)))
(if (<=
(fmin j k)
8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648)
(* -4 (* a t))
(* (* -27 (fmin j k)) (fmax j k)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (fmin(j, k) <= -1.15e+128) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (fmin(j, k) <= 2.45e-54) {
tmp = -4.0 * (a * t);
} else {
tmp = (-27.0 * fmin(j, k)) * fmax(j, k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (fmin(j, k) <= (-1.15d+128)) then
tmp = (-27.0d0) * (fmin(j, k) * fmax(j, k))
else if (fmin(j, k) <= 2.45d-54) then
tmp = (-4.0d0) * (a * t)
else
tmp = ((-27.0d0) * fmin(j, k)) * fmax(j, k)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (fmin(j, k) <= -1.15e+128) {
tmp = -27.0 * (fmin(j, k) * fmax(j, k));
} else if (fmin(j, k) <= 2.45e-54) {
tmp = -4.0 * (a * t);
} else {
tmp = (-27.0 * fmin(j, k)) * fmax(j, k);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if fmin(j, k) <= -1.15e+128: tmp = -27.0 * (fmin(j, k) * fmax(j, k)) elif fmin(j, k) <= 2.45e-54: tmp = -4.0 * (a * t) else: tmp = (-27.0 * fmin(j, k)) * fmax(j, k) return tmp
function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (fmin(j, k) <= -1.15e+128) tmp = Float64(-27.0 * Float64(fmin(j, k) * fmax(j, k))); elseif (fmin(j, k) <= 2.45e-54) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(-27.0 * fmin(j, k)) * fmax(j, k)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0; if (min(j, k) <= -1.15e+128) tmp = -27.0 * (min(j, k) * max(j, k)); elseif (min(j, k) <= 2.45e-54) tmp = -4.0 * (a * t); else tmp = (-27.0 * min(j, k)) * max(j, k); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[Min[j, k], $MachinePrecision], -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264], N[(-27 * N[(N[Min[j, k], $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[j, k], $MachinePrecision], 8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648], N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(-27 * N[Min[j, k], $MachinePrecision]), $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(j, k\right) \leq -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264:\\
\;\;\;\;-27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\
\mathbf{elif}\;\mathsf{min}\left(j, k\right) \leq \frac{8454639274818441}{3450873173395281893717377931138512726225554486085193277581262111899648}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot \mathsf{min}\left(j, k\right)\right) \cdot \mathsf{max}\left(j, k\right)\\
\end{array}
if j < -1.15e128Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
if -1.15e128 < j < 2.4500000000000001e-54Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.7%
Applied rewrites21.7%
if 2.4500000000000001e-54 < j Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f6423.8%
Applied rewrites23.8%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27 (* (fmin j k) (fmax j k)))))
(if (<=
(fmin j k)
-114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264)
t_1
(if (<=
(fmin j k)
8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648)
(* -4 (* a t))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (fmin(j, k) * fmax(j, k));
double tmp;
if (fmin(j, k) <= -1.15e+128) {
tmp = t_1;
} else if (fmin(j, k) <= 2.45e-54) {
tmp = -4.0 * (a * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-27.0d0) * (fmin(j, k) * fmax(j, k))
if (fmin(j, k) <= (-1.15d+128)) then
tmp = t_1
else if (fmin(j, k) <= 2.45d-54) then
tmp = (-4.0d0) * (a * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (fmin(j, k) * fmax(j, k));
double tmp;
if (fmin(j, k) <= -1.15e+128) {
tmp = t_1;
} else if (fmin(j, k) <= 2.45e-54) {
tmp = -4.0 * (a * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (fmin(j, k) * fmax(j, k)) tmp = 0 if fmin(j, k) <= -1.15e+128: tmp = t_1 elif fmin(j, k) <= 2.45e-54: tmp = -4.0 * (a * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(fmin(j, k) * fmax(j, k))) tmp = 0.0 if (fmin(j, k) <= -1.15e+128) tmp = t_1; elseif (fmin(j, k) <= 2.45e-54) tmp = Float64(-4.0 * Float64(a * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = -27.0 * (min(j, k) * max(j, k)); tmp = 0.0; if (min(j, k) <= -1.15e+128) tmp = t_1; elseif (min(j, k) <= 2.45e-54) tmp = -4.0 * (a * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27 * N[(N[Min[j, k], $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Min[j, k], $MachinePrecision], -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264], t$95$1, If[LessEqual[N[Min[j, k], $MachinePrecision], 8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648], N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\
\mathbf{if}\;\mathsf{min}\left(j, k\right) \leq -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\mathsf{min}\left(j, k\right) \leq \frac{8454639274818441}{3450873173395281893717377931138512726225554486085193277581262111899648}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if j < -1.15e128 or 2.4500000000000001e-54 < j Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
if -1.15e128 < j < 2.4500000000000001e-54Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.7%
Applied rewrites21.7%
(FPCore (x y z t a b c i j k) :precision binary64 (* -4 (* a t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -4.0 * (a * t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (-4.0d0) * (a * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return -4.0 * (a * t);
}
def code(x, y, z, t, a, b, c, i, j, k): return -4.0 * (a * t)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(-4.0 * Float64(a * t)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = -4.0 * (a * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision]
-4 \cdot \left(a \cdot t\right)
Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6423.8%
Applied rewrites23.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.2%
Applied rewrites42.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.7%
Applied rewrites21.7%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
(- (- (+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c)) (* (* x 4) i)) (* (* j 27) k)))