
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (/ (- (+ t_0 (* 2 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_2) (- t_2 3))
(* (* x1 x1) (- (* 4 t_2) 6)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3 (/ (- (- t_0 (* 2 x2)) x1) t_1))))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4 * t$95$2), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3 * N[(N[(N[(t$95$0 - N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
Herbie found 27 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (/ (- (+ t_0 (* 2 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_2) (- t_2 3))
(* (* x1 x1) (- (* 4 t_2) 6)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3 (/ (- (- t_0 (* 2 x2)) x1) t_1))))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4 * t$95$2), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3 * N[(N[(N[(t$95$0 - N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x1 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (- (* x1 x1) -1))
(t_3 (* (* 3 x1) x1))
(t_4 (/ (- (+ t_3 (* 2 x2)) x1) t_1))
(t_5 (* t_3 t_4))
(t_6 (* 3 (/ (- (- t_3 (* 2 x2)) x1) t_1)))
(t_7 (/ (+ (- (+ x2 x2) x1) t_3) t_2)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_4) (- t_4 3))
(* (* x1 x1) (- (* 4 t_4) 6)))
t_1)
t_5)
t_0)
x1)
t_6))
INFINITY)
(+
x1
(+
(+
(+
(+
(134-z0z1z2z3z4
t_2
(* (- (* 4 t_7) 6) x1)
x1
(+ 3 (* (- (- x1 t_3) (+ x2 x2)) (/ 1 t_2)))
(* t_7 (+ x1 x1)))
t_5)
t_0)
x1)
t_6))
(+ x1 (+ (+ (* (pow x1 4) 6) x1) 9)))))\begin{array}{l}
t_0 := \left(x1 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot x1 - -1\\
t_3 := \left(3 \cdot x1\right) \cdot x1\\
t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_1}\\
t_5 := t\_3 \cdot t\_4\\
t_6 := 3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_1}\\
t_7 := \frac{\left(\left(x2 + x2\right) - x1\right) + t\_3}{t\_2}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_4 - 6\right)\right) \cdot t\_1 + t\_5\right) + t\_0\right) + x1\right) + t\_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(\left(\left(\mathsf{134\_z0z1z2z3z4}\left(t\_2, \left(\left(4 \cdot t\_7 - 6\right) \cdot x1\right), x1, \left(3 + \left(\left(x1 - t\_3\right) - \left(x2 + x2\right)\right) \cdot \frac{1}{t\_2}\right), \left(t\_7 \cdot \left(x1 + x1\right)\right)\right) + t\_5\right) + t\_0\right) + x1\right) + t\_6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{4} \cdot 6 + x1\right) + 9\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 70.9%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
Applied rewrites70.9%
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
lower-*.f64N/A
Applied rewrites70.9%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around inf
Applied rewrites45.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x1 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (- (* x1 x1) -1))
(t_3 (* (* 3 x1) x1))
(t_4 (/ (- (+ t_3 (* 2 x2)) x1) t_1))
(t_5 (* t_3 t_4))
(t_6 (* 3 (/ (- (- t_3 (* 2 x2)) x1) t_1)))
(t_7 (/ (+ (- (+ x2 x2) x1) t_3) t_2)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_4) (- t_4 3))
(* (* x1 x1) (- (* 4 t_4) 6)))
t_1)
t_5)
t_0)
x1)
t_6))
INFINITY)
(+
x1
(+
(+
(+
(+
(134-z0z1z2z3z4
t_2
(* (- (* 4 t_7) 6) x1)
x1
(- 3 t_7)
(* t_7 (+ x1 x1)))
t_5)
t_0)
x1)
t_6))
(+ x1 (+ (+ (* (pow x1 4) 6) x1) 9)))))\begin{array}{l}
t_0 := \left(x1 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot x1 - -1\\
t_3 := \left(3 \cdot x1\right) \cdot x1\\
t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_1}\\
t_5 := t\_3 \cdot t\_4\\
t_6 := 3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_1}\\
t_7 := \frac{\left(\left(x2 + x2\right) - x1\right) + t\_3}{t\_2}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_4 - 6\right)\right) \cdot t\_1 + t\_5\right) + t\_0\right) + x1\right) + t\_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(\left(\left(\mathsf{134\_z0z1z2z3z4}\left(t\_2, \left(\left(4 \cdot t\_7 - 6\right) \cdot x1\right), x1, \left(3 - t\_7\right), \left(t\_7 \cdot \left(x1 + x1\right)\right)\right) + t\_5\right) + t\_0\right) + x1\right) + t\_6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{4} \cdot 6 + x1\right) + 9\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 70.9%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
Applied rewrites70.9%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around inf
Applied rewrites45.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x1 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (* (* 3 x1) x1))
(t_3 (/ (- (+ t_2 (* 2 x2)) x1) t_1))
(t_4 (- (* x1 x1) -1))
(t_5 (/ (+ (- (+ x2 x2) x1) t_2) t_4)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_3) (- t_3 3))
(* (* x1 x1) (- (* 4 t_3) 6)))
t_1)
(* t_2 t_3))
t_0)
x1)
(* 3 (/ (- (- t_2 (* 2 x2)) x1) t_1))))
INFINITY)
(+
(-
(*
(-
(* (- (* 4 t_5) 6) (* x1 x1))
(* (- 3 t_5) (* t_5 (+ x1 x1))))
t_4)
(- (* (* -3 (* x1 x1)) t_5) t_0))
(+ (- x1 (* -3 (/ (- t_2 (+ (+ x2 x2) x1)) t_4))) x1))
(+ x1 (+ (+ (* (pow x1 4) 6) x1) 9)))))double code(double x1, double x2) {
double t_0 = (x1 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = (3.0 * x1) * x1;
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_4 = (x1 * x1) - -1.0;
double t_5 = (((x2 + x2) - x1) + t_2) / t_4;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_1) + (t_2 * t_3)) + t_0) + x1) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = ((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_4) - (((-3.0 * (x1 * x1)) * t_5) - t_0)) + ((x1 - (-3.0 * ((t_2 - ((x2 + x2) + x1)) / t_4))) + x1);
} else {
tmp = x1 + (((pow(x1, 4.0) * 6.0) + x1) + 9.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = (3.0 * x1) * x1;
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_4 = (x1 * x1) - -1.0;
double t_5 = (((x2 + x2) - x1) + t_2) / t_4;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_1) + (t_2 * t_3)) + t_0) + x1) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)))) <= Double.POSITIVE_INFINITY) {
tmp = ((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_4) - (((-3.0 * (x1 * x1)) * t_5) - t_0)) + ((x1 - (-3.0 * ((t_2 - ((x2 + x2) + x1)) / t_4))) + x1);
} else {
tmp = x1 + (((Math.pow(x1, 4.0) * 6.0) + x1) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = (3.0 * x1) * x1 t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1 t_4 = (x1 * x1) - -1.0 t_5 = (((x2 + x2) - x1) + t_2) / t_4 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_1) + (t_2 * t_3)) + t_0) + x1) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)))) <= math.inf: tmp = ((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_4) - (((-3.0 * (x1 * x1)) * t_5) - t_0)) + ((x1 - (-3.0 * ((t_2 - ((x2 + x2) + x1)) / t_4))) + x1) else: tmp = x1 + (((math.pow(x1, 4.0) * 6.0) + x1) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(3.0 * x1) * x1) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) t_4 = Float64(Float64(x1 * x1) - -1.0) t_5 = Float64(Float64(Float64(Float64(x2 + x2) - x1) + t_2) / t_4) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0))) * t_1) + Float64(t_2 * t_3)) + t_0) + x1) + Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(4.0 * t_5) - 6.0) * Float64(x1 * x1)) - Float64(Float64(3.0 - t_5) * Float64(t_5 * Float64(x1 + x1)))) * t_4) - Float64(Float64(Float64(-3.0 * Float64(x1 * x1)) * t_5) - t_0)) + Float64(Float64(x1 - Float64(-3.0 * Float64(Float64(t_2 - Float64(Float64(x2 + x2) + x1)) / t_4))) + x1)); else tmp = Float64(x1 + Float64(Float64(Float64((x1 ^ 4.0) * 6.0) + x1) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = (3.0 * x1) * x1; t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1; t_4 = (x1 * x1) - -1.0; t_5 = (((x2 + x2) - x1) + t_2) / t_4; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_1) + (t_2 * t_3)) + t_0) + x1) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = ((((((4.0 * t_5) - 6.0) * (x1 * x1)) - ((3.0 - t_5) * (t_5 * (x1 + x1)))) * t_4) - (((-3.0 * (x1 * x1)) * t_5) - t_0)) + ((x1 - (-3.0 * ((t_2 - ((x2 + x2) + x1)) / t_4))) + x1); else tmp = x1 + ((((x1 ^ 4.0) * 6.0) + x1) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(3 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] - -1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision] + t$95$2), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2 * x1), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4 * t$95$3), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision] + x1), $MachinePrecision] + N[(3 * N[(N[(N[(t$95$2 - N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(N[(4 * t$95$5), $MachinePrecision] - 6), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(3 - t$95$5), $MachinePrecision] * N[(t$95$5 * N[(x1 + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] - N[(N[(N[(-3 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * t$95$5), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 - N[(-3 * N[(N[(t$95$2 - N[(N[(x2 + x2), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(N[(N[Power[x1, 4], $MachinePrecision] * 6), $MachinePrecision] + x1), $MachinePrecision] + 9), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \left(x1 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \left(3 \cdot x1\right) \cdot x1\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_1}\\
t_4 := x1 \cdot x1 - -1\\
t_5 := \frac{\left(\left(x2 + x2\right) - x1\right) + t\_2}{t\_4}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_3 - 6\right)\right) \cdot t\_1 + t\_2 \cdot t\_3\right) + t\_0\right) + x1\right) + 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_1}\right) \leq \infty:\\
\;\;\;\;\left(\left(\left(4 \cdot t\_5 - 6\right) \cdot \left(x1 \cdot x1\right) - \left(3 - t\_5\right) \cdot \left(t\_5 \cdot \left(x1 + x1\right)\right)\right) \cdot t\_4 - \left(\left(-3 \cdot \left(x1 \cdot x1\right)\right) \cdot t\_5 - t\_0\right)\right) + \left(\left(x1 - -3 \cdot \frac{t\_2 - \left(\left(x2 + x2\right) + x1\right)}{t\_4}\right) + x1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{4} \cdot 6 + x1\right) + 9\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 70.9%
Applied rewrites70.9%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around inf
Applied rewrites45.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (/ (- (+ t_0 (* 2 x2)) x1) t_1))
(t_3 (* t_0 t_2))
(t_4 (- (* x1 x1) -1))
(t_5 (* (* x1 x1) x1))
(t_6 (/ (+ (- (+ x2 x2) x1) t_0) t_4))
(t_7
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_2) (- t_2 3))
(* (* x1 x1) (- (* 4 t_2) 6)))
t_1)
t_3)
t_5)
x1)
(* 3 (/ (- (- t_0 (* 2 x2)) x1) t_1)))))
(t_8 (- (+ x2 x2) (- x1 t_0))))
(if (<=
t_7
1000000000000000046753818885456127989189605431330410286841364872744016439394555894610368258180303336939076888134044950289326168184662430331474313277416979816387389279864637935586997520238352311022660078293728671385192933261062303434752638026781377548741967884639283445760)
(+
(+
(+
(*
(+
(* (* x1 x1) (- (* (/ -4 (- -1 (* x1 x1))) t_8) 6))
(* (- (/ t_8 t_4) 3) (/ (* (+ x1 x1) t_8) t_4)))
t_4)
(+ (/ (* t_0 t_8) t_4) t_5))
(+ x1 (/ (* 3 (- (- (- t_0 x2) x2) x1)) t_4)))
x1)
(if (<= t_7 INFINITY)
(+
x1
(+
(+
(+
(+
(134-z0z1z2z3z4
t_4
(* 6 x1)
x1
(- 3 t_6)
(* t_6 (+ x1 x1)))
t_3)
t_5)
x1)
(* 3 (+ (* -2 x2) (* -1 x1)))))
(+ x1 (+ (+ (* (pow x1 4) 6) x1) 9))))))\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := t\_0 \cdot t\_2\\
t_4 := x1 \cdot x1 - -1\\
t_5 := \left(x1 \cdot x1\right) \cdot x1\\
t_6 := \frac{\left(\left(x2 + x2\right) - x1\right) + t\_0}{t\_4}\\
t_7 := x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_3\right) + t\_5\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
t_8 := \left(x2 + x2\right) - \left(x1 - t\_0\right)\\
\mathbf{if}\;t\_7 \leq 1000000000000000046753818885456127989189605431330410286841364872744016439394555894610368258180303336939076888134044950289326168184662430331474313277416979816387389279864637935586997520238352311022660078293728671385192933261062303434752638026781377548741967884639283445760:\\
\;\;\;\;\left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(\frac{-4}{-1 - x1 \cdot x1} \cdot t\_8 - 6\right) + \left(\frac{t\_8}{t\_4} - 3\right) \cdot \frac{\left(x1 + x1\right) \cdot t\_8}{t\_4}\right) \cdot t\_4 + \left(\frac{t\_0 \cdot t\_8}{t\_4} + t\_5\right)\right) + \left(x1 + \frac{3 \cdot \left(\left(\left(t\_0 - x2\right) - x2\right) - x1\right)}{t\_4}\right)\right) + x1\\
\mathbf{elif}\;t\_7 \leq \infty:\\
\;\;\;\;x1 + \left(\left(\left(\left(\mathsf{134\_z0z1z2z3z4}\left(t\_4, \left(6 \cdot x1\right), x1, \left(3 - t\_6\right), \left(t\_6 \cdot \left(x1 + x1\right)\right)\right) + t\_3\right) + t\_5\right) + x1\right) + 3 \cdot \left(-2 \cdot x2 + -1 \cdot x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{4} \cdot 6 + x1\right) + 9\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1e270Initial program 70.9%
lift-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
div-subN/A
mult-flipN/A
mult-flipN/A
lower-134-z0z1z2z3z4N/A
Applied rewrites70.9%
Applied rewrites66.5%
if 1e270 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 70.9%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
Applied rewrites70.9%
Taylor expanded in x1 around inf
Applied rewrites68.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6468.7%
Applied rewrites68.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around inf
Applied rewrites45.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x1 x1) x1))
(t_1 (* (* 3 x1) x1))
(t_2 (- (* x1 x1) -1))
(t_3 (+ (* x1 x1) 1))
(t_4 (/ (- (+ t_1 (* 2 x2)) x1) t_3))
(t_5 (* t_1 t_4))
(t_6
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_4) (- t_4 3))
(* (* x1 x1) (- (* 4 t_4) 6)))
t_3)
t_5)
t_0)
x1)
(* 3 (/ (- (- t_1 (* 2 x2)) x1) t_3)))))
(t_7 (+ (- (+ x2 x2) x1) t_1))
(t_8 (/ t_7 t_2))
(t_9 (- 3 t_8))
(t_10 (* t_8 (+ x1 x1))))
(if (<=
t_6
49999999999999999737683287595902466157897305225341087810970847365954154269153922568421376)
(+
(+
(/
(+
(* (- t_1 (+ (+ x2 x2) x1)) 3)
(+
(*
(* (- (* (- (* 4 t_8) 6) (* x1 x1)) (* t_9 t_10)) t_2)
t_2)
(* t_7 t_1)))
t_2)
(* t_2 x1))
x1)
(if (<= t_6 INFINITY)
(+
x1
(+
(+
(+ (+ (134-z0z1z2z3z4 t_2 (* 6 x1) x1 t_9 t_10) t_5) t_0)
x1)
(* 3 (+ (* -2 x2) (* -1 x1)))))
(+ x1 (+ (+ (* (pow x1 4) 6) x1) 9))))))\begin{array}{l}
t_0 := \left(x1 \cdot x1\right) \cdot x1\\
t_1 := \left(3 \cdot x1\right) \cdot x1\\
t_2 := x1 \cdot x1 - -1\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := t\_1 \cdot t\_4\\
t_6 := x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_4 - 6\right)\right) \cdot t\_3 + t\_5\right) + t\_0\right) + x1\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3}\right)\\
t_7 := \left(\left(x2 + x2\right) - x1\right) + t\_1\\
t_8 := \frac{t\_7}{t\_2}\\
t_9 := 3 - t\_8\\
t_10 := t\_8 \cdot \left(x1 + x1\right)\\
\mathbf{if}\;t\_6 \leq 49999999999999999737683287595902466157897305225341087810970847365954154269153922568421376:\\
\;\;\;\;\left(\frac{\left(t\_1 - \left(\left(x2 + x2\right) + x1\right)\right) \cdot 3 + \left(\left(\left(\left(4 \cdot t\_8 - 6\right) \cdot \left(x1 \cdot x1\right) - t\_9 \cdot t\_10\right) \cdot t\_2\right) \cdot t\_2 + t\_7 \cdot t\_1\right)}{t\_2} + t\_2 \cdot x1\right) + x1\\
\mathbf{elif}\;t\_6 \leq \infty:\\
\;\;\;\;x1 + \left(\left(\left(\left(\mathsf{134\_z0z1z2z3z4}\left(t\_2, \left(6 \cdot x1\right), x1, t\_9, t\_10\right) + t\_5\right) + t\_0\right) + x1\right) + 3 \cdot \left(-2 \cdot x2 + -1 \cdot x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{4} \cdot 6 + x1\right) + 9\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 5e88Initial program 70.9%
Applied rewrites66.4%
if 5e88 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 70.9%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
Applied rewrites70.9%
Taylor expanded in x1 around inf
Applied rewrites68.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6468.7%
Applied rewrites68.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around inf
Applied rewrites45.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (/ (- (+ t_0 (* 2 x2)) x1) t_1))
(t_3 (* t_0 t_2))
(t_4 (- (* x1 x1) -1))
(t_5 (* (* x1 x1) x1))
(t_6 (/ (+ (- (+ x2 x2) x1) t_0) t_4)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_2) (- t_2 3))
(* (* x1 x1) (- (* 4 t_2) 6)))
t_1)
t_3)
t_5)
x1)
(* 3 (/ (- (- t_0 (* 2 x2)) x1) t_1))))
INFINITY)
(+
x1
(+
(+
(+
(+
(134-z0z1z2z3z4 t_4 (* 6 x1) x1 (- 3 t_6) (* t_6 (+ x1 x1)))
t_3)
t_5)
x1)
(* 3 (+ (* -2 x2) (* -1 x1)))))
(+ x1 (+ (+ (* (pow x1 4) 6) x1) 9)))))\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := t\_0 \cdot t\_2\\
t_4 := x1 \cdot x1 - -1\\
t_5 := \left(x1 \cdot x1\right) \cdot x1\\
t_6 := \frac{\left(\left(x2 + x2\right) - x1\right) + t\_0}{t\_4}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_3\right) + t\_5\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(\left(\left(\mathsf{134\_z0z1z2z3z4}\left(t\_4, \left(6 \cdot x1\right), x1, \left(3 - t\_6\right), \left(t\_6 \cdot \left(x1 + x1\right)\right)\right) + t\_3\right) + t\_5\right) + x1\right) + 3 \cdot \left(-2 \cdot x2 + -1 \cdot x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{4} \cdot 6 + x1\right) + 9\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 70.9%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
Applied rewrites70.9%
Taylor expanded in x1 around inf
Applied rewrites68.7%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6468.7%
Applied rewrites68.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around inf
Applied rewrites45.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2 x2) 3))
(t_1
(+
x1
(+
(*
(pow x1 4)
(+
6
(*
-1
(/
(+
3
(*
-1
(/
(+
9
(+
(* -1 (/ (+ 2 (* -2 (+ 1 (* 3 t_0)))) x1))
(* 4 t_0)))
x1)))
x1))))
9))))
(if (<= x1 -1350)
t_1
(if (<= x1 7148113328562451/4611686018427387904)
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))
t_1))))double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 + ((pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((2.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1)))) + 9.0);
double tmp;
if (x1 <= -1350.0) {
tmp = t_1;
} else if (x1 <= 0.00155) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} 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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = x1 + (((x1 ** 4.0d0) * (6.0d0 + ((-1.0d0) * ((3.0d0 + ((-1.0d0) * ((9.0d0 + (((-1.0d0) * ((2.0d0 + ((-2.0d0) * (1.0d0 + (3.0d0 * t_0)))) / x1)) + (4.0d0 * t_0))) / x1))) / x1)))) + 9.0d0)
if (x1 <= (-1350.0d0)) then
tmp = t_1
else if (x1 <= 0.00155d0) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 + ((Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((2.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1)))) + 9.0);
double tmp;
if (x1 <= -1350.0) {
tmp = t_1;
} else if (x1 <= 0.00155) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = x1 + ((math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((2.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1)))) + 9.0) tmp = 0 if x1 <= -1350.0: tmp = t_1 elif x1 <= 0.00155: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(x1 + Float64(Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + Float64(Float64(-1.0 * Float64(Float64(2.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_0)))) / x1)) + Float64(4.0 * t_0))) / x1))) / x1)))) + 9.0)) tmp = 0.0 if (x1 <= -1350.0) tmp = t_1; elseif (x1 <= 0.00155) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = x1 + (((x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((2.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + (4.0 * t_0))) / x1))) / x1)))) + 9.0); tmp = 0.0; if (x1 <= -1350.0) tmp = t_1; elseif (x1 <= 0.00155) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2 * x2), $MachinePrecision] - 3), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(N[Power[x1, 4], $MachinePrecision] * N[(6 + N[(-1 * N[(N[(3 + N[(-1 * N[(N[(9 + N[(N[(-1 * N[(N[(2 + N[(-2 * N[(1 + N[(3 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] + N[(4 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1350], t$95$1, If[LessEqual[x1, 7148113328562451/4611686018427387904], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 + \left({x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{2 + -2 \cdot \left(1 + 3 \cdot t\_0\right)}{x1} + 4 \cdot t\_0\right)}{x1}}{x1}\right) + 9\right)\\
\mathbf{if}\;x1 \leq -1350:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq \frac{7148113328562451}{4611686018427387904}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x1 < -1350 or 0.0015499999999999999 < x1 Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around -inf
Applied rewrites47.6%
if -1350 < x1 < 0.0015499999999999999Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2 x2) 3)) (t_1 (* 4 t_0)))
(if (<= x1 -1350)
(*
(pow x1 4)
(+
6
(*
-1
(/
(+
3
(*
-1
(/
(+ 9 (+ (* -1 (/ (+ 1 (* -2 (+ 1 (* 3 t_0)))) x1)) t_1))
x1)))
x1))))
(if (<= x1 7148113328562451/4611686018427387904)
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))
(+
x1
(+
(+
(*
(pow x1 4)
(+ 6 (* -1 (/ (+ 3 (* -1 (/ (+ 9 t_1) x1))) x1))))
x1)
9))))))double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = 4.0 * t_0;
double tmp;
if (x1 <= -1350.0) {
tmp = pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + t_1)) / x1))) / x1)));
} else if (x1 <= 0.00155) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = x1 + (((pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + t_1) / x1))) / x1)))) + x1) + 9.0);
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = 4.0d0 * t_0
if (x1 <= (-1350.0d0)) then
tmp = (x1 ** 4.0d0) * (6.0d0 + ((-1.0d0) * ((3.0d0 + ((-1.0d0) * ((9.0d0 + (((-1.0d0) * ((1.0d0 + ((-2.0d0) * (1.0d0 + (3.0d0 * t_0)))) / x1)) + t_1)) / x1))) / x1)))
else if (x1 <= 0.00155d0) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = x1 + ((((x1 ** 4.0d0) * (6.0d0 + ((-1.0d0) * ((3.0d0 + ((-1.0d0) * ((9.0d0 + t_1) / x1))) / x1)))) + x1) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = 4.0 * t_0;
double tmp;
if (x1 <= -1350.0) {
tmp = Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + t_1)) / x1))) / x1)));
} else if (x1 <= 0.00155) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = x1 + (((Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + t_1) / x1))) / x1)))) + x1) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = 4.0 * t_0 tmp = 0 if x1 <= -1350.0: tmp = math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + t_1)) / x1))) / x1))) elif x1 <= 0.00155: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = x1 + (((math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + t_1) / x1))) / x1)))) + x1) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(4.0 * t_0) tmp = 0.0 if (x1 <= -1350.0) tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + Float64(Float64(-1.0 * Float64(Float64(1.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_0)))) / x1)) + t_1)) / x1))) / x1)))); elseif (x1 <= 0.00155) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(x1 + Float64(Float64(Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + t_1) / x1))) / x1)))) + x1) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = 4.0 * t_0; tmp = 0.0; if (x1 <= -1350.0) tmp = (x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + ((-1.0 * ((1.0 + (-2.0 * (1.0 + (3.0 * t_0)))) / x1)) + t_1)) / x1))) / x1))); elseif (x1 <= 0.00155) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = x1 + ((((x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + t_1) / x1))) / x1)))) + x1) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2 * x2), $MachinePrecision] - 3), $MachinePrecision]}, Block[{t$95$1 = N[(4 * t$95$0), $MachinePrecision]}, If[LessEqual[x1, -1350], N[(N[Power[x1, 4], $MachinePrecision] * N[(6 + N[(-1 * N[(N[(3 + N[(-1 * N[(N[(9 + N[(N[(-1 * N[(N[(1 + N[(-2 * N[(1 + N[(3 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7148113328562451/4611686018427387904], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(N[(N[Power[x1, 4], $MachinePrecision] * N[(6 + N[(-1 * N[(N[(3 + N[(-1 * N[(N[(9 + t$95$1), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + 9), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := 4 \cdot t\_0\\
\mathbf{if}\;x1 \leq -1350:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + \left(-1 \cdot \frac{1 + -2 \cdot \left(1 + 3 \cdot t\_0\right)}{x1} + t\_1\right)}{x1}}{x1}\right)\\
\mathbf{elif}\;x1 \leq \frac{7148113328562451}{4611686018427387904}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + t\_1}{x1}}{x1}\right) + x1\right) + 9\right)\\
\end{array}
if x1 < -1350Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6481.0%
Applied rewrites81.0%
Taylor expanded in x1 around -inf
Applied rewrites48.1%
if -1350 < x1 < 0.0015499999999999999Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
if 0.0015499999999999999 < x1 Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
Applied rewrites47.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
(*
(pow x1 4)
(+
6
(*
-1
(/ (+ 3 (* -1 (/ (+ 9 (* 4 (- (* 2 x2) 3))) x1))) x1))))
x1)))
(if (<= x1 -1350)
(+ x1 (+ t_0 (+ (* -6 x2) (* -3 x1))))
(if (<= x1 7148113328562451/4611686018427387904)
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))
(+ x1 (+ t_0 9))))))double code(double x1, double x2) {
double t_0 = (pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1))) / x1)))) + x1;
double tmp;
if (x1 <= -1350.0) {
tmp = x1 + (t_0 + ((-6.0 * x2) + (-3.0 * x1)));
} else if (x1 <= 0.00155) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = x1 + (t_0 + 9.0);
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = ((x1 ** 4.0d0) * (6.0d0 + ((-1.0d0) * ((3.0d0 + ((-1.0d0) * ((9.0d0 + (4.0d0 * ((2.0d0 * x2) - 3.0d0))) / x1))) / x1)))) + x1
if (x1 <= (-1350.0d0)) then
tmp = x1 + (t_0 + (((-6.0d0) * x2) + ((-3.0d0) * x1)))
else if (x1 <= 0.00155d0) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = x1 + (t_0 + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1))) / x1)))) + x1;
double tmp;
if (x1 <= -1350.0) {
tmp = x1 + (t_0 + ((-6.0 * x2) + (-3.0 * x1)));
} else if (x1 <= 0.00155) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = x1 + (t_0 + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = (math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1))) / x1)))) + x1 tmp = 0 if x1 <= -1350.0: tmp = x1 + (t_0 + ((-6.0 * x2) + (-3.0 * x1))) elif x1 <= 0.00155: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = x1 + (t_0 + 9.0) return tmp
function code(x1, x2) t_0 = Float64(Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0))) / x1))) / x1)))) + x1) tmp = 0.0 if (x1 <= -1350.0) tmp = Float64(x1 + Float64(t_0 + Float64(Float64(-6.0 * x2) + Float64(-3.0 * x1)))); elseif (x1 <= 0.00155) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(x1 + Float64(t_0 + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = ((x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1))) / x1)))) + x1; tmp = 0.0; if (x1 <= -1350.0) tmp = x1 + (t_0 + ((-6.0 * x2) + (-3.0 * x1))); elseif (x1 <= 0.00155) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = x1 + (t_0 + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[Power[x1, 4], $MachinePrecision] * N[(6 + N[(-1 * N[(N[(3 + N[(-1 * N[(N[(9 + N[(4 * N[(N[(2 * x2), $MachinePrecision] - 3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -1350], N[(x1 + N[(t$95$0 + N[(N[(-6 * x2), $MachinePrecision] + N[(-3 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7148113328562451/4611686018427387904], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$0 + 9), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := {x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + 4 \cdot \left(2 \cdot x2 - 3\right)}{x1}}{x1}\right) + x1\\
\mathbf{if}\;x1 \leq -1350:\\
\;\;\;\;x1 + \left(t\_0 + \left(-6 \cdot x2 + -3 \cdot x1\right)\right)\\
\mathbf{elif}\;x1 \leq \frac{7148113328562451}{4611686018427387904}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t\_0 + 9\right)\\
\end{array}
if x1 < -1350Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6481.0%
Applied rewrites81.0%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
Applied rewrites61.2%
if -1350 < x1 < 0.0015499999999999999Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
if 0.0015499999999999999 < x1 Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
Applied rewrites47.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+
(+
(*
(pow x1 4)
(+
6
(*
-1
(/ (+ 3 (* -1 (/ (+ 9 (* 4 (- (* 2 x2) 3))) x1))) x1))))
x1)
9))))
(if (<= x1 -1350)
t_0
(if (<= x1 7148113328562451/4611686018427387904)
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))
t_0))))double code(double x1, double x2) {
double t_0 = x1 + (((pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1))) / x1)))) + x1) + 9.0);
double tmp;
if (x1 <= -1350.0) {
tmp = t_0;
} else if (x1 <= 0.00155) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = t_0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((((x1 ** 4.0d0) * (6.0d0 + ((-1.0d0) * ((3.0d0 + ((-1.0d0) * ((9.0d0 + (4.0d0 * ((2.0d0 * x2) - 3.0d0))) / x1))) / x1)))) + x1) + 9.0d0)
if (x1 <= (-1350.0d0)) then
tmp = t_0
else if (x1 <= 0.00155d0) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (((Math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1))) / x1)))) + x1) + 9.0);
double tmp;
if (x1 <= -1350.0) {
tmp = t_0;
} else if (x1 <= 0.00155) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (((math.pow(x1, 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1))) / x1)))) + x1) + 9.0) tmp = 0 if x1 <= -1350.0: tmp = t_0 elif x1 <= 0.00155: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-1.0 * Float64(Float64(3.0 + Float64(-1.0 * Float64(Float64(9.0 + Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0))) / x1))) / x1)))) + x1) + 9.0)) tmp = 0.0 if (x1 <= -1350.0) tmp = t_0; elseif (x1 <= 0.00155) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((((x1 ^ 4.0) * (6.0 + (-1.0 * ((3.0 + (-1.0 * ((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1))) / x1)))) + x1) + 9.0); tmp = 0.0; if (x1 <= -1350.0) tmp = t_0; elseif (x1 <= 0.00155) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(N[(N[Power[x1, 4], $MachinePrecision] * N[(6 + N[(-1 * N[(N[(3 + N[(-1 * N[(N[(9 + N[(4 * N[(N[(2 * x2), $MachinePrecision] - 3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + 9), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1350], t$95$0, If[LessEqual[x1, 7148113328562451/4611686018427387904], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x1 + \left(\left({x1}^{4} \cdot \left(6 + -1 \cdot \frac{3 + -1 \cdot \frac{9 + 4 \cdot \left(2 \cdot x2 - 3\right)}{x1}}{x1}\right) + x1\right) + 9\right)\\
\mathbf{if}\;x1 \leq -1350:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq \frac{7148113328562451}{4611686018427387904}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x1 < -1350 or 0.0015499999999999999 < x1 Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
Applied rewrites47.9%
if -1350 < x1 < 0.0015499999999999999Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x1 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (- (* x1 x1) -1))
(t_3 (* (* 3 x1) x1))
(t_4 (/ (- (+ t_3 (* 2 x2)) x1) t_1))
(t_5 (* t_3 t_4))
(t_6 (* 3 (/ (- (- t_3 (* 2 x2)) x1) t_1))))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_4) (- t_4 3))
(* (* x1 x1) (- (* 4 t_4) 6)))
t_1)
t_5)
t_0)
x1)
t_6))
INFINITY)
(+
x1
(+
(+
(+
(+
(134-z0z1z2z3z4
t_2
(* 6 x1)
x1
(- 3 (* 2 x2))
(* (/ (+ (- (+ x2 x2) x1) t_3) t_2) (+ x1 x1)))
t_5)
t_0)
x1)
t_6))
(+ x1 (+ (+ (* (pow x1 4) 6) x1) 9)))))\begin{array}{l}
t_0 := \left(x1 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot x1 - -1\\
t_3 := \left(3 \cdot x1\right) \cdot x1\\
t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_1}\\
t_5 := t\_3 \cdot t\_4\\
t_6 := 3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_4 - 6\right)\right) \cdot t\_1 + t\_5\right) + t\_0\right) + x1\right) + t\_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(\left(\left(\mathsf{134\_z0z1z2z3z4}\left(t\_2, \left(6 \cdot x1\right), x1, \left(3 - 2 \cdot x2\right), \left(\frac{\left(\left(x2 + x2\right) - x1\right) + t\_3}{t\_2} \cdot \left(x1 + x1\right)\right)\right) + t\_5\right) + t\_0\right) + x1\right) + t\_6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{4} \cdot 6 + x1\right) + 9\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 70.9%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
Applied rewrites70.9%
Taylor expanded in x1 around inf
Applied rewrites68.7%
Taylor expanded in x1 around 0
lower--.f64N/A
lower-*.f6465.8%
Applied rewrites65.8%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around inf
Applied rewrites45.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -31)
(+ x1 (+ (+ (* (pow x1 4) (- 6 (* 3 (/ 1 x1)))) x1) (* -6 x2)))
(if (<= x1 300000000000000000)
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))
(+
x1
(+
(+ (* (pow x1 3) (- (* 6 x1) 3)) x1)
(+ (* -6 x2) (* -3 x1)))))))double code(double x1, double x2) {
double tmp;
if (x1 <= -31.0) {
tmp = x1 + (((pow(x1, 4.0) * (6.0 - (3.0 * (1.0 / x1)))) + x1) + (-6.0 * x2));
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = x1 + (((pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + ((-6.0 * x2) + (-3.0 * x1)));
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-31.0d0)) then
tmp = x1 + ((((x1 ** 4.0d0) * (6.0d0 - (3.0d0 * (1.0d0 / x1)))) + x1) + ((-6.0d0) * x2))
else if (x1 <= 3d+17) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = x1 + ((((x1 ** 3.0d0) * ((6.0d0 * x1) - 3.0d0)) + x1) + (((-6.0d0) * x2) + ((-3.0d0) * x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -31.0) {
tmp = x1 + (((Math.pow(x1, 4.0) * (6.0 - (3.0 * (1.0 / x1)))) + x1) + (-6.0 * x2));
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = x1 + (((Math.pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + ((-6.0 * x2) + (-3.0 * x1)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -31.0: tmp = x1 + (((math.pow(x1, 4.0) * (6.0 - (3.0 * (1.0 / x1)))) + x1) + (-6.0 * x2)) elif x1 <= 3e+17: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = x1 + (((math.pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + ((-6.0 * x2) + (-3.0 * x1))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -31.0) tmp = Float64(x1 + Float64(Float64(Float64((x1 ^ 4.0) * Float64(6.0 - Float64(3.0 * Float64(1.0 / x1)))) + x1) + Float64(-6.0 * x2))); elseif (x1 <= 3e+17) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(x1 + Float64(Float64(Float64((x1 ^ 3.0) * Float64(Float64(6.0 * x1) - 3.0)) + x1) + Float64(Float64(-6.0 * x2) + Float64(-3.0 * x1)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -31.0) tmp = x1 + ((((x1 ^ 4.0) * (6.0 - (3.0 * (1.0 / x1)))) + x1) + (-6.0 * x2)); elseif (x1 <= 3e+17) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = x1 + ((((x1 ^ 3.0) * ((6.0 * x1) - 3.0)) + x1) + ((-6.0 * x2) + (-3.0 * x1))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -31], N[(x1 + N[(N[(N[(N[Power[x1, 4], $MachinePrecision] * N[(6 - N[(3 * N[(1 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(-6 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 300000000000000000], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(N[(N[Power[x1, 3], $MachinePrecision] * N[(N[(6 * x1), $MachinePrecision] - 3), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(N[(-6 * x2), $MachinePrecision] + N[(-3 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x1 \leq -31:\\
\;\;\;\;x1 + \left(\left({x1}^{4} \cdot \left(6 - 3 \cdot \frac{1}{x1}\right) + x1\right) + -6 \cdot x2\right)\\
\mathbf{elif}\;x1 \leq 300000000000000000:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{3} \cdot \left(6 \cdot x1 - 3\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right)\\
\end{array}
if x1 < -31Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around 0
lower-*.f6469.2%
Applied rewrites69.2%
if -31 < x1 < 3e17Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
if 3e17 < x1 Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6481.0%
Applied rewrites81.0%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f6481.0%
Applied rewrites81.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+
(+ (* (pow x1 3) (- (* 6 x1) 3)) x1)
(+ (* -6 x2) (* -3 x1))))))
(if (<= x1 -31)
t_0
(if (<= x1 300000000000000000)
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))
t_0))))double code(double x1, double x2) {
double t_0 = x1 + (((pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + ((-6.0 * x2) + (-3.0 * x1)));
double tmp;
if (x1 <= -31.0) {
tmp = t_0;
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = t_0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((((x1 ** 3.0d0) * ((6.0d0 * x1) - 3.0d0)) + x1) + (((-6.0d0) * x2) + ((-3.0d0) * x1)))
if (x1 <= (-31.0d0)) then
tmp = t_0
else if (x1 <= 3d+17) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (((Math.pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + ((-6.0 * x2) + (-3.0 * x1)));
double tmp;
if (x1 <= -31.0) {
tmp = t_0;
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (((math.pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + ((-6.0 * x2) + (-3.0 * x1))) tmp = 0 if x1 <= -31.0: tmp = t_0 elif x1 <= 3e+17: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(Float64((x1 ^ 3.0) * Float64(Float64(6.0 * x1) - 3.0)) + x1) + Float64(Float64(-6.0 * x2) + Float64(-3.0 * x1)))) tmp = 0.0 if (x1 <= -31.0) tmp = t_0; elseif (x1 <= 3e+17) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((((x1 ^ 3.0) * ((6.0 * x1) - 3.0)) + x1) + ((-6.0 * x2) + (-3.0 * x1))); tmp = 0.0; if (x1 <= -31.0) tmp = t_0; elseif (x1 <= 3e+17) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(N[(N[Power[x1, 3], $MachinePrecision] * N[(N[(6 * x1), $MachinePrecision] - 3), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(N[(-6 * x2), $MachinePrecision] + N[(-3 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -31], t$95$0, If[LessEqual[x1, 300000000000000000], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x1 + \left(\left({x1}^{3} \cdot \left(6 \cdot x1 - 3\right) + x1\right) + \left(-6 \cdot x2 + -3 \cdot x1\right)\right)\\
\mathbf{if}\;x1 \leq -31:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 300000000000000000:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x1 < -31 or 3e17 < x1 Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6481.0%
Applied rewrites81.0%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f6481.0%
Applied rewrites81.0%
if -31 < x1 < 3e17Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -850)
(+ (+ 9 (+ (* (- 6 (/ 3 x1)) (pow x1 4)) x1)) x1)
(if (<= x1 300000000000000000)
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))
(+ x1 (+ (+ (* (pow x1 3) (- (* 6 x1) 3)) x1) 9)))))double code(double x1, double x2) {
double tmp;
if (x1 <= -850.0) {
tmp = (9.0 + (((6.0 - (3.0 / x1)) * pow(x1, 4.0)) + x1)) + x1;
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = x1 + (((pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + 9.0);
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-850.0d0)) then
tmp = (9.0d0 + (((6.0d0 - (3.0d0 / x1)) * (x1 ** 4.0d0)) + x1)) + x1
else if (x1 <= 3d+17) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = x1 + ((((x1 ** 3.0d0) * ((6.0d0 * x1) - 3.0d0)) + x1) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -850.0) {
tmp = (9.0 + (((6.0 - (3.0 / x1)) * Math.pow(x1, 4.0)) + x1)) + x1;
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = x1 + (((Math.pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + 9.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -850.0: tmp = (9.0 + (((6.0 - (3.0 / x1)) * math.pow(x1, 4.0)) + x1)) + x1 elif x1 <= 3e+17: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = x1 + (((math.pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + 9.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -850.0) tmp = Float64(Float64(9.0 + Float64(Float64(Float64(6.0 - Float64(3.0 / x1)) * (x1 ^ 4.0)) + x1)) + x1); elseif (x1 <= 3e+17) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = Float64(x1 + Float64(Float64(Float64((x1 ^ 3.0) * Float64(Float64(6.0 * x1) - 3.0)) + x1) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -850.0) tmp = (9.0 + (((6.0 - (3.0 / x1)) * (x1 ^ 4.0)) + x1)) + x1; elseif (x1 <= 3e+17) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = x1 + ((((x1 ^ 3.0) * ((6.0 * x1) - 3.0)) + x1) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -850], N[(N[(9 + N[(N[(N[(6 - N[(3 / x1), $MachinePrecision]), $MachinePrecision] * N[Power[x1, 4], $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision], If[LessEqual[x1, 300000000000000000], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(N[(N[Power[x1, 3], $MachinePrecision] * N[(N[(6 * x1), $MachinePrecision] - 3), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + 9), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x1 \leq -850:\\
\;\;\;\;\left(9 + \left(\left(6 - \frac{3}{x1}\right) \cdot {x1}^{4} + x1\right)\right) + x1\\
\mathbf{elif}\;x1 \leq 300000000000000000:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left({x1}^{3} \cdot \left(6 \cdot x1 - 3\right) + x1\right) + 9\right)\\
\end{array}
if x1 < -850Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
lift-+.f64N/A
Applied rewrites46.0%
if -850 < x1 < 3e17Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
if 3e17 < x1 Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f6446.0%
Applied rewrites46.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (+ (* (pow x1 3) (- (* 6 x1) 3)) x1) 9))))
(if (<= x1 -850)
t_0
(if (<= x1 300000000000000000)
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))
t_0))))double code(double x1, double x2) {
double t_0 = x1 + (((pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + 9.0);
double tmp;
if (x1 <= -850.0) {
tmp = t_0;
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = t_0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((((x1 ** 3.0d0) * ((6.0d0 * x1) - 3.0d0)) + x1) + 9.0d0)
if (x1 <= (-850.0d0)) then
tmp = t_0
else if (x1 <= 3d+17) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (((Math.pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + 9.0);
double tmp;
if (x1 <= -850.0) {
tmp = t_0;
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (((math.pow(x1, 3.0) * ((6.0 * x1) - 3.0)) + x1) + 9.0) tmp = 0 if x1 <= -850.0: tmp = t_0 elif x1 <= 3e+17: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(Float64((x1 ^ 3.0) * Float64(Float64(6.0 * x1) - 3.0)) + x1) + 9.0)) tmp = 0.0 if (x1 <= -850.0) tmp = t_0; elseif (x1 <= 3e+17) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((((x1 ^ 3.0) * ((6.0 * x1) - 3.0)) + x1) + 9.0); tmp = 0.0; if (x1 <= -850.0) tmp = t_0; elseif (x1 <= 3e+17) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(N[(N[Power[x1, 3], $MachinePrecision] * N[(N[(6 * x1), $MachinePrecision] - 3), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + 9), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -850], t$95$0, If[LessEqual[x1, 300000000000000000], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x1 + \left(\left({x1}^{3} \cdot \left(6 \cdot x1 - 3\right) + x1\right) + 9\right)\\
\mathbf{if}\;x1 \leq -850:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 300000000000000000:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x1 < -850 or 3e17 < x1 Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around 0
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f6446.0%
Applied rewrites46.0%
if -850 < x1 < 3e17Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (+ (* (pow x1 4) 6) x1) 9))))
(if (<= x1 -850)
t_0
(if (<= x1 300000000000000000)
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))
t_0))))double code(double x1, double x2) {
double t_0 = x1 + (((pow(x1, 4.0) * 6.0) + x1) + 9.0);
double tmp;
if (x1 <= -850.0) {
tmp = t_0;
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = t_0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((((x1 ** 4.0d0) * 6.0d0) + x1) + 9.0d0)
if (x1 <= (-850.0d0)) then
tmp = t_0
else if (x1 <= 3d+17) then
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (((Math.pow(x1, 4.0) * 6.0) + x1) + 9.0);
double tmp;
if (x1 <= -850.0) {
tmp = t_0;
} else if (x1 <= 3e+17) {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (((math.pow(x1, 4.0) * 6.0) + x1) + 9.0) tmp = 0 if x1 <= -850.0: tmp = t_0 elif x1 <= 3e+17: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(Float64((x1 ^ 4.0) * 6.0) + x1) + 9.0)) tmp = 0.0 if (x1 <= -850.0) tmp = t_0; elseif (x1 <= 3e+17) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((((x1 ^ 4.0) * 6.0) + x1) + 9.0); tmp = 0.0; if (x1 <= -850.0) tmp = t_0; elseif (x1 <= 3e+17) tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(N[(N[Power[x1, 4], $MachinePrecision] * 6), $MachinePrecision] + x1), $MachinePrecision] + 9), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -850], t$95$0, If[LessEqual[x1, 300000000000000000], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x1 + \left(\left({x1}^{4} \cdot 6 + x1\right) + 9\right)\\
\mathbf{if}\;x1 \leq -850:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 300000000000000000:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x1 < -850 or 3e17 < x1 Initial program 70.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6456.4%
Applied rewrites56.4%
Taylor expanded in x1 around inf
Applied rewrites46.0%
Taylor expanded in x1 around inf
Applied rewrites45.7%
if -850 < x1 < 3e17Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
(FPCore (x1 x2)
:precision binary64
(if (<=
x1
-10500000000000000498709617261614356196923244486430150744980861873802189582763267457024)
(+ (* -6 x2) (* x1 (- (* x1 (+ 9 (* -19 x1))) 1)))
(+ (* -1 x1) (* x2 (- (+ (* -12 x1) (* 8 (* x1 x2))) 6)))))double code(double x1, double x2) {
double tmp;
if (x1 <= -1.05e+85) {
tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0));
} else {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.05d+85)) then
tmp = ((-6.0d0) * x2) + (x1 * ((x1 * (9.0d0 + ((-19.0d0) * x1))) - 1.0d0))
else
tmp = ((-1.0d0) * x1) + (x2 * ((((-12.0d0) * x1) + (8.0d0 * (x1 * x2))) - 6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.05e+85) {
tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0));
} else {
tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.05e+85: tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0)) else: tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.05e+85) tmp = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(-19.0 * x1))) - 1.0))); else tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(Float64(-12.0 * x1) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.05e+85) tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0)); else tmp = (-1.0 * x1) + (x2 * (((-12.0 * x1) + (8.0 * (x1 * x2))) - 6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -10500000000000000498709617261614356196923244486430150744980861873802189582763267457024], N[(N[(-6 * x2), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9 + N[(-19 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(N[(-12 * x1), $MachinePrecision] + N[(8 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x1 \leq -10500000000000000498709617261614356196923244486430150744980861873802189582763267457024:\\
\;\;\;\;-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(9 + -19 \cdot x1\right) - 1\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(\left(-12 \cdot x1 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\end{array}
if x1 < -1.05e85Initial program 70.9%
Taylor expanded in x1 around 0
Applied rewrites50.5%
Taylor expanded in x2 around 0
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
if -1.05e85 < x1 Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.7%
Applied rewrites60.7%
(FPCore (x1 x2)
:precision binary64
(if (<=
x1
-10500000000000000498709617261614356196923244486430150744980861873802189582763267457024)
(+ (* -6 x2) (* x1 (- (* x1 (+ 9 (* -19 x1))) 1)))
(+ (* -6 x2) (* x1 (- (* x2 (- (* 8 x2) 12)) 1)))))double code(double x1, double x2) {
double tmp;
if (x1 <= -1.05e+85) {
tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0));
} else {
tmp = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0));
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.05d+85)) then
tmp = ((-6.0d0) * x2) + (x1 * ((x1 * (9.0d0 + ((-19.0d0) * x1))) - 1.0d0))
else
tmp = ((-6.0d0) * x2) + (x1 * ((x2 * ((8.0d0 * x2) - 12.0d0)) - 1.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.05e+85) {
tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0));
} else {
tmp = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.05e+85: tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0)) else: tmp = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.05e+85) tmp = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(-19.0 * x1))) - 1.0))); else tmp = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(x2 * Float64(Float64(8.0 * x2) - 12.0)) - 1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.05e+85) tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0)); else tmp = (-6.0 * x2) + (x1 * ((x2 * ((8.0 * x2) - 12.0)) - 1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -10500000000000000498709617261614356196923244486430150744980861873802189582763267457024], N[(N[(-6 * x2), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9 + N[(-19 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-6 * x2), $MachinePrecision] + N[(x1 * N[(N[(x2 * N[(N[(8 * x2), $MachinePrecision] - 12), $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x1 \leq -10500000000000000498709617261614356196923244486430150744980861873802189582763267457024:\\
\;\;\;\;-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(9 + -19 \cdot x1\right) - 1\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot x2 + x1 \cdot \left(x2 \cdot \left(8 \cdot x2 - 12\right) - 1\right)\\
\end{array}
if x1 < -1.05e85Initial program 70.9%
Taylor expanded in x1 around 0
Applied rewrites50.5%
Taylor expanded in x2 around 0
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
if -1.05e85 < x1 Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f6455.0%
Applied rewrites55.0%
(FPCore (x1 x2)
:precision binary64
(if (<=
x1
3389627864620585/65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716032)
(+ (* -6 x2) (* x1 (- (* x1 (+ 9 (* -19 x1))) 1)))
(* x1 (- (* 4 (* x2 (- (* 2 x2) 3))) 1))))double code(double x1, double x2) {
double tmp;
if (x1 <= 5.2e-77) {
tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0));
} else {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0);
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 5.2d-77) then
tmp = ((-6.0d0) * x2) + (x1 * ((x1 * (9.0d0 + ((-19.0d0) * x1))) - 1.0d0))
else
tmp = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 1.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 5.2e-77) {
tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0));
} else {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 5.2e-77: tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0)) else: tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 5.2e-77) tmp = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(-19.0 * x1))) - 1.0))); else tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 1.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 5.2e-77) tmp = (-6.0 * x2) + (x1 * ((x1 * (9.0 + (-19.0 * x1))) - 1.0)); else tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 3389627864620585/65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716032], N[(N[(-6 * x2), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9 + N[(-19 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(4 * N[(x2 * N[(N[(2 * x2), $MachinePrecision] - 3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x1 \leq \frac{3389627864620585}{65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716032}:\\
\;\;\;\;-6 \cdot x2 + x1 \cdot \left(x1 \cdot \left(9 + -19 \cdot x1\right) - 1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 1\right)\\
\end{array}
if x1 < 5.2000000000000002e-77Initial program 70.9%
Taylor expanded in x1 around 0
Applied rewrites50.5%
Taylor expanded in x2 around 0
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
if 5.2000000000000002e-77 < x1 Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6433.0%
Applied rewrites33.0%
(FPCore (x1 x2)
:precision binary64
(if (<=
x1
-25999999999999997256817825017964609482768800836853525517434880)
(* x2 (+ (* -12 x1) (* -1 (/ x1 x2))))
(if (<=
x1
3389627864620585/65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716032)
(+ (* -1 x1) (* x2 -6))
(* x1 (- (* 4 (* x2 (- (* 2 x2) 3))) 1)))))double code(double x1, double x2) {
double tmp;
if (x1 <= -2.6e+61) {
tmp = x2 * ((-12.0 * x1) + (-1.0 * (x1 / x2)));
} else if (x1 <= 5.2e-77) {
tmp = (-1.0 * x1) + (x2 * -6.0);
} else {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0);
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.6d+61)) then
tmp = x2 * (((-12.0d0) * x1) + ((-1.0d0) * (x1 / x2)))
else if (x1 <= 5.2d-77) then
tmp = ((-1.0d0) * x1) + (x2 * (-6.0d0))
else
tmp = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 1.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.6e+61) {
tmp = x2 * ((-12.0 * x1) + (-1.0 * (x1 / x2)));
} else if (x1 <= 5.2e-77) {
tmp = (-1.0 * x1) + (x2 * -6.0);
} else {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.6e+61: tmp = x2 * ((-12.0 * x1) + (-1.0 * (x1 / x2))) elif x1 <= 5.2e-77: tmp = (-1.0 * x1) + (x2 * -6.0) else: tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.6e+61) tmp = Float64(x2 * Float64(Float64(-12.0 * x1) + Float64(-1.0 * Float64(x1 / x2)))); elseif (x1 <= 5.2e-77) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * -6.0)); else tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 1.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.6e+61) tmp = x2 * ((-12.0 * x1) + (-1.0 * (x1 / x2))); elseif (x1 <= 5.2e-77) tmp = (-1.0 * x1) + (x2 * -6.0); else tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -25999999999999997256817825017964609482768800836853525517434880], N[(x2 * N[(N[(-12 * x1), $MachinePrecision] + N[(-1 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3389627864620585/65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716032], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * -6), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(4 * N[(x2 * N[(N[(2 * x2), $MachinePrecision] - 3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x1 \leq -25999999999999997256817825017964609482768800836853525517434880:\\
\;\;\;\;x2 \cdot \left(-12 \cdot x1 + -1 \cdot \frac{x1}{x2}\right)\\
\mathbf{elif}\;x1 \leq \frac{3389627864620585}{65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716032}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 1\right)\\
\end{array}
if x1 < -2.5999999999999997e61Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6425.5%
Applied rewrites25.5%
if -2.5999999999999997e61 < x1 < 5.2000000000000002e-77Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around 0
Applied rewrites38.8%
if 5.2000000000000002e-77 < x1 Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6433.0%
Applied rewrites33.0%
(FPCore (x1 x2)
:precision binary64
(if (<=
x1
3389627864620585/65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716032)
(+ (* -1 x1) (* x2 (- (* -12 x1) 6)))
(* x1 (- (* 4 (* x2 (- (* 2 x2) 3))) 1))))double code(double x1, double x2) {
double tmp;
if (x1 <= 5.2e-77) {
tmp = (-1.0 * x1) + (x2 * ((-12.0 * x1) - 6.0));
} else {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0);
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 5.2d-77) then
tmp = ((-1.0d0) * x1) + (x2 * (((-12.0d0) * x1) - 6.0d0))
else
tmp = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 1.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 5.2e-77) {
tmp = (-1.0 * x1) + (x2 * ((-12.0 * x1) - 6.0));
} else {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 5.2e-77: tmp = (-1.0 * x1) + (x2 * ((-12.0 * x1) - 6.0)) else: tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 5.2e-77) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(-12.0 * x1) - 6.0))); else tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 1.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 5.2e-77) tmp = (-1.0 * x1) + (x2 * ((-12.0 * x1) - 6.0)); else tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 3389627864620585/65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716032], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(-12 * x1), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(4 * N[(x2 * N[(N[(2 * x2), $MachinePrecision] - 3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x1 \leq \frac{3389627864620585}{65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716032}:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot \left(-12 \cdot x1 - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 1\right)\\
\end{array}
if x1 < 5.2000000000000002e-77Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
if 5.2000000000000002e-77 < x1 Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6433.0%
Applied rewrites33.0%
(FPCore (x1 x2) :precision binary64 (+ (* -1 x1) (* x2 (- (* -12 x1) 6))))
double code(double x1, double x2) {
return (-1.0 * x1) + (x2 * ((-12.0 * x1) - 6.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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = ((-1.0d0) * x1) + (x2 * (((-12.0d0) * x1) - 6.0d0))
end function
public static double code(double x1, double x2) {
return (-1.0 * x1) + (x2 * ((-12.0 * x1) - 6.0));
}
def code(x1, x2): return (-1.0 * x1) + (x2 * ((-12.0 * x1) - 6.0))
function code(x1, x2) return Float64(Float64(-1.0 * x1) + Float64(x2 * Float64(Float64(-12.0 * x1) - 6.0))) end
function tmp = code(x1, x2) tmp = (-1.0 * x1) + (x2 * ((-12.0 * x1) - 6.0)); end
code[x1_, x2_] := N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * N[(N[(-12 * x1), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
-1 \cdot x1 + x2 \cdot \left(-12 \cdot x1 - 6\right)
Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (/ (- (+ t_0 (* 2 x2)) x1) t_1)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_2) (- t_2 3))
(* (* x1 x1) (- (* 4 t_2) 6)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3 (/ (- (- t_0 (* 2 x2)) x1) t_1))))
1000000000000000000161765076786456438212668646231659438295495017101117499225738747865260243034213915253779773568180337416027445820567779199643391541606026068611150746122284976177256650044200527276807327067690462112661427500197051226489898260678763391449376088547292320814127957486330655468919122263277568)
(+ (* -1 x1) (* x2 -6))
(* x1 (- (* -12 x2) 1)))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+303) {
tmp = (-1.0 * x1) + (x2 * -6.0);
} else {
tmp = x1 * ((-12.0 * x2) - 1.0);
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))) <= 1d+303) then
tmp = ((-1.0d0) * x1) + (x2 * (-6.0d0))
else
tmp = x1 * (((-12.0d0) * x2) - 1.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+303) {
tmp = (-1.0 * x1) + (x2 * -6.0);
} else {
tmp = x1 * ((-12.0 * x2) - 1.0);
}
return tmp;
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+303: tmp = (-1.0 * x1) + (x2 * -6.0) else: tmp = x1 * ((-12.0 * x2) - 1.0) return tmp
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= 1e+303) tmp = Float64(Float64(-1.0 * x1) + Float64(x2 * -6.0)); else tmp = Float64(x1 * Float64(Float64(-12.0 * x2) - 1.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+303) tmp = (-1.0 * x1) + (x2 * -6.0); else tmp = x1 * ((-12.0 * x2) - 1.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4 * t$95$2), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3 * N[(N[(N[(t$95$0 - N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1000000000000000000161765076786456438212668646231659438295495017101117499225738747865260243034213915253779773568180337416027445820567779199643391541606026068611150746122284976177256650044200527276807327067690462112661427500197051226489898260678763391449376088547292320814127957486330655468919122263277568], N[(N[(-1 * x1), $MachinePrecision] + N[(x2 * -6), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(-12 * x2), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right) \leq 1000000000000000000161765076786456438212668646231659438295495017101117499225738747865260243034213915253779773568180337416027445820567779199643391541606026068611150746122284976177256650044200527276807327067690462112661427500197051226489898260678763391449376088547292320814127957486330655468919122263277568:\\
\;\;\;\;-1 \cdot x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-12 \cdot x2 - 1\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1e303Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around 0
Applied rewrites38.8%
if 1e303 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* -12 x1) 6))))
(if (<=
x2
-352281387416075/146783911423364576743092537299333564210980159306769991919205685720763064069663027716481187399048043939495936)
t_0
(if (<=
x2
1780551949697837/50872912848509630386961759877939283730657641008879914553804457182037637617627197811290223700497087789481581959483591006819830334885554237978846405428549423569451580654251209705071092879576217840034217957579701248029256805705844583825408)
(* x1 -1)
t_0))))double code(double x1, double x2) {
double t_0 = x2 * ((-12.0 * x1) - 6.0);
double tmp;
if (x2 <= -2.4e-93) {
tmp = t_0;
} else if (x2 <= 3.5e-221) {
tmp = x1 * -1.0;
} else {
tmp = t_0;
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x2 * (((-12.0d0) * x1) - 6.0d0)
if (x2 <= (-2.4d-93)) then
tmp = t_0
else if (x2 <= 3.5d-221) then
tmp = x1 * (-1.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((-12.0 * x1) - 6.0);
double tmp;
if (x2 <= -2.4e-93) {
tmp = t_0;
} else if (x2 <= 3.5e-221) {
tmp = x1 * -1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((-12.0 * x1) - 6.0) tmp = 0 if x2 <= -2.4e-93: tmp = t_0 elif x2 <= 3.5e-221: tmp = x1 * -1.0 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(-12.0 * x1) - 6.0)) tmp = 0.0 if (x2 <= -2.4e-93) tmp = t_0; elseif (x2 <= 3.5e-221) tmp = Float64(x1 * -1.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((-12.0 * x1) - 6.0); tmp = 0.0; if (x2 <= -2.4e-93) tmp = t_0; elseif (x2 <= 3.5e-221) tmp = x1 * -1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(-12 * x1), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -352281387416075/146783911423364576743092537299333564210980159306769991919205685720763064069663027716481187399048043939495936], t$95$0, If[LessEqual[x2, 1780551949697837/50872912848509630386961759877939283730657641008879914553804457182037637617627197811290223700497087789481581959483591006819830334885554237978846405428549423569451580654251209705071092879576217840034217957579701248029256805705844583825408], N[(x1 * -1), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x2 \cdot \left(-12 \cdot x1 - 6\right)\\
\mathbf{if}\;x2 \leq \frac{-352281387416075}{146783911423364576743092537299333564210980159306769991919205685720763064069663027716481187399048043939495936}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x2 \leq \frac{1780551949697837}{50872912848509630386961759877939283730657641008879914553804457182037637617627197811290223700497087789481581959483591006819830334885554237978846405428549423569451580654251209705071092879576217840034217957579701248029256805705844583825408}:\\
\;\;\;\;x1 \cdot -1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x2 < -2.4000000000000001e-93 or 3.4999999999999999e-221 < x2 Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6432.8%
Applied rewrites32.8%
if -2.4000000000000001e-93 < x2 < 3.4999999999999999e-221Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
Applied rewrites13.9%
(FPCore (x1 x2) :precision binary64 (* x1 (- (* -12 x2) 1)))
double code(double x1, double x2) {
return x1 * ((-12.0 * x2) - 1.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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 * (((-12.0d0) * x2) - 1.0d0)
end function
public static double code(double x1, double x2) {
return x1 * ((-12.0 * x2) - 1.0);
}
def code(x1, x2): return x1 * ((-12.0 * x2) - 1.0)
function code(x1, x2) return Float64(x1 * Float64(Float64(-12.0 * x2) - 1.0)) end
function tmp = code(x1, x2) tmp = x1 * ((-12.0 * x2) - 1.0); end
code[x1_, x2_] := N[(x1 * N[(N[(-12 * x2), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]
x1 \cdot \left(-12 \cdot x2 - 1\right)
Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3 x1) x1))
(t_1 (+ (* x1 x1) 1))
(t_2 (/ (- (+ t_0 (* 2 x2)) x1) t_1)))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2 x1) t_2) (- t_2 3))
(* (* x1 x1) (- (* 4 t_2) 6)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3 (/ (- (- t_0 (* 2 x2)) x1) t_1))))
10000000000000000065284077450682265568456642148886267118448844545520511777838181142510337509988867035816342470187175785193750117648543530356184548650438281396224)
(* x1 -1)
(* -12 (* x1 x2)))))double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+160) {
tmp = x1 * -1.0;
} else {
tmp = -12.0 * (x1 * x2);
}
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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))) <= 1d+160) then
tmp = x1 * (-1.0d0)
else
tmp = (-12.0d0) * (x1 * x2)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+160) {
tmp = x1 * -1.0;
} else {
tmp = -12.0 * (x1 * x2);
}
return tmp;
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+160: tmp = x1 * -1.0 else: tmp = -12.0 * (x1 * x2) return tmp
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= 1e+160) tmp = Float64(x1 * -1.0); else tmp = Float64(-12.0 * Float64(x1 * x2)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= 1e+160) tmp = x1 * -1.0; else tmp = -12.0 * (x1 * x2); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4 * t$95$2), $MachinePrecision] - 6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3 * N[(N[(N[(t$95$0 - N[(2 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 10000000000000000065284077450682265568456642148886267118448844545520511777838181142510337509988867035816342470187175785193750117648543530356184548650438281396224], N[(x1 * -1), $MachinePrecision], N[(-12 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right) \leq 10000000000000000065284077450682265568456642148886267118448844545520511777838181142510337509988867035816342470187175785193750117648543530356184548650438281396224:\\
\;\;\;\;x1 \cdot -1\\
\mathbf{else}:\\
\;\;\;\;-12 \cdot \left(x1 \cdot x2\right)\\
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1e160Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
Applied rewrites13.9%
if 1e160 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around inf
lower-*.f64N/A
lower-*.f649.1%
Applied rewrites9.1%
(FPCore (x1 x2) :precision binary64 (* x1 -1))
double code(double x1, double x2) {
return x1 * -1.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(x1, x2)
use fmin_fmax_functions
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 * (-1.0d0)
end function
public static double code(double x1, double x2) {
return x1 * -1.0;
}
def code(x1, x2): return x1 * -1.0
function code(x1, x2) return Float64(x1 * -1.0) end
function tmp = code(x1, x2) tmp = x1 * -1.0; end
code[x1_, x2_] := N[(x1 * -1), $MachinePrecision]
x1 \cdot -1
Initial program 70.9%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites55.0%
Taylor expanded in x2 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6444.7%
Applied rewrites44.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f6420.3%
Applied rewrites20.3%
Taylor expanded in x2 around 0
Applied rewrites13.9%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x1 x2)
:name "Rosa's FloatVsDoubleBenchmark"
:precision binary64
(+ x1 (+ (+ (+ (+ (* (+ (* (* (* 2 x1) (/ (- (+ (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1))) (- (/ (- (+ (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1)) 3)) (* (* x1 x1) (- (* 4 (/ (- (+ (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1))) 6))) (+ (* x1 x1) 1)) (* (* (* 3 x1) x1) (/ (- (+ (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1)))) (* (* x1 x1) x1)) x1) (* 3 (/ (- (- (* (* 3 x1) x1) (* 2 x2)) x1) (+ (* x1 x1) 1))))))