
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fmin (fmin y z) t))
(t_2 (fmax (fmin y z) t))
(t_3 (fmin (fmax y z) t_2))
(t_4 (fmax (fmax y z) t_2)))
(if (<= t_3 2e-66)
(- (- (+ x x) (* (* -27.0 a) b)) (* (* (* t_3 t_4) 9.0) t_1))
(+ (- (* x 2.0) (* (* (* t_4 t_1) 9.0) t_3)) (* (* a 27.0) b)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fmin(fmin(y, z), t);
double t_2 = fmax(fmin(y, z), t);
double t_3 = fmin(fmax(y, z), t_2);
double t_4 = fmax(fmax(y, z), t_2);
double tmp;
if (t_3 <= 2e-66) {
tmp = ((x + x) - ((-27.0 * a) * b)) - (((t_3 * t_4) * 9.0) * t_1);
} else {
tmp = ((x * 2.0) - (((t_4 * t_1) * 9.0) * t_3)) + ((a * 27.0) * b);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = fmin(fmin(y, z), t)
t_2 = fmax(fmin(y, z), t)
t_3 = fmin(fmax(y, z), t_2)
t_4 = fmax(fmax(y, z), t_2)
if (t_3 <= 2d-66) then
tmp = ((x + x) - (((-27.0d0) * a) * b)) - (((t_3 * t_4) * 9.0d0) * t_1)
else
tmp = ((x * 2.0d0) - (((t_4 * t_1) * 9.0d0) * t_3)) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fmin(fmin(y, z), t);
double t_2 = fmax(fmin(y, z), t);
double t_3 = fmin(fmax(y, z), t_2);
double t_4 = fmax(fmax(y, z), t_2);
double tmp;
if (t_3 <= 2e-66) {
tmp = ((x + x) - ((-27.0 * a) * b)) - (((t_3 * t_4) * 9.0) * t_1);
} else {
tmp = ((x * 2.0) - (((t_4 * t_1) * 9.0) * t_3)) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = fmin(fmin(y, z), t) t_2 = fmax(fmin(y, z), t) t_3 = fmin(fmax(y, z), t_2) t_4 = fmax(fmax(y, z), t_2) tmp = 0 if t_3 <= 2e-66: tmp = ((x + x) - ((-27.0 * a) * b)) - (((t_3 * t_4) * 9.0) * t_1) else: tmp = ((x * 2.0) - (((t_4 * t_1) * 9.0) * t_3)) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) t_1 = fmin(fmin(y, z), t) t_2 = fmax(fmin(y, z), t) t_3 = fmin(fmax(y, z), t_2) t_4 = fmax(fmax(y, z), t_2) tmp = 0.0 if (t_3 <= 2e-66) tmp = Float64(Float64(Float64(x + x) - Float64(Float64(-27.0 * a) * b)) - Float64(Float64(Float64(t_3 * t_4) * 9.0) * t_1)); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(t_4 * t_1) * 9.0) * t_3)) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = min(min(y, z), t); t_2 = max(min(y, z), t); t_3 = min(max(y, z), t_2); t_4 = max(max(y, z), t_2); tmp = 0.0; if (t_3 <= 2e-66) tmp = ((x + x) - ((-27.0 * a) * b)) - (((t_3 * t_4) * 9.0) * t_1); else tmp = ((x * 2.0) - (((t_4 * t_1) * 9.0) * t_3)) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Min[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[y, z], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[y, z], $MachinePrecision], t$95$2], $MachinePrecision]}, If[LessEqual[t$95$3, 2e-66], N[(N[(N[(x + x), $MachinePrecision] - N[(N[(-27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t$95$3 * t$95$4), $MachinePrecision] * 9.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(t$95$4 * t$95$1), $MachinePrecision] * 9.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_2 := \mathsf{max}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_3 := \mathsf{min}\left(\mathsf{max}\left(y, z\right), t\_2\right)\\
t_4 := \mathsf{max}\left(\mathsf{max}\left(y, z\right), t\_2\right)\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-66}:\\
\;\;\;\;\left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\left(t\_3 \cdot t\_4\right) \cdot 9\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(t\_4 \cdot t\_1\right) \cdot 9\right) \cdot t\_3\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
if z < 2e-66Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.5%
Applied rewrites94.5%
if 2e-66 < z Initial program 95.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6494.0%
Applied rewrites94.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ x x) (* (* -27.0 a) b)))
(t_2 (fmin (fmin y z) t))
(t_3 (fmax (fmin y z) t))
(t_4 (fmin (fmax y z) t_3))
(t_5 (fmax (fmax y z) t_3)))
(if (<= t_4 10000.0)
(- t_1 (* (* (* t_4 t_5) 9.0) t_2))
(- t_1 (* t_5 (* t_4 (* 9.0 t_2)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + x) - ((-27.0 * a) * b);
double t_2 = fmin(fmin(y, z), t);
double t_3 = fmax(fmin(y, z), t);
double t_4 = fmin(fmax(y, z), t_3);
double t_5 = fmax(fmax(y, z), t_3);
double tmp;
if (t_4 <= 10000.0) {
tmp = t_1 - (((t_4 * t_5) * 9.0) * t_2);
} else {
tmp = t_1 - (t_5 * (t_4 * (9.0 * 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)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = (x + x) - (((-27.0d0) * a) * b)
t_2 = fmin(fmin(y, z), t)
t_3 = fmax(fmin(y, z), t)
t_4 = fmin(fmax(y, z), t_3)
t_5 = fmax(fmax(y, z), t_3)
if (t_4 <= 10000.0d0) then
tmp = t_1 - (((t_4 * t_5) * 9.0d0) * t_2)
else
tmp = t_1 - (t_5 * (t_4 * (9.0d0 * 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 t_1 = (x + x) - ((-27.0 * a) * b);
double t_2 = fmin(fmin(y, z), t);
double t_3 = fmax(fmin(y, z), t);
double t_4 = fmin(fmax(y, z), t_3);
double t_5 = fmax(fmax(y, z), t_3);
double tmp;
if (t_4 <= 10000.0) {
tmp = t_1 - (((t_4 * t_5) * 9.0) * t_2);
} else {
tmp = t_1 - (t_5 * (t_4 * (9.0 * t_2)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + x) - ((-27.0 * a) * b) t_2 = fmin(fmin(y, z), t) t_3 = fmax(fmin(y, z), t) t_4 = fmin(fmax(y, z), t_3) t_5 = fmax(fmax(y, z), t_3) tmp = 0 if t_4 <= 10000.0: tmp = t_1 - (((t_4 * t_5) * 9.0) * t_2) else: tmp = t_1 - (t_5 * (t_4 * (9.0 * t_2))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + x) - Float64(Float64(-27.0 * a) * b)) t_2 = fmin(fmin(y, z), t) t_3 = fmax(fmin(y, z), t) t_4 = fmin(fmax(y, z), t_3) t_5 = fmax(fmax(y, z), t_3) tmp = 0.0 if (t_4 <= 10000.0) tmp = Float64(t_1 - Float64(Float64(Float64(t_4 * t_5) * 9.0) * t_2)); else tmp = Float64(t_1 - Float64(t_5 * Float64(t_4 * Float64(9.0 * t_2)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + x) - ((-27.0 * a) * b); t_2 = min(min(y, z), t); t_3 = max(min(y, z), t); t_4 = min(max(y, z), t_3); t_5 = max(max(y, z), t_3); tmp = 0.0; if (t_4 <= 10000.0) tmp = t_1 - (((t_4 * t_5) * 9.0) * t_2); else tmp = t_1 - (t_5 * (t_4 * (9.0 * t_2))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + x), $MachinePrecision] - N[(N[(-27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$4 = N[Min[N[Max[y, z], $MachinePrecision], t$95$3], $MachinePrecision]}, Block[{t$95$5 = N[Max[N[Max[y, z], $MachinePrecision], t$95$3], $MachinePrecision]}, If[LessEqual[t$95$4, 10000.0], N[(t$95$1 - N[(N[(N[(t$95$4 * t$95$5), $MachinePrecision] * 9.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(t$95$5 * N[(t$95$4 * N[(9.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \left(x + x\right) - \left(-27 \cdot a\right) \cdot b\\
t_2 := \mathsf{min}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_3 := \mathsf{max}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_4 := \mathsf{min}\left(\mathsf{max}\left(y, z\right), t\_3\right)\\
t_5 := \mathsf{max}\left(\mathsf{max}\left(y, z\right), t\_3\right)\\
\mathbf{if}\;t\_4 \leq 10000:\\
\;\;\;\;t\_1 - \left(\left(t\_4 \cdot t\_5\right) \cdot 9\right) \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\_5 \cdot \left(t\_4 \cdot \left(9 \cdot t\_2\right)\right)\\
\end{array}
if z < 1e4Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.5%
Applied rewrites94.5%
if 1e4 < z Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (* (fmin y t) 9.0) z) 2e+305) (- (- (+ x x) (* (* -27.0 a) b)) (* (fmax y t) (* z (* 9.0 (fmin y t))))) (+ (* -9.0 (* (* (fmin y t) (fmax y t)) z)) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((fmin(y, t) * 9.0) * z) <= 2e+305) {
tmp = ((x + x) - ((-27.0 * a) * b)) - (fmax(y, t) * (z * (9.0 * fmin(y, t))));
} else {
tmp = (-9.0 * ((fmin(y, t) * fmax(y, t)) * z)) + ((a * 27.0) * b);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (((fmin(y, t) * 9.0d0) * z) <= 2d+305) then
tmp = ((x + x) - (((-27.0d0) * a) * b)) - (fmax(y, t) * (z * (9.0d0 * fmin(y, t))))
else
tmp = ((-9.0d0) * ((fmin(y, t) * fmax(y, t)) * z)) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((fmin(y, t) * 9.0) * z) <= 2e+305) {
tmp = ((x + x) - ((-27.0 * a) * b)) - (fmax(y, t) * (z * (9.0 * fmin(y, t))));
} else {
tmp = (-9.0 * ((fmin(y, t) * fmax(y, t)) * z)) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((fmin(y, t) * 9.0) * z) <= 2e+305: tmp = ((x + x) - ((-27.0 * a) * b)) - (fmax(y, t) * (z * (9.0 * fmin(y, t)))) else: tmp = (-9.0 * ((fmin(y, t) * fmax(y, t)) * z)) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(fmin(y, t) * 9.0) * z) <= 2e+305) tmp = Float64(Float64(Float64(x + x) - Float64(Float64(-27.0 * a) * b)) - Float64(fmax(y, t) * Float64(z * Float64(9.0 * fmin(y, t))))); else tmp = Float64(Float64(-9.0 * Float64(Float64(fmin(y, t) * fmax(y, t)) * z)) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((min(y, t) * 9.0) * z) <= 2e+305) tmp = ((x + x) - ((-27.0 * a) * b)) - (max(y, t) * (z * (9.0 * min(y, t)))); else tmp = (-9.0 * ((min(y, t) * max(y, t)) * z)) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[Min[y, t], $MachinePrecision] * 9.0), $MachinePrecision] * z), $MachinePrecision], 2e+305], N[(N[(N[(x + x), $MachinePrecision] - N[(N[(-27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(N[Max[y, t], $MachinePrecision] * N[(z * N[(9.0 * N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(N[(N[Min[y, t], $MachinePrecision] * N[Max[y, t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\mathsf{min}\left(y, t\right) \cdot 9\right) \cdot z \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \mathsf{max}\left(y, t\right) \cdot \left(z \cdot \left(9 \cdot \mathsf{min}\left(y, t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(\left(\mathsf{min}\left(y, t\right) \cdot \mathsf{max}\left(y, t\right)\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.9999999999999999e305Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
if 1.9999999999999999e305 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 95.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6466.4%
Applied rewrites66.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6465.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.6%
Applied rewrites65.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fmax (fmin y z) t))
(t_2 (fmin (fmax y z) t_1))
(t_3 (fmax (fmax y z) t_1))
(t_4 (fmin (fmin y z) t))
(t_5 (* (* (* t_4 9.0) t_2) t_3))
(t_6 (* (* a 27.0) b)))
(if (<= t_5 -5e+31)
(+ (* -9.0 (* t_3 (* t_4 t_2))) t_6)
(if (<= t_5 1e-88)
(+ (* 2.0 x) (* (* 27.0 b) a))
(+ (* -9.0 (* (* t_4 t_3) t_2)) t_6)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fmax(fmin(y, z), t);
double t_2 = fmin(fmax(y, z), t_1);
double t_3 = fmax(fmax(y, z), t_1);
double t_4 = fmin(fmin(y, z), t);
double t_5 = ((t_4 * 9.0) * t_2) * t_3;
double t_6 = (a * 27.0) * b;
double tmp;
if (t_5 <= -5e+31) {
tmp = (-9.0 * (t_3 * (t_4 * t_2))) + t_6;
} else if (t_5 <= 1e-88) {
tmp = (2.0 * x) + ((27.0 * b) * a);
} else {
tmp = (-9.0 * ((t_4 * t_3) * t_2)) + t_6;
}
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)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = fmax(fmin(y, z), t)
t_2 = fmin(fmax(y, z), t_1)
t_3 = fmax(fmax(y, z), t_1)
t_4 = fmin(fmin(y, z), t)
t_5 = ((t_4 * 9.0d0) * t_2) * t_3
t_6 = (a * 27.0d0) * b
if (t_5 <= (-5d+31)) then
tmp = ((-9.0d0) * (t_3 * (t_4 * t_2))) + t_6
else if (t_5 <= 1d-88) then
tmp = (2.0d0 * x) + ((27.0d0 * b) * a)
else
tmp = ((-9.0d0) * ((t_4 * t_3) * t_2)) + t_6
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fmax(fmin(y, z), t);
double t_2 = fmin(fmax(y, z), t_1);
double t_3 = fmax(fmax(y, z), t_1);
double t_4 = fmin(fmin(y, z), t);
double t_5 = ((t_4 * 9.0) * t_2) * t_3;
double t_6 = (a * 27.0) * b;
double tmp;
if (t_5 <= -5e+31) {
tmp = (-9.0 * (t_3 * (t_4 * t_2))) + t_6;
} else if (t_5 <= 1e-88) {
tmp = (2.0 * x) + ((27.0 * b) * a);
} else {
tmp = (-9.0 * ((t_4 * t_3) * t_2)) + t_6;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = fmax(fmin(y, z), t) t_2 = fmin(fmax(y, z), t_1) t_3 = fmax(fmax(y, z), t_1) t_4 = fmin(fmin(y, z), t) t_5 = ((t_4 * 9.0) * t_2) * t_3 t_6 = (a * 27.0) * b tmp = 0 if t_5 <= -5e+31: tmp = (-9.0 * (t_3 * (t_4 * t_2))) + t_6 elif t_5 <= 1e-88: tmp = (2.0 * x) + ((27.0 * b) * a) else: tmp = (-9.0 * ((t_4 * t_3) * t_2)) + t_6 return tmp
function code(x, y, z, t, a, b) t_1 = fmax(fmin(y, z), t) t_2 = fmin(fmax(y, z), t_1) t_3 = fmax(fmax(y, z), t_1) t_4 = fmin(fmin(y, z), t) t_5 = Float64(Float64(Float64(t_4 * 9.0) * t_2) * t_3) t_6 = Float64(Float64(a * 27.0) * b) tmp = 0.0 if (t_5 <= -5e+31) tmp = Float64(Float64(-9.0 * Float64(t_3 * Float64(t_4 * t_2))) + t_6); elseif (t_5 <= 1e-88) tmp = Float64(Float64(2.0 * x) + Float64(Float64(27.0 * b) * a)); else tmp = Float64(Float64(-9.0 * Float64(Float64(t_4 * t_3) * t_2)) + t_6); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = max(min(y, z), t); t_2 = min(max(y, z), t_1); t_3 = max(max(y, z), t_1); t_4 = min(min(y, z), t); t_5 = ((t_4 * 9.0) * t_2) * t_3; t_6 = (a * 27.0) * b; tmp = 0.0; if (t_5 <= -5e+31) tmp = (-9.0 * (t_3 * (t_4 * t_2))) + t_6; elseif (t_5 <= 1e-88) tmp = (2.0 * x) + ((27.0 * b) * a); else tmp = (-9.0 * ((t_4 * t_3) * t_2)) + t_6; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Max[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[y, z], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[y, z], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$4 = N[Min[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$4 * 9.0), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$5, -5e+31], N[(N[(-9.0 * N[(t$95$3 * N[(t$95$4 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision], If[LessEqual[t$95$5, 1e-88], N[(N[(2.0 * x), $MachinePrecision] + N[(N[(27.0 * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(N[(t$95$4 * t$95$3), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_2 := \mathsf{min}\left(\mathsf{max}\left(y, z\right), t\_1\right)\\
t_3 := \mathsf{max}\left(\mathsf{max}\left(y, z\right), t\_1\right)\\
t_4 := \mathsf{min}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_5 := \left(\left(t\_4 \cdot 9\right) \cdot t\_2\right) \cdot t\_3\\
t_6 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_5 \leq -5 \cdot 10^{+31}:\\
\;\;\;\;-9 \cdot \left(t\_3 \cdot \left(t\_4 \cdot t\_2\right)\right) + t\_6\\
\mathbf{elif}\;t\_5 \leq 10^{-88}:\\
\;\;\;\;2 \cdot x + \left(27 \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(\left(t\_4 \cdot t\_3\right) \cdot t\_2\right) + t\_6\\
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -5.0000000000000003e31Initial program 95.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6466.4%
Applied rewrites66.4%
if -5.0000000000000003e31 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999993e-89Initial program 95.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6464.3%
Applied rewrites64.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.2%
Applied rewrites64.2%
if 9.9999999999999993e-89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 95.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6466.4%
Applied rewrites66.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6465.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.6%
Applied rewrites65.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (* -9.0 (* (fmax y t) (* (fmin y t) z))) (* (* a 27.0) b)))
(t_2 (* (* (* (fmin y t) 9.0) z) (fmax y t))))
(if (<= t_2 -5e+31)
t_1
(if (<= t_2 1e-88) (+ (* 2.0 x) (* (* 27.0 b) a)) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (-9.0 * (fmax(y, t) * (fmin(y, t) * z))) + ((a * 27.0) * b);
double t_2 = ((fmin(y, t) * 9.0) * z) * fmax(y, t);
double tmp;
if (t_2 <= -5e+31) {
tmp = t_1;
} else if (t_2 <= 1e-88) {
tmp = (2.0 * x) + ((27.0 * b) * a);
} 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)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((-9.0d0) * (fmax(y, t) * (fmin(y, t) * z))) + ((a * 27.0d0) * b)
t_2 = ((fmin(y, t) * 9.0d0) * z) * fmax(y, t)
if (t_2 <= (-5d+31)) then
tmp = t_1
else if (t_2 <= 1d-88) then
tmp = (2.0d0 * x) + ((27.0d0 * b) * a)
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 t_1 = (-9.0 * (fmax(y, t) * (fmin(y, t) * z))) + ((a * 27.0) * b);
double t_2 = ((fmin(y, t) * 9.0) * z) * fmax(y, t);
double tmp;
if (t_2 <= -5e+31) {
tmp = t_1;
} else if (t_2 <= 1e-88) {
tmp = (2.0 * x) + ((27.0 * b) * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (-9.0 * (fmax(y, t) * (fmin(y, t) * z))) + ((a * 27.0) * b) t_2 = ((fmin(y, t) * 9.0) * z) * fmax(y, t) tmp = 0 if t_2 <= -5e+31: tmp = t_1 elif t_2 <= 1e-88: tmp = (2.0 * x) + ((27.0 * b) * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-9.0 * Float64(fmax(y, t) * Float64(fmin(y, t) * z))) + Float64(Float64(a * 27.0) * b)) t_2 = Float64(Float64(Float64(fmin(y, t) * 9.0) * z) * fmax(y, t)) tmp = 0.0 if (t_2 <= -5e+31) tmp = t_1; elseif (t_2 <= 1e-88) tmp = Float64(Float64(2.0 * x) + Float64(Float64(27.0 * b) * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (-9.0 * (max(y, t) * (min(y, t) * z))) + ((a * 27.0) * b); t_2 = ((min(y, t) * 9.0) * z) * max(y, t); tmp = 0.0; if (t_2 <= -5e+31) tmp = t_1; elseif (t_2 <= 1e-88) tmp = (2.0 * x) + ((27.0 * b) * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(-9.0 * N[(N[Max[y, t], $MachinePrecision] * N[(N[Min[y, t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[Min[y, t], $MachinePrecision] * 9.0), $MachinePrecision] * z), $MachinePrecision] * N[Max[y, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+31], t$95$1, If[LessEqual[t$95$2, 1e-88], N[(N[(2.0 * x), $MachinePrecision] + N[(N[(27.0 * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := -9 \cdot \left(\mathsf{max}\left(y, t\right) \cdot \left(\mathsf{min}\left(y, t\right) \cdot z\right)\right) + \left(a \cdot 27\right) \cdot b\\
t_2 := \left(\left(\mathsf{min}\left(y, t\right) \cdot 9\right) \cdot z\right) \cdot \mathsf{max}\left(y, t\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-88}:\\
\;\;\;\;2 \cdot x + \left(27 \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -5.0000000000000003e31 or 9.9999999999999993e-89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 95.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6466.4%
Applied rewrites66.4%
if -5.0000000000000003e31 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999993e-89Initial program 95.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6464.3%
Applied rewrites64.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.2%
Applied rewrites64.2%
(FPCore (x y z t a b) :precision binary64 (+ (* 2.0 x) (* (* 27.0 b) a)))
double code(double x, double y, double z, double t, double a, double b) {
return (2.0 * x) + ((27.0 * b) * a);
}
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)
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
code = (2.0d0 * x) + ((27.0d0 * b) * a)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (2.0 * x) + ((27.0 * b) * a);
}
def code(x, y, z, t, a, b): return (2.0 * x) + ((27.0 * b) * a)
function code(x, y, z, t, a, b) return Float64(Float64(2.0 * x) + Float64(Float64(27.0 * b) * a)) end
function tmp = code(x, y, z, t, a, b) tmp = (2.0 * x) + ((27.0 * b) * a); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(2.0 * x), $MachinePrecision] + N[(N[(27.0 * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
2 \cdot x + \left(27 \cdot b\right) \cdot a
Initial program 95.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6464.3%
Applied rewrites64.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.2%
Applied rewrites64.2%
(FPCore (x y z t a b) :precision binary64 (- (+ x x) (* (fmax a b) (* (fmin a b) -27.0))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + x) - (fmax(a, b) * (fmin(a, b) * -27.0));
}
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)
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
code = (x + x) - (fmax(a, b) * (fmin(a, b) * (-27.0d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + x) - (fmax(a, b) * (fmin(a, b) * -27.0));
}
def code(x, y, z, t, a, b): return (x + x) - (fmax(a, b) * (fmin(a, b) * -27.0))
function code(x, y, z, t, a, b) return Float64(Float64(x + x) - Float64(fmax(a, b) * Float64(fmin(a, b) * -27.0))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + x) - (max(a, b) * (min(a, b) * -27.0)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + x), $MachinePrecision] - N[(N[Max[a, b], $MachinePrecision] * N[(N[Min[a, b], $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x + x\right) - \mathsf{max}\left(a, b\right) \cdot \left(\mathsf{min}\left(a, b\right) \cdot -27\right)
Initial program 95.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6464.3%
Applied rewrites64.3%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f6464.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6464.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6464.3%
Applied rewrites64.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (fmin a b) 27.0) (fmax a b))))
(if (<= t_1 -5e+80)
(* -1.0 (* -27.0 (* (fmin a b) (fmax a b))))
(if (<= t_1 10.0)
(* -1.0 (* -2.0 x))
(* -1.0 (* (fmax a b) (* -27.0 (fmin a b))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (fmin(a, b) * 27.0) * fmax(a, b);
double tmp;
if (t_1 <= -5e+80) {
tmp = -1.0 * (-27.0 * (fmin(a, b) * fmax(a, b)));
} else if (t_1 <= 10.0) {
tmp = -1.0 * (-2.0 * x);
} else {
tmp = -1.0 * (fmax(a, b) * (-27.0 * fmin(a, b)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (fmin(a, b) * 27.0d0) * fmax(a, b)
if (t_1 <= (-5d+80)) then
tmp = (-1.0d0) * ((-27.0d0) * (fmin(a, b) * fmax(a, b)))
else if (t_1 <= 10.0d0) then
tmp = (-1.0d0) * ((-2.0d0) * x)
else
tmp = (-1.0d0) * (fmax(a, b) * ((-27.0d0) * fmin(a, b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (fmin(a, b) * 27.0) * fmax(a, b);
double tmp;
if (t_1 <= -5e+80) {
tmp = -1.0 * (-27.0 * (fmin(a, b) * fmax(a, b)));
} else if (t_1 <= 10.0) {
tmp = -1.0 * (-2.0 * x);
} else {
tmp = -1.0 * (fmax(a, b) * (-27.0 * fmin(a, b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (fmin(a, b) * 27.0) * fmax(a, b) tmp = 0 if t_1 <= -5e+80: tmp = -1.0 * (-27.0 * (fmin(a, b) * fmax(a, b))) elif t_1 <= 10.0: tmp = -1.0 * (-2.0 * x) else: tmp = -1.0 * (fmax(a, b) * (-27.0 * fmin(a, b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(fmin(a, b) * 27.0) * fmax(a, b)) tmp = 0.0 if (t_1 <= -5e+80) tmp = Float64(-1.0 * Float64(-27.0 * Float64(fmin(a, b) * fmax(a, b)))); elseif (t_1 <= 10.0) tmp = Float64(-1.0 * Float64(-2.0 * x)); else tmp = Float64(-1.0 * Float64(fmax(a, b) * Float64(-27.0 * fmin(a, b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (min(a, b) * 27.0) * max(a, b); tmp = 0.0; if (t_1 <= -5e+80) tmp = -1.0 * (-27.0 * (min(a, b) * max(a, b))); elseif (t_1 <= 10.0) tmp = -1.0 * (-2.0 * x); else tmp = -1.0 * (max(a, b) * (-27.0 * min(a, b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Min[a, b], $MachinePrecision] * 27.0), $MachinePrecision] * N[Max[a, b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+80], N[(-1.0 * N[(-27.0 * N[(N[Min[a, b], $MachinePrecision] * N[Max[a, b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 10.0], N[(-1.0 * N[(-2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Max[a, b], $MachinePrecision] * N[(-27.0 * N[Min[a, b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(a, b\right) \cdot 27\right) \cdot \mathsf{max}\left(a, b\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+80}:\\
\;\;\;\;-1 \cdot \left(-27 \cdot \left(\mathsf{min}\left(a, b\right) \cdot \mathsf{max}\left(a, b\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;-1 \cdot \left(-2 \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\mathsf{max}\left(a, b\right) \cdot \left(-27 \cdot \mathsf{min}\left(a, b\right)\right)\right)\\
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -4.9999999999999996e80Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.5%
Applied rewrites94.5%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6482.2%
Applied rewrites82.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if -4.9999999999999996e80 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 10Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.5%
Applied rewrites94.5%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6482.2%
Applied rewrites82.2%
Taylor expanded in x around inf
lower-*.f6430.8%
Applied rewrites30.8%
if 10 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.5%
Applied rewrites94.5%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6482.2%
Applied rewrites82.2%
Taylor expanded in a around inf
lower-*.f6435.4%
Applied rewrites35.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (* a 27.0) b)) (t_2 (* -1.0 (* -27.0 (* a b))))) (if (<= t_1 -5e+80) t_2 (if (<= t_1 10.0) (* -1.0 (* -2.0 x)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * 27.0) * b;
double t_2 = -1.0 * (-27.0 * (a * b));
double tmp;
if (t_1 <= -5e+80) {
tmp = t_2;
} else if (t_1 <= 10.0) {
tmp = -1.0 * (-2.0 * x);
} 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)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * 27.0d0) * b
t_2 = (-1.0d0) * ((-27.0d0) * (a * b))
if (t_1 <= (-5d+80)) then
tmp = t_2
else if (t_1 <= 10.0d0) then
tmp = (-1.0d0) * ((-2.0d0) * x)
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 t_1 = (a * 27.0) * b;
double t_2 = -1.0 * (-27.0 * (a * b));
double tmp;
if (t_1 <= -5e+80) {
tmp = t_2;
} else if (t_1 <= 10.0) {
tmp = -1.0 * (-2.0 * x);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b t_2 = -1.0 * (-27.0 * (a * b)) tmp = 0 if t_1 <= -5e+80: tmp = t_2 elif t_1 <= 10.0: tmp = -1.0 * (-2.0 * x) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * 27.0) * b) t_2 = Float64(-1.0 * Float64(-27.0 * Float64(a * b))) tmp = 0.0 if (t_1 <= -5e+80) tmp = t_2; elseif (t_1 <= 10.0) tmp = Float64(-1.0 * Float64(-2.0 * x)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a * 27.0) * b; t_2 = -1.0 * (-27.0 * (a * b)); tmp = 0.0; if (t_1 <= -5e+80) tmp = t_2; elseif (t_1 <= 10.0) tmp = -1.0 * (-2.0 * x); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 * N[(-27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+80], t$95$2, If[LessEqual[t$95$1, 10.0], N[(-1.0 * N[(-2.0 * x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
t_2 := -1 \cdot \left(-27 \cdot \left(a \cdot b\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+80}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;-1 \cdot \left(-2 \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -4.9999999999999996e80 or 10 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.5%
Applied rewrites94.5%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6482.2%
Applied rewrites82.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if -4.9999999999999996e80 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 10Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.5%
Applied rewrites94.5%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6482.2%
Applied rewrites82.2%
Taylor expanded in x around inf
lower-*.f6430.8%
Applied rewrites30.8%
(FPCore (x y z t a b) :precision binary64 (* -1.0 (* -2.0 x)))
double code(double x, double y, double z, double t, double a, double b) {
return -1.0 * (-2.0 * x);
}
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)
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
code = (-1.0d0) * ((-2.0d0) * x)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return -1.0 * (-2.0 * x);
}
def code(x, y, z, t, a, b): return -1.0 * (-2.0 * x)
function code(x, y, z, t, a, b) return Float64(-1.0 * Float64(-2.0 * x)) end
function tmp = code(x, y, z, t, a, b) tmp = -1.0 * (-2.0 * x); end
code[x_, y_, z_, t_, a_, b_] := N[(-1.0 * N[(-2.0 * x), $MachinePrecision]), $MachinePrecision]
-1 \cdot \left(-2 \cdot x\right)
Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites95.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.5%
Applied rewrites94.5%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6482.2%
Applied rewrites82.2%
Taylor expanded in x around inf
lower-*.f6430.8%
Applied rewrites30.8%
herbie shell --seed 2025258
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))