
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
Herbie found 44 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (- x 2.0) (* (- x 3.0) (* (- x 4.0) (- x 5.0)))) (- x 1.0))
(- x 7.0))
(- x 10.0))
(* (- x 6.0) (* (- x 8.0) (- x 9.0))))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return (((((((((((((((x - 2.0) * ((x - 3.0) * ((x - 4.0) * (x - 5.0)))) * (x - 1.0)) * (x - 7.0)) * (x - 10.0)) * ((x - 6.0) * ((x - 8.0) * (x - 9.0)))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (((((((((((((((x - 2.0d0) * ((x - 3.0d0) * ((x - 4.0d0) * (x - 5.0d0)))) * (x - 1.0d0)) * (x - 7.0d0)) * (x - 10.0d0)) * ((x - 6.0d0) * ((x - 8.0d0) * (x - 9.0d0)))) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return (((((((((((((((x - 2.0) * ((x - 3.0) * ((x - 4.0) * (x - 5.0)))) * (x - 1.0)) * (x - 7.0)) * (x - 10.0)) * ((x - 6.0) * ((x - 8.0) * (x - 9.0)))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return (((((((((((((((x - 2.0) * ((x - 3.0) * ((x - 4.0) * (x - 5.0)))) * (x - 1.0)) * (x - 7.0)) * (x - 10.0)) * ((x - 6.0) * ((x - 8.0) * (x - 9.0)))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 2.0) * Float64(Float64(x - 3.0) * Float64(Float64(x - 4.0) * Float64(x - 5.0)))) * Float64(x - 1.0)) * Float64(x - 7.0)) * Float64(x - 10.0)) * Float64(Float64(x - 6.0) * Float64(Float64(x - 8.0) * Float64(x - 9.0)))) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = (((((((((((((((x - 2.0) * ((x - 3.0) * ((x - 4.0) * (x - 5.0)))) * (x - 1.0)) * (x - 7.0)) * (x - 10.0)) * ((x - 6.0) * ((x - 8.0) * (x - 9.0)))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(x - 3.0), $MachinePrecision] * N[(N[(x - 4.0), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 6.0), $MachinePrecision] * N[(N[(x - 8.0), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 2\right) \cdot \left(\left(x - 3\right) \cdot \left(\left(x - 4\right) \cdot \left(x - 5\right)\right)\right)\right) \cdot \left(x - 1\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(\left(x - 6\right) \cdot \left(\left(x - 8\right) \cdot \left(x - 9\right)\right)\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (- x 5.0) (- x 4.0))
(* (- x 3.0) (* (- x 2.0) (- x 1.0))))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return (((((((((((((((((x - 5.0) * (x - 4.0)) * ((x - 3.0) * ((x - 2.0) * (x - 1.0)))) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (((((((((((((((((x - 5.0d0) * (x - 4.0d0)) * ((x - 3.0d0) * ((x - 2.0d0) * (x - 1.0d0)))) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return (((((((((((((((((x - 5.0) * (x - 4.0)) * ((x - 3.0) * ((x - 2.0) * (x - 1.0)))) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return (((((((((((((((((x - 5.0) * (x - 4.0)) * ((x - 3.0) * ((x - 2.0) * (x - 1.0)))) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 5.0) * Float64(x - 4.0)) * Float64(Float64(x - 3.0) * Float64(Float64(x - 2.0) * Float64(x - 1.0)))) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = (((((((((((((((((x - 5.0) * (x - 4.0)) * ((x - 3.0) * ((x - 2.0) * (x - 1.0)))) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 5.0), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 3.0), $MachinePrecision] * N[(N[(x - 2.0), $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 5\right) \cdot \left(x - 4\right)\right) \cdot \left(\left(x - 3\right) \cdot \left(\left(x - 2\right) \cdot \left(x - 1\right)\right)\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (- x 2.0) (* (- x 1.0) (* (- x 4.0) (- x 3.0))))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return (((((((((((((((((x - 2.0) * ((x - 1.0) * ((x - 4.0) * (x - 3.0)))) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (((((((((((((((((x - 2.0d0) * ((x - 1.0d0) * ((x - 4.0d0) * (x - 3.0d0)))) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return (((((((((((((((((x - 2.0) * ((x - 1.0) * ((x - 4.0) * (x - 3.0)))) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return (((((((((((((((((x - 2.0) * ((x - 1.0) * ((x - 4.0) * (x - 3.0)))) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 2.0) * Float64(Float64(x - 1.0) * Float64(Float64(x - 4.0) * Float64(x - 3.0)))) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = (((((((((((((((((x - 2.0) * ((x - 1.0) * ((x - 4.0) * (x - 3.0)))) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(x - 1.0), $MachinePrecision] * N[(N[(x - 4.0), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 2\right) \cdot \left(\left(x - 1\right) \cdot \left(\left(x - 4\right) \cdot \left(x - 3\right)\right)\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (- x 3.0) (* (- x 4.0) (- x 5.0))) (- x 2.0))
(- x 1.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return ((((((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (x - 2.0)) * (x - 1.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = ((((((((((((((((((x - 3.0d0) * ((x - 4.0d0) * (x - 5.0d0))) * (x - 2.0d0)) * (x - 1.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return ((((((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (x - 2.0)) * (x - 1.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return ((((((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (x - 2.0)) * (x - 1.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 3.0) * Float64(Float64(x - 4.0) * Float64(x - 5.0))) * Float64(x - 2.0)) * Float64(x - 1.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = ((((((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (x - 2.0)) * (x - 1.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 3.0), $MachinePrecision] * N[(N[(x - 4.0), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 3\right) \cdot \left(\left(x - 4\right) \cdot \left(x - 5\right)\right)\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 1\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (- x 3.0) (* (- x 4.0) (- x 5.0))) (- x 1.0))
(- x 2.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return ((((((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (x - 1.0)) * (x - 2.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = ((((((((((((((((((x - 3.0d0) * ((x - 4.0d0) * (x - 5.0d0))) * (x - 1.0d0)) * (x - 2.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return ((((((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (x - 1.0)) * (x - 2.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return ((((((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (x - 1.0)) * (x - 2.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 3.0) * Float64(Float64(x - 4.0) * Float64(x - 5.0))) * Float64(x - 1.0)) * Float64(x - 2.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = ((((((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (x - 1.0)) * (x - 2.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 3.0), $MachinePrecision] * N[(N[(x - 4.0), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 3\right) \cdot \left(\left(x - 4\right) \cdot \left(x - 5\right)\right)\right) \cdot \left(x - 1\right)\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
(FPCore (x)
:precision binary64
(if (<= x 9.2)
(*
(*
(- x 18.0)
(*
(*
(*
(*
(- x 11.0)
(*
(- x 10.0)
(*
(- x 9.0)
(*
(*
(- x 8.0)
(*
(* (* (* (* (- x 5.0) (- x 4.0)) (- x 3.0)) (- x 2.0)) (- x 1.0))
(- x 6.0)))
(- x 7.0)))))
(* (- x 13.0) (- x 12.0)))
(* (- x 15.0) (- x 14.0)))
(* (- x 17.0) (- x 16.0))))
(+ 380.0 (* -39.0 x)))
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (- x 3.0) (* (- x 4.0) (- x 5.0)))
(* (* (- x 1.0) (- x 2.0)) 42.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (x <= 9.2) {
tmp = ((x - 18.0) * (((((x - 11.0) * ((x - 10.0) * ((x - 9.0) * (((x - 8.0) * ((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 6.0))) * (x - 7.0))))) * ((x - 13.0) * (x - 12.0))) * ((x - 15.0) * (x - 14.0))) * ((x - 17.0) * (x - 16.0)))) * (380.0 + (-39.0 * x));
} else {
tmp = (((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (((x - 1.0) * (x - 2.0)) * 42.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 9.2d0) then
tmp = ((x - 18.0d0) * (((((x - 11.0d0) * ((x - 10.0d0) * ((x - 9.0d0) * (((x - 8.0d0) * ((((((x - 5.0d0) * (x - 4.0d0)) * (x - 3.0d0)) * (x - 2.0d0)) * (x - 1.0d0)) * (x - 6.0d0))) * (x - 7.0d0))))) * ((x - 13.0d0) * (x - 12.0d0))) * ((x - 15.0d0) * (x - 14.0d0))) * ((x - 17.0d0) * (x - 16.0d0)))) * (380.0d0 + ((-39.0d0) * x))
else
tmp = (((((((((((((((x - 3.0d0) * ((x - 4.0d0) * (x - 5.0d0))) * (((x - 1.0d0) * (x - 2.0d0)) * 42.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 9.2) {
tmp = ((x - 18.0) * (((((x - 11.0) * ((x - 10.0) * ((x - 9.0) * (((x - 8.0) * ((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 6.0))) * (x - 7.0))))) * ((x - 13.0) * (x - 12.0))) * ((x - 15.0) * (x - 14.0))) * ((x - 17.0) * (x - 16.0)))) * (380.0 + (-39.0 * x));
} else {
tmp = (((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (((x - 1.0) * (x - 2.0)) * 42.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if x <= 9.2: tmp = ((x - 18.0) * (((((x - 11.0) * ((x - 10.0) * ((x - 9.0) * (((x - 8.0) * ((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 6.0))) * (x - 7.0))))) * ((x - 13.0) * (x - 12.0))) * ((x - 15.0) * (x - 14.0))) * ((x - 17.0) * (x - 16.0)))) * (380.0 + (-39.0 * x)) else: tmp = (((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (((x - 1.0) * (x - 2.0)) * 42.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (x <= 9.2) tmp = Float64(Float64(Float64(x - 18.0) * Float64(Float64(Float64(Float64(Float64(x - 11.0) * Float64(Float64(x - 10.0) * Float64(Float64(x - 9.0) * Float64(Float64(Float64(x - 8.0) * Float64(Float64(Float64(Float64(Float64(Float64(x - 5.0) * Float64(x - 4.0)) * Float64(x - 3.0)) * Float64(x - 2.0)) * Float64(x - 1.0)) * Float64(x - 6.0))) * Float64(x - 7.0))))) * Float64(Float64(x - 13.0) * Float64(x - 12.0))) * Float64(Float64(x - 15.0) * Float64(x - 14.0))) * Float64(Float64(x - 17.0) * Float64(x - 16.0)))) * Float64(380.0 + Float64(-39.0 * x))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 3.0) * Float64(Float64(x - 4.0) * Float64(x - 5.0))) * Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * 42.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 9.2) tmp = ((x - 18.0) * (((((x - 11.0) * ((x - 10.0) * ((x - 9.0) * (((x - 8.0) * ((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 6.0))) * (x - 7.0))))) * ((x - 13.0) * (x - 12.0))) * ((x - 15.0) * (x - 14.0))) * ((x - 17.0) * (x - 16.0)))) * (380.0 + (-39.0 * x)); else tmp = (((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (((x - 1.0) * (x - 2.0)) * 42.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 9.2], N[(N[(N[(x - 18.0), $MachinePrecision] * N[(N[(N[(N[(N[(x - 11.0), $MachinePrecision] * N[(N[(x - 10.0), $MachinePrecision] * N[(N[(x - 9.0), $MachinePrecision] * N[(N[(N[(x - 8.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(x - 5.0), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 13.0), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 15.0), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 17.0), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(380.0 + N[(-39.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 3.0), $MachinePrecision] * N[(N[(x - 4.0), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * 42.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 9.2:\\
\;\;\;\;\left(\left(x - 18\right) \cdot \left(\left(\left(\left(\left(x - 11\right) \cdot \left(\left(x - 10\right) \cdot \left(\left(x - 9\right) \cdot \left(\left(\left(x - 8\right) \cdot \left(\left(\left(\left(\left(\left(x - 5\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 1\right)\right) \cdot \left(x - 6\right)\right)\right) \cdot \left(x - 7\right)\right)\right)\right)\right) \cdot \left(\left(x - 13\right) \cdot \left(x - 12\right)\right)\right) \cdot \left(\left(x - 15\right) \cdot \left(x - 14\right)\right)\right) \cdot \left(\left(x - 17\right) \cdot \left(x - 16\right)\right)\right)\right) \cdot \left(380 + -39 \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 3\right) \cdot \left(\left(x - 4\right) \cdot \left(x - 5\right)\right)\right) \cdot \left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot 42\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if x < 9.1999999999999993Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Applied rewrites97.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f6419.4%
Applied rewrites19.4%
if 9.1999999999999993 < x Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Taylor expanded in x around 0
Applied rewrites17.1%
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
-20.0))double code(double x) {
return (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (-20.0d0)
end function
public static double code(double x) {
return (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0;
}
def code(x): return (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * -20.0) end
function tmp = code(x) tmp = (((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0; end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * -20.0), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot -20
Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites20.8%
(FPCore (x)
:precision binary64
(*
(*
(- x 18.0)
(*
(*
(*
(*
(- x 11.0)
(*
(- x 10.0)
(*
(- x 9.0)
(*
(*
(- x 8.0)
(*
(* (* (* (* (- x 5.0) (- x 4.0)) (- x 3.0)) (- x 2.0)) (- x 1.0))
(- x 6.0)))
(- x 7.0)))))
(* (- x 13.0) (- x 12.0)))
(* (- x 15.0) (- x 14.0)))
(* (- x 17.0) (- x 16.0))))
380.0))double code(double x) {
return ((x - 18.0) * (((((x - 11.0) * ((x - 10.0) * ((x - 9.0) * (((x - 8.0) * ((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 6.0))) * (x - 7.0))))) * ((x - 13.0) * (x - 12.0))) * ((x - 15.0) * (x - 14.0))) * ((x - 17.0) * (x - 16.0)))) * 380.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = ((x - 18.0d0) * (((((x - 11.0d0) * ((x - 10.0d0) * ((x - 9.0d0) * (((x - 8.0d0) * ((((((x - 5.0d0) * (x - 4.0d0)) * (x - 3.0d0)) * (x - 2.0d0)) * (x - 1.0d0)) * (x - 6.0d0))) * (x - 7.0d0))))) * ((x - 13.0d0) * (x - 12.0d0))) * ((x - 15.0d0) * (x - 14.0d0))) * ((x - 17.0d0) * (x - 16.0d0)))) * 380.0d0
end function
public static double code(double x) {
return ((x - 18.0) * (((((x - 11.0) * ((x - 10.0) * ((x - 9.0) * (((x - 8.0) * ((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 6.0))) * (x - 7.0))))) * ((x - 13.0) * (x - 12.0))) * ((x - 15.0) * (x - 14.0))) * ((x - 17.0) * (x - 16.0)))) * 380.0;
}
def code(x): return ((x - 18.0) * (((((x - 11.0) * ((x - 10.0) * ((x - 9.0) * (((x - 8.0) * ((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 6.0))) * (x - 7.0))))) * ((x - 13.0) * (x - 12.0))) * ((x - 15.0) * (x - 14.0))) * ((x - 17.0) * (x - 16.0)))) * 380.0
function code(x) return Float64(Float64(Float64(x - 18.0) * Float64(Float64(Float64(Float64(Float64(x - 11.0) * Float64(Float64(x - 10.0) * Float64(Float64(x - 9.0) * Float64(Float64(Float64(x - 8.0) * Float64(Float64(Float64(Float64(Float64(Float64(x - 5.0) * Float64(x - 4.0)) * Float64(x - 3.0)) * Float64(x - 2.0)) * Float64(x - 1.0)) * Float64(x - 6.0))) * Float64(x - 7.0))))) * Float64(Float64(x - 13.0) * Float64(x - 12.0))) * Float64(Float64(x - 15.0) * Float64(x - 14.0))) * Float64(Float64(x - 17.0) * Float64(x - 16.0)))) * 380.0) end
function tmp = code(x) tmp = ((x - 18.0) * (((((x - 11.0) * ((x - 10.0) * ((x - 9.0) * (((x - 8.0) * ((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 6.0))) * (x - 7.0))))) * ((x - 13.0) * (x - 12.0))) * ((x - 15.0) * (x - 14.0))) * ((x - 17.0) * (x - 16.0)))) * 380.0; end
code[x_] := N[(N[(N[(x - 18.0), $MachinePrecision] * N[(N[(N[(N[(N[(x - 11.0), $MachinePrecision] * N[(N[(x - 10.0), $MachinePrecision] * N[(N[(x - 9.0), $MachinePrecision] * N[(N[(N[(x - 8.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(x - 5.0), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 13.0), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 15.0), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 17.0), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 380.0), $MachinePrecision]
\left(\left(x - 18\right) \cdot \left(\left(\left(\left(\left(x - 11\right) \cdot \left(\left(x - 10\right) \cdot \left(\left(x - 9\right) \cdot \left(\left(\left(x - 8\right) \cdot \left(\left(\left(\left(\left(\left(x - 5\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 1\right)\right) \cdot \left(x - 6\right)\right)\right) \cdot \left(x - 7\right)\right)\right)\right)\right) \cdot \left(\left(x - 13\right) \cdot \left(x - 12\right)\right)\right) \cdot \left(\left(x - 15\right) \cdot \left(x - 14\right)\right)\right) \cdot \left(\left(x - 17\right) \cdot \left(x - 16\right)\right)\right)\right) \cdot 380
Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Applied rewrites97.8%
Taylor expanded in x around 0
Applied rewrites18.9%
(FPCore (x)
:precision binary64
(if (<= x 2.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (pow x 5.0) (- x 6.0)) (- x 7.0)) (- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(if (<= x 8.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (* 2.0 (- x 3.0)) (- x 4.0)) (- x 5.0)) (- x 6.0))
(- x 7.0))
-8.0)
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(- (* 47.0 x) 60.0)
(* (* (- x 1.0) (- x 2.0)) (* (- x 7.0) (- x 6.0))))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))))double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((((pow(x, 5.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else if (x <= 8.0) {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * -8.0) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((((47.0 * x) - 60.0) * (((x - 1.0) * (x - 2.0)) * ((x - 7.0) * (x - 6.0)))) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 2.0d0) then
tmp = (((((((((((((((x ** 5.0d0) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else if (x <= 8.0d0) then
tmp = (((((((((((((((((2.0d0 * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (-8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((((((((((47.0d0 * x) - 60.0d0) * (((x - 1.0d0) * (x - 2.0d0)) * ((x - 7.0d0) * (x - 6.0d0)))) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((((Math.pow(x, 5.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else if (x <= 8.0) {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * -8.0) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((((47.0 * x) - 60.0) * (((x - 1.0) * (x - 2.0)) * ((x - 7.0) * (x - 6.0)))) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if x <= 2.0: tmp = ((((((((((((((math.pow(x, 5.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) elif x <= 8.0: tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * -8.0) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((((((((47.0 * x) - 60.0) * (((x - 1.0) * (x - 2.0)) * ((x - 7.0) * (x - 6.0)))) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 5.0) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); elseif (x <= 8.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * -8.0) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(47.0 * x) - 60.0) * Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(Float64(x - 7.0) * Float64(x - 6.0)))) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 2.0) tmp = (((((((((((((((x ^ 5.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); elseif (x <= 8.0) tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * -8.0) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((((((((((47.0 * x) - 60.0) * (((x - 1.0) * (x - 2.0)) * ((x - 7.0) * (x - 6.0)))) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 2.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 5.0], $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(47.0 * x), $MachinePrecision] - 60.0), $MachinePrecision] * N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 7.0), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{5} \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{elif}\;x \leq 8:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(2 \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot -8\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(47 \cdot x - 60\right) \cdot \left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(\left(x - 7\right) \cdot \left(x - 6\right)\right)\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if x < 2Initial program 97.8%
Taylor expanded in x around inf
lower-pow.6414.0%
Applied rewrites14.0%
if 2 < x < 8Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites12.9%
Taylor expanded in x around 0
Applied rewrites9.7%
if 8 < x Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f6411.6%
Applied rewrites11.6%
(FPCore (x)
:precision binary64
(if (<= x 2.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (pow x 8.0) (- 1.0 (* 36.0 (/ 1.0 x)))) (- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(if (<= x 8.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (* 2.0 (- x 3.0)) (- x 4.0)) (- x 5.0)) (- x 6.0))
(- x 7.0))
-8.0)
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(- x 6.0)
(* (* (+ 24.0 (* x (- (* 35.0 x) 50.0))) (- x 5.0)) 56.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))))double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else if (x <= 8.0) {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * -8.0) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((x - 6.0) * (((24.0 + (x * ((35.0 * x) - 50.0))) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 2.0d0) then
tmp = (((((((((((((x ** 8.0d0) * (1.0d0 - (36.0d0 * (1.0d0 / x)))) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else if (x <= 8.0d0) then
tmp = (((((((((((((((((2.0d0 * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (-8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((((((((x - 6.0d0) * (((24.0d0 + (x * ((35.0d0 * x) - 50.0d0))) * (x - 5.0d0)) * 56.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((Math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else if (x <= 8.0) {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * -8.0) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((x - 6.0) * (((24.0 + (x * ((35.0 * x) - 50.0))) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if x <= 2.0: tmp = ((((((((((((math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) elif x <= 8.0: tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * -8.0) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((((((x - 6.0) * (((24.0 + (x * ((35.0 * x) - 50.0))) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 8.0) * Float64(1.0 - Float64(36.0 * Float64(1.0 / x)))) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); elseif (x <= 8.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * -8.0) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 6.0) * Float64(Float64(Float64(24.0 + Float64(x * Float64(Float64(35.0 * x) - 50.0))) * Float64(x - 5.0)) * 56.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 2.0) tmp = (((((((((((((x ^ 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); elseif (x <= 8.0) tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * -8.0) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((((((((x - 6.0) * (((24.0 + (x * ((35.0 * x) - 50.0))) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 2.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * N[(1.0 - N[(36.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 6.0), $MachinePrecision] * N[(N[(N[(24.0 + N[(x * N[(N[(35.0 * x), $MachinePrecision] - 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * 56.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{8} \cdot \left(1 - 36 \cdot \frac{1}{x}\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{elif}\;x \leq 8:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(2 \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot -8\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 6\right) \cdot \left(\left(\left(24 + x \cdot \left(35 \cdot x - 50\right)\right) \cdot \left(x - 5\right)\right) \cdot 56\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if x < 2Initial program 97.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-pow.64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f647.8%
Applied rewrites7.8%
if 2 < x < 8Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites12.9%
Taylor expanded in x around 0
Applied rewrites9.7%
if 8 < x Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites12.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites12.9%
Taylor expanded in x around 0
Applied rewrites12.4%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f649.8%
Applied rewrites9.8%
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(- x 10.0)
(*
(*
(*
(* (* (* (- x 5.0) (- x 4.0)) (- x 3.0)) (- x 2.0))
(- x 1.0))
(- x 7.0))
(- x 6.0)))
72.0)
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return ((((((((((((x - 10.0) * (((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 7.0)) * (x - 6.0))) * 72.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = ((((((((((((x - 10.0d0) * (((((((x - 5.0d0) * (x - 4.0d0)) * (x - 3.0d0)) * (x - 2.0d0)) * (x - 1.0d0)) * (x - 7.0d0)) * (x - 6.0d0))) * 72.0d0) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return ((((((((((((x - 10.0) * (((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 7.0)) * (x - 6.0))) * 72.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return ((((((((((((x - 10.0) * (((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 7.0)) * (x - 6.0))) * 72.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 10.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 5.0) * Float64(x - 4.0)) * Float64(x - 3.0)) * Float64(x - 2.0)) * Float64(x - 1.0)) * Float64(x - 7.0)) * Float64(x - 6.0))) * 72.0) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = ((((((((((((x - 10.0) * (((((((x - 5.0) * (x - 4.0)) * (x - 3.0)) * (x - 2.0)) * (x - 1.0)) * (x - 7.0)) * (x - 6.0))) * 72.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 10.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(x - 5.0), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 72.0), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 10\right) \cdot \left(\left(\left(\left(\left(\left(\left(x - 5\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 1\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 6\right)\right)\right) \cdot 72\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Applied rewrites97.8%
Taylor expanded in x around 0
Applied rewrites17.6%
(FPCore (x)
:precision binary64
(if (<= x 2.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (pow x 8.0) (- 1.0 (* 36.0 (/ 1.0 x)))) (- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(if (<= x 7.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (* 2.0 (- x 3.0)) (- x 4.0)) (- x 5.0)) (- x 6.0))
-7.0)
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(- x 10.0)
(* (+ 840.0 (* x (- (* 1849.0 x) 2038.0))) (- x 6.0)))
(* (- x 9.0) (- x 8.0)))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))))double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else if (x <= 7.0) {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * -7.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = ((((((((((((x - 10.0) * ((840.0 + (x * ((1849.0 * x) - 2038.0))) * (x - 6.0))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 2.0d0) then
tmp = (((((((((((((x ** 8.0d0) * (1.0d0 - (36.0d0 * (1.0d0 / x)))) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else if (x <= 7.0d0) then
tmp = (((((((((((((((((2.0d0 * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (-7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = ((((((((((((x - 10.0d0) * ((840.0d0 + (x * ((1849.0d0 * x) - 2038.0d0))) * (x - 6.0d0))) * ((x - 9.0d0) * (x - 8.0d0))) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((Math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else if (x <= 7.0) {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * -7.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = ((((((((((((x - 10.0) * ((840.0 + (x * ((1849.0 * x) - 2038.0))) * (x - 6.0))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if x <= 2.0: tmp = ((((((((((((math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) elif x <= 7.0: tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * -7.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = ((((((((((((x - 10.0) * ((840.0 + (x * ((1849.0 * x) - 2038.0))) * (x - 6.0))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 8.0) * Float64(1.0 - Float64(36.0 * Float64(1.0 / x)))) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); elseif (x <= 7.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * -7.0) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 10.0) * Float64(Float64(840.0 + Float64(x * Float64(Float64(1849.0 * x) - 2038.0))) * Float64(x - 6.0))) * Float64(Float64(x - 9.0) * Float64(x - 8.0))) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 2.0) tmp = (((((((((((((x ^ 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); elseif (x <= 7.0) tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * -7.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = ((((((((((((x - 10.0) * ((840.0 + (x * ((1849.0 * x) - 2038.0))) * (x - 6.0))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 2.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * N[(1.0 - N[(36.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * -7.0), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 10.0), $MachinePrecision] * N[(N[(840.0 + N[(x * N[(N[(1849.0 * x), $MachinePrecision] - 2038.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 9.0), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{8} \cdot \left(1 - 36 \cdot \frac{1}{x}\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{elif}\;x \leq 7:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(2 \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot -7\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 10\right) \cdot \left(\left(840 + x \cdot \left(1849 \cdot x - 2038\right)\right) \cdot \left(x - 6\right)\right)\right) \cdot \left(\left(x - 9\right) \cdot \left(x - 8\right)\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if x < 2Initial program 97.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-pow.64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f647.8%
Applied rewrites7.8%
if 2 < x < 7Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites12.9%
Taylor expanded in x around 0
Applied rewrites8.9%
if 7 < x Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Applied rewrites97.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f649.1%
Applied rewrites9.1%
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (- x 3.0) (* (- x 4.0) (- x 5.0)))
(* (* (- x 1.0) (- x 2.0)) 42.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return (((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (((x - 1.0) * (x - 2.0)) * 42.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (((((((((((((((x - 3.0d0) * ((x - 4.0d0) * (x - 5.0d0))) * (((x - 1.0d0) * (x - 2.0d0)) * 42.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return (((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (((x - 1.0) * (x - 2.0)) * 42.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return (((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (((x - 1.0) * (x - 2.0)) * 42.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 3.0) * Float64(Float64(x - 4.0) * Float64(x - 5.0))) * Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * 42.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = (((((((((((((((x - 3.0) * ((x - 4.0) * (x - 5.0))) * (((x - 1.0) * (x - 2.0)) * 42.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 3.0), $MachinePrecision] * N[(N[(x - 4.0), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * 42.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 3\right) \cdot \left(\left(x - 4\right) \cdot \left(x - 5\right)\right)\right) \cdot \left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot 42\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Taylor expanded in x around 0
Applied rewrites17.1%
(FPCore (x)
:precision binary64
(if (<= x 2.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (pow x 5.0) (- x 6.0)) (- x 7.0)) (- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (* 2.0 (- x 3.0)) (- x 4.0)) (- x 5.0)) (- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
-20.0)))double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((((pow(x, 5.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 2.0d0) then
tmp = (((((((((((((((x ** 5.0d0) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((((((((((((2.0d0 * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (-20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((((Math.pow(x, 5.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0;
}
return tmp;
}
def code(x): tmp = 0 if x <= 2.0: tmp = ((((((((((((((math.pow(x, 5.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0 return tmp
function code(x) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 5.0) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * -20.0); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 2.0) tmp = (((((((((((((((x ^ 5.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0; end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 2.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 5.0], $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * -20.0), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{5} \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(2 \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot -20\\
\end{array}
if x < 2Initial program 97.8%
Taylor expanded in x around inf
lower-pow.6414.0%
Applied rewrites14.0%
if 2 < x Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites12.9%
Taylor expanded in x around 0
Applied rewrites13.3%
(FPCore (x)
:precision binary64
(if (<= x 2.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (pow x 8.0) (- 1.0 (* 36.0 (/ 1.0 x)))) (- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (* 2.0 (- x 3.0)) (- x 4.0)) (- x 5.0)) (- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
-20.0)))double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 2.0d0) then
tmp = (((((((((((((x ** 8.0d0) * (1.0d0 - (36.0d0 * (1.0d0 / x)))) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((((((((((((2.0d0 * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (-20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((Math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0;
}
return tmp;
}
def code(x): tmp = 0 if x <= 2.0: tmp = ((((((((((((math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0 return tmp
function code(x) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 8.0) * Float64(1.0 - Float64(36.0 * Float64(1.0 / x)))) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * -20.0); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 2.0) tmp = (((((((((((((x ^ 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * -20.0; end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 2.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * N[(1.0 - N[(36.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * -20.0), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{8} \cdot \left(1 - 36 \cdot \frac{1}{x}\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(2 \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot -20\\
\end{array}
if x < 2Initial program 97.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-pow.64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f647.8%
Applied rewrites7.8%
if 2 < x Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites12.9%
Taylor expanded in x around 0
Applied rewrites13.3%
(FPCore (x)
:precision binary64
(if (<= x 2.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (pow x 8.0) (- 1.0 (* 36.0 (/ 1.0 x)))) (- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (* 2.0 (- x 3.0)) (- x 4.0)) (- x 5.0)) (- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
-18.0)
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * -18.0) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 2.0d0) then
tmp = (((((((((((((x ** 8.0d0) * (1.0d0 - (36.0d0 * (1.0d0 / x)))) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((((((((((((2.0d0 * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (-18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((Math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * -18.0) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if x <= 2.0: tmp = ((((((((((((math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * -18.0) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 8.0) * Float64(1.0 - Float64(36.0 * Float64(1.0 / x)))) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * -18.0) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 2.0) tmp = (((((((((((((x ^ 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((((((((((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * -18.0) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 2.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * N[(1.0 - N[(36.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * -18.0), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{8} \cdot \left(1 - 36 \cdot \frac{1}{x}\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(2 \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot -18\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if x < 2Initial program 97.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-pow.64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f647.8%
Applied rewrites7.8%
if 2 < x Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites12.9%
Taylor expanded in x around 0
Applied rewrites13.0%
(FPCore (x)
:precision binary64
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* 20.0 (* (- x 3.0) (* (- x 2.0) (- x 1.0)))) (- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0)))double code(double x) {
return (((((((((((((((20.0 * ((x - 3.0) * ((x - 2.0) * (x - 1.0)))) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (((((((((((((((20.0d0 * ((x - 3.0d0) * ((x - 2.0d0) * (x - 1.0d0)))) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end function
public static double code(double x) {
return (((((((((((((((20.0 * ((x - 3.0) * ((x - 2.0) * (x - 1.0)))) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
def code(x): return (((((((((((((((20.0 * ((x - 3.0) * ((x - 2.0) * (x - 1.0)))) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(20.0 * Float64(Float64(x - 3.0) * Float64(Float64(x - 2.0) * Float64(x - 1.0)))) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) end
function tmp = code(x) tmp = (((((((((((((((20.0 * ((x - 3.0) * ((x - 2.0) * (x - 1.0)))) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end
code[x_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(20.0 * N[(N[(x - 3.0), $MachinePrecision] * N[(N[(x - 2.0), $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(20 \cdot \left(\left(x - 3\right) \cdot \left(\left(x - 2\right) \cdot \left(x - 1\right)\right)\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)
Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
Taylor expanded in x around 0
Applied rewrites16.5%
(FPCore (x)
:precision binary64
(if (<= x 2.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (pow x 8.0) (- 1.0 (* 36.0 (/ 1.0 x)))) (- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(- x 6.0)
(* (* (* (* 2.0 (- x 3.0)) (- x 4.0)) (- x 5.0)) 56.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
-19.0)
(- x 20.0))))double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((x - 6.0) * ((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * -19.0) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 2.0d0) then
tmp = (((((((((((((x ** 8.0d0) * (1.0d0 - (36.0d0 * (1.0d0 / x)))) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((((((((x - 6.0d0) * ((((2.0d0 * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * 56.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (-19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = ((((((((((((Math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((x - 6.0) * ((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * -19.0) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if x <= 2.0: tmp = ((((((((((((math.pow(x, 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((((((x - 6.0) * ((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * -19.0) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 8.0) * Float64(1.0 - Float64(36.0 * Float64(1.0 / x)))) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 6.0) * Float64(Float64(Float64(Float64(2.0 * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * 56.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * -19.0) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 2.0) tmp = (((((((((((((x ^ 8.0) * (1.0 - (36.0 * (1.0 / x)))) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((((((((x - 6.0) * ((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * -19.0) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 2.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * N[(1.0 - N[(36.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 6.0), $MachinePrecision] * N[(N[(N[(N[(2.0 * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * 56.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * -19.0), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{8} \cdot \left(1 - 36 \cdot \frac{1}{x}\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 6\right) \cdot \left(\left(\left(\left(2 \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot 56\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot -19\right) \cdot \left(x - 20\right)\\
\end{array}
if x < 2Initial program 97.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-pow.64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f647.8%
Applied rewrites7.8%
if 2 < x Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites12.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites12.9%
Taylor expanded in x around 0
Applied rewrites12.4%
Taylor expanded in x around 0
Applied rewrites12.3%
(FPCore (x)
:precision binary64
(if (<= x 2.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (pow x 8.0) (- 1.0 (* 38.0 (/ 1.0 x))))
(* (- x 9.0) (- x 8.0)))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(- x 6.0)
(* (* (* (* 2.0 (- x 3.0)) (- x 4.0)) (- x 5.0)) 56.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
-19.0)
(- x 20.0))))double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = (((((((((((pow(x, 8.0) * (1.0 - (38.0 * (1.0 / x)))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((x - 6.0) * ((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * -19.0) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 2.0d0) then
tmp = ((((((((((((x ** 8.0d0) * (1.0d0 - (38.0d0 * (1.0d0 / x)))) * ((x - 9.0d0) * (x - 8.0d0))) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((((((((x - 6.0d0) * ((((2.0d0 * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * 56.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (-19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 2.0) {
tmp = (((((((((((Math.pow(x, 8.0) * (1.0 - (38.0 * (1.0 / x)))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((((((x - 6.0) * ((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * -19.0) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if x <= 2.0: tmp = (((((((((((math.pow(x, 8.0) * (1.0 - (38.0 * (1.0 / x)))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((((((x - 6.0) * ((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * -19.0) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 8.0) * Float64(1.0 - Float64(38.0 * Float64(1.0 / x)))) * Float64(Float64(x - 9.0) * Float64(x - 8.0))) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 6.0) * Float64(Float64(Float64(Float64(2.0 * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * 56.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * -19.0) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 2.0) tmp = ((((((((((((x ^ 8.0) * (1.0 - (38.0 * (1.0 / x)))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((((((((x - 6.0) * ((((2.0 * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * 56.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * -19.0) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 2.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * N[(1.0 - N[(38.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 9.0), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 6.0), $MachinePrecision] * N[(N[(N[(N[(2.0 * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * 56.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * -19.0), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{8} \cdot \left(1 - 38 \cdot \frac{1}{x}\right)\right) \cdot \left(\left(x - 9\right) \cdot \left(x - 8\right)\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 6\right) \cdot \left(\left(\left(\left(2 \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot 56\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot -19\right) \cdot \left(x - 20\right)\\
\end{array}
if x < 2Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Applied rewrites97.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-pow.64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f648.6%
Applied rewrites8.6%
if 2 < x Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites12.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites12.9%
Taylor expanded in x around 0
Applied rewrites12.4%
Taylor expanded in x around 0
Applied rewrites12.3%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
4000000000000.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (- x 10.0) (* (* (* 120.0 (- x 1.0)) (- x 7.0)) (- x 6.0)))
(* (- x 9.0) (- x 8.0)))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(* (pow x 14.0) (+ 1.0 (* -1.0 (/ (- 105.0 (* 5005.0 (/ 1.0 x))) x))))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 4000000000000.0) {
tmp = ((((((((((((x - 10.0) * (((120.0 * (x - 1.0)) * (x - 7.0)) * (x - 6.0))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = ((((((pow(x, 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= 4000000000000.0d0) then
tmp = ((((((((((((x - 10.0d0) * (((120.0d0 * (x - 1.0d0)) * (x - 7.0d0)) * (x - 6.0d0))) * ((x - 9.0d0) * (x - 8.0d0))) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((x ** 14.0d0) * (1.0d0 + ((-1.0d0) * ((105.0d0 - (5005.0d0 * (1.0d0 / x))) / x)))) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 4000000000000.0) {
tmp = ((((((((((((x - 10.0) * (((120.0 * (x - 1.0)) * (x - 7.0)) * (x - 6.0))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = ((((((Math.pow(x, 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 4000000000000.0: tmp = ((((((((((((x - 10.0) * (((120.0 * (x - 1.0)) * (x - 7.0)) * (x - 6.0))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = ((((((math.pow(x, 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= 4000000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 10.0) * Float64(Float64(Float64(120.0 * Float64(x - 1.0)) * Float64(x - 7.0)) * Float64(x - 6.0))) * Float64(Float64(x - 9.0) * Float64(x - 8.0))) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 14.0) * Float64(1.0 + Float64(-1.0 * Float64(Float64(105.0 - Float64(5005.0 * Float64(1.0 / x))) / x)))) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 4000000000000.0) tmp = ((((((((((((x - 10.0) * (((120.0 * (x - 1.0)) * (x - 7.0)) * (x - 6.0))) * ((x - 9.0) * (x - 8.0))) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((x ^ 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], 4000000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 10.0), $MachinePrecision] * N[(N[(N[(120.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x - 9.0), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[Power[x, 14.0], $MachinePrecision] * N[(1.0 + N[(-1.0 * N[(N[(105.0 - N[(5005.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq 4000000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 10\right) \cdot \left(\left(\left(120 \cdot \left(x - 1\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 6\right)\right)\right) \cdot \left(\left(x - 9\right) \cdot \left(x - 8\right)\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left({x}^{14} \cdot \left(1 + -1 \cdot \frac{105 - 5005 \cdot \frac{1}{x}}{x}\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < 4e12Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Applied rewrites97.8%
Taylor expanded in x around 0
Applied rewrites13.1%
if 4e12 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-pow.64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f646.8%
Applied rewrites6.8%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
4000000000000.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- (* 274.0 x) 120.0) (- x 6.0)) (- x 7.0)) (- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(* (pow x 14.0) (+ 1.0 (* -1.0 (/ (- 105.0 (* 5005.0 (/ 1.0 x))) x))))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 4000000000000.0) {
tmp = ((((((((((((((((274.0 * x) - 120.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = ((((((pow(x, 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= 4000000000000.0d0) then
tmp = ((((((((((((((((274.0d0 * x) - 120.0d0) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((x ** 14.0d0) * (1.0d0 + ((-1.0d0) * ((105.0d0 - (5005.0d0 * (1.0d0 / x))) / x)))) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 4000000000000.0) {
tmp = ((((((((((((((((274.0 * x) - 120.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = ((((((Math.pow(x, 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 4000000000000.0: tmp = ((((((((((((((((274.0 * x) - 120.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = ((((((math.pow(x, 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= 4000000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(274.0 * x) - 120.0) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 14.0) * Float64(1.0 + Float64(-1.0 * Float64(Float64(105.0 - Float64(5005.0 * Float64(1.0 / x))) / x)))) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 4000000000000.0) tmp = ((((((((((((((((274.0 * x) - 120.0) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((x ^ 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], 4000000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(274.0 * x), $MachinePrecision] - 120.0), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[Power[x, 14.0], $MachinePrecision] * N[(1.0 + N[(-1.0 * N[(N[(105.0 - N[(5005.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq 4000000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(274 \cdot x - 120\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left({x}^{14} \cdot \left(1 + -1 \cdot \frac{105 - 5005 \cdot \frac{1}{x}}{x}\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < 4e12Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f6412.9%
Applied rewrites12.9%
if 4e12 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-pow.64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f646.8%
Applied rewrites6.8%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
100000000000.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (pow x 7.0) (- x 8.0)) (- x 9.0)) (- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(* (* (* (pow x 10.0) (- x 11.0)) (- x 12.0)) (- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) {
tmp = ((((((((((((pow(x, 7.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= 100000000000.0d0) then
tmp = (((((((((((((x ** 7.0d0) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = ((((((((((x ** 10.0d0) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) {
tmp = ((((((((((((Math.pow(x, 7.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((Math.pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0: tmp = ((((((((((((math.pow(x, 7.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((math.pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= 100000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 7.0) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 10.0) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) tmp = (((((((((((((x ^ 7.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = ((((((((((x ^ 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], 100000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 7.0], $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 10.0], $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq 100000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{7} \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{10} \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < 1e11Initial program 97.8%
Taylor expanded in x around inf
lower-pow.6412.1%
Applied rewrites12.1%
if 1e11 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around inf
lower-pow.648.1%
Applied rewrites8.1%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
100000000000.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (- (* 13068.0 x) 5040.0) (- x 8.0)) (- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(* (* (* (pow x 10.0) (- x 11.0)) (- x 12.0)) (- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) {
tmp = ((((((((((((((13068.0 * x) - 5040.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= 100000000000.0d0) then
tmp = ((((((((((((((13068.0d0 * x) - 5040.0d0) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = ((((((((((x ** 10.0d0) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) {
tmp = ((((((((((((((13068.0 * x) - 5040.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((Math.pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0: tmp = ((((((((((((((13068.0 * x) - 5040.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((math.pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= 100000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(13068.0 * x) - 5040.0) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 10.0) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) tmp = ((((((((((((((13068.0 * x) - 5040.0) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = ((((((((((x ^ 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], 100000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(13068.0 * x), $MachinePrecision] - 5040.0), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 10.0], $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq 100000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(13068 \cdot x - 5040\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{10} \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < 1e11Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f6411.5%
Applied rewrites11.5%
if 1e11 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around inf
lower-pow.648.1%
Applied rewrites8.1%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (pow x 9.0) (- x 10.0)) (- x 11.0)) (- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(* (* (* (pow x 10.0) (- x 11.0)) (- x 12.0)) (- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((((((pow(x, 9.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = (((((((((((x ** 9.0d0) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = ((((((((((x ** 10.0d0) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((((((Math.pow(x, 9.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((Math.pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((((((((((math.pow(x, 9.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((math.pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 9.0) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 10.0) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = (((((((((((x ^ 9.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = ((((((((((x ^ 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 9.0], $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 10.0], $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{9} \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{10} \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around inf
lower-pow.6410.9%
Applied rewrites10.9%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around inf
lower-pow.648.1%
Applied rewrites8.1%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
100000000000.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (- (* 1026576.0 x) 362880.0) (- x 10.0)) (- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(*
(* (* (* (pow x 10.0) (- x 11.0)) (- x 12.0)) (- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) {
tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= 100000000000.0d0) then
tmp = ((((((((((((1026576.0d0 * x) - 362880.0d0) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = ((((((((((x ** 10.0d0) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) {
tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((((Math.pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0: tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((((math.pow(x, 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= 100000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(1026576.0 * x) - 362880.0) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 10.0) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = ((((((((((x ^ 10.0) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], 100000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(1026576.0 * x), $MachinePrecision] - 362880.0), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 10.0], $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq 100000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(1026576 \cdot x - 362880\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left({x}^{10} \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < 1e11Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f6410.8%
Applied rewrites10.8%
if 1e11 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around inf
lower-pow.648.1%
Applied rewrites8.1%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
580000000000.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (- (* 1026576.0 x) 362880.0) (- x 10.0)) (- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(*
(*
(* (pow x 14.0) (+ 1.0 (* -1.0 (/ (- 105.0 (* 5005.0 (/ 1.0 x))) x))))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 580000000000.0) {
tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = ((((((pow(x, 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= 580000000000.0d0) then
tmp = ((((((((((((1026576.0d0 * x) - 362880.0d0) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((x ** 14.0d0) * (1.0d0 + ((-1.0d0) * ((105.0d0 - (5005.0d0 * (1.0d0 / x))) / x)))) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 580000000000.0) {
tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = ((((((Math.pow(x, 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 580000000000.0: tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = ((((((math.pow(x, 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= 580000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(1026576.0 * x) - 362880.0) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 14.0) * Float64(1.0 + Float64(-1.0 * Float64(Float64(105.0 - Float64(5005.0 * Float64(1.0 / x))) / x)))) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 580000000000.0) tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((x ^ 14.0) * (1.0 + (-1.0 * ((105.0 - (5005.0 * (1.0 / x))) / x)))) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], 580000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(1026576.0 * x), $MachinePrecision] - 362880.0), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[Power[x, 14.0], $MachinePrecision] * N[(1.0 + N[(-1.0 * N[(N[(105.0 - N[(5005.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq 580000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(1026576 \cdot x - 362880\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left({x}^{14} \cdot \left(1 + -1 \cdot \frac{105 - 5005 \cdot \frac{1}{x}}{x}\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < 5.8e11Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f6410.8%
Applied rewrites10.8%
if 5.8e11 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-pow.64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f646.8%
Applied rewrites6.8%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
100000000000.0)
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (- (* 1026576.0 x) 362880.0) (- x 10.0)) (- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(* (* (* (* (pow x 12.0) (- x 13.0)) (- x 14.0)) (- x 15.0)) (- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) {
tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((pow(x, 12.0) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= 100000000000.0d0) then
tmp = ((((((((((((1026576.0d0 * x) - 362880.0d0) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = ((((((((x ** 12.0d0) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) {
tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((Math.pow(x, 12.0) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0: tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((math.pow(x, 12.0) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= 100000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(1026576.0 * x) - 362880.0) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 12.0) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= 100000000000.0) tmp = ((((((((((((1026576.0 * x) - 362880.0) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = ((((((((x ^ 12.0) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], 100000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(1026576.0 * x), $MachinePrecision] - 362880.0), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 12.0], $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq 100000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(1026576 \cdot x - 362880\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left({x}^{12} \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < 1e11Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f6410.8%
Applied rewrites10.8%
if 1e11 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around inf
lower-pow.647.3%
Applied rewrites7.3%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(*
(*
(- x 16.0)
(*
(*
(*
(* (* (* (fma -10628640.0 x 3628800.0) -11.0) (- x 12.0)) (- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 17.0)))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(* (* (* (* (pow x 12.0) (- x 13.0)) (- x 14.0)) (- x 15.0)) (- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((x - 16.0) * ((((((fma(-10628640.0, x, 3628800.0) * -11.0) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 17.0))) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((pow(x, 12.0) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(x - 16.0) * Float64(Float64(Float64(Float64(Float64(Float64(fma(-10628640.0, x, 3628800.0) * -11.0) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 17.0))) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((x ^ 12.0) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(x - 16.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(-10628640.0 * x + 3628800.0), $MachinePrecision] * -11.0), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[Power[x, 12.0], $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(\left(x - 16\right) \cdot \left(\left(\left(\left(\left(\left(\mathsf{fma}\left(-10628640, x, 3628800\right) \cdot -11\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 17\right)\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left({x}^{12} \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f647.3%
Applied rewrites7.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites7.3%
Taylor expanded in x around 0
Applied rewrites10.3%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around inf
lower-pow.647.3%
Applied rewrites7.3%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(*
(*
(- x 16.0)
(*
(*
(*
(* (* (* (fma -10628640.0 x 3628800.0) -11.0) (- x 12.0)) (- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 17.0)))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(* (* (* (* 479001600.0 (- x 13.0)) (- x 14.0)) (- x 15.0)) (- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((x - 16.0) * ((((((fma(-10628640.0, x, 3628800.0) * -11.0) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 17.0))) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((479001600.0 * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(x - 16.0) * Float64(Float64(Float64(Float64(Float64(Float64(fma(-10628640.0, x, 3628800.0) * -11.0) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 17.0))) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(479001600.0 * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(x - 16.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(-10628640.0 * x + 3628800.0), $MachinePrecision] * -11.0), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(479001600.0 * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(\left(x - 16\right) \cdot \left(\left(\left(\left(\left(\left(\mathsf{fma}\left(-10628640, x, 3628800\right) \cdot -11\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 17\right)\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(479001600 \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f647.3%
Applied rewrites7.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites7.3%
Taylor expanded in x around 0
Applied rewrites10.3%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites7.3%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(*
(*
(*
(*
(*
(* (* (- (* 120543840.0 x) 39916800.0) (- x 12.0)) (- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(* (* (* (* 479001600.0 (- x 13.0)) (- x 14.0)) (- x 15.0)) (- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((((((120543840.0 * x) - 39916800.0) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((479001600.0 * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((((((((((120543840.0d0 * x) - 39916800.0d0) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((479001600.0d0 * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((((((120543840.0 * x) - 39916800.0) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((479001600.0 * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((((((((((120543840.0 * x) - 39916800.0) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((479001600.0 * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(120543840.0 * x) - 39916800.0) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(479001600.0 * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((((((((((120543840.0 * x) - 39916800.0) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((479001600.0 * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(120543840.0 * x), $MachinePrecision] - 39916800.0), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(479001600.0 * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(\left(\left(120543840 \cdot x - 39916800\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(479001600 \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f6410.3%
Applied rewrites10.3%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites7.3%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(*
(*
(*
(* (* (- (* 19802759040.0 x) 6227020800.0) (- x 14.0)) (- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(*
(*
(* (* (* (* 479001600.0 (- x 13.0)) (- x 14.0)) (- x 15.0)) (- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((((19802759040.0 * x) - 6227020800.0) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((479001600.0 * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((((((((19802759040.0d0 * x) - 6227020800.0d0) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((((479001600.0d0 * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((((19802759040.0 * x) - 6227020800.0) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((((479001600.0 * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((((((((19802759040.0 * x) - 6227020800.0) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((((479001600.0 * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(19802759040.0 * x) - 6227020800.0) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(479001600.0 * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((((((((19802759040.0 * x) - 6227020800.0) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((((479001600.0 * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(19802759040.0 * x), $MachinePrecision] - 6227020800.0), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(479001600.0 * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(19802759040 \cdot x - 6227020800\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(479001600 \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f649.6%
Applied rewrites9.6%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites7.3%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(*
(*
(*
(* (* (- (* 19802759040.0 x) 6227020800.0) (- x 14.0)) (- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(* (* (* (* 87178291200.0 (- x 15.0)) (- x 16.0)) (- x 17.0)) (- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((((19802759040.0 * x) - 6227020800.0) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((((((((19802759040.0d0 * x) - 6227020800.0d0) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((87178291200.0d0 * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((((19802759040.0 * x) - 6227020800.0) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((((((((19802759040.0 * x) - 6227020800.0) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(19802759040.0 * x) - 6227020800.0) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(87178291200.0 * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((((((((19802759040.0 * x) - 6227020800.0) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(N[(N[(N[(N[(19802759040.0 * x), $MachinePrecision] - 6227020800.0), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(87178291200.0 * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(\left(\left(19802759040 \cdot x - 6227020800\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(87178291200 \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f649.6%
Applied rewrites9.6%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites6.9%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(* (* (* (* (pow x 15.0) (- x 16.0)) (- x 17.0)) (- x 18.0)) (- x 19.0))
(- x 20.0))
(*
(*
(* (* (* (* 87178291200.0 (- x 15.0)) (- x 16.0)) (- x 17.0)) (- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((pow(x, 15.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = (((((x ** 15.0d0) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((87178291200.0d0 * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((Math.pow(x, 15.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((((math.pow(x, 15.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64((x ^ 15.0) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(87178291200.0 * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = (((((x ^ 15.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(N[Power[x, 15.0], $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(87178291200.0 * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(\left({x}^{15} \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(87178291200 \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around inf
lower-pow.648.9%
Applied rewrites8.9%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites6.9%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(*
(* (* (- (* 4339163001600.0 x) 1307674368000.0) (- x 16.0)) (- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(*
(* (* (* (* 87178291200.0 (- x 15.0)) (- x 16.0)) (- x 17.0)) (- x 18.0))
(- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((4339163001600.0 * x) - 1307674368000.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((((((4339163001600.0d0 * x) - 1307674368000.0d0) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((((87178291200.0d0 * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((4339163001600.0 * x) - 1307674368000.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((((((4339163001600.0 * x) - 1307674368000.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(4339163001600.0 * x) - 1307674368000.0) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(87178291200.0 * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((((((4339163001600.0 * x) - 1307674368000.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((((87178291200.0 * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(N[(N[(4339163001600.0 * x), $MachinePrecision] - 1307674368000.0), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(87178291200.0 * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(4339163001600 \cdot x - 1307674368000\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(87178291200 \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f648.9%
Applied rewrites8.9%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites6.9%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(*
(* (* (- (* 4339163001600.0 x) 1307674368000.0) (- x 16.0)) (- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(* (* (* 20922789888000.0 (- x 17.0)) (- x 18.0)) (- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((4339163001600.0 * x) - 1307674368000.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((20922789888000.0 * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((((((4339163001600.0d0 * x) - 1307674368000.0d0) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((20922789888000.0d0 * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((((4339163001600.0 * x) - 1307674368000.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((20922789888000.0 * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((((((4339163001600.0 * x) - 1307674368000.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((20922789888000.0 * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(4339163001600.0 * x) - 1307674368000.0) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(20922789888000.0 * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((((((4339163001600.0 * x) - 1307674368000.0) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((20922789888000.0 * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(N[(N[(4339163001600.0 * x), $MachinePrecision] - 1307674368000.0), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(20922789888000.0 * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(\left(\left(4339163001600 \cdot x - 1307674368000\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(20922789888000 \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f648.9%
Applied rewrites8.9%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites6.3%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(* (- (* 1223405590579200.0 x) 355687428096000.0) (- x 18.0))
(- x 19.0))
(- x 20.0))
(*
(* (* (* 20922789888000.0 (- x 17.0)) (- x 18.0)) (- x 19.0))
(- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((1223405590579200.0 * x) - 355687428096000.0) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((20922789888000.0 * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((((1223405590579200.0d0 * x) - 355687428096000.0d0) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (((20922789888000.0d0 * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((1223405590579200.0 * x) - 355687428096000.0) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (((20922789888000.0 * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((((1223405590579200.0 * x) - 355687428096000.0) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (((20922789888000.0 * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(1223405590579200.0 * x) - 355687428096000.0) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(Float64(Float64(20922789888000.0 * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((((1223405590579200.0 * x) - 355687428096000.0) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (((20922789888000.0 * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(1223405590579200.0 * x), $MachinePrecision] - 355687428096000.0), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(20922789888000.0 * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(1223405590579200 \cdot x - 355687428096000\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(20922789888000 \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f648.6%
Applied rewrites8.6%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites6.3%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(*
(* (- (* 1223405590579200.0 x) 355687428096000.0) (- x 18.0))
(- x 19.0))
(- x 20.0))
(* (* 6402373705728000.0 (- x 19.0)) (- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((1223405590579200.0 * x) - 355687428096000.0) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((((1223405590579200.0d0 * x) - 355687428096000.0d0) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (6402373705728000.0d0 * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((((1223405590579200.0 * x) - 355687428096000.0) * (x - 18.0)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((((1223405590579200.0 * x) - 355687428096000.0) * (x - 18.0)) * (x - 19.0)) * (x - 20.0) else: tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(Float64(Float64(1223405590579200.0 * x) - 355687428096000.0) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(6402373705728000.0 * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((((1223405590579200.0 * x) - 355687428096000.0) * (x - 18.0)) * (x - 19.0)) * (x - 20.0); else tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(N[(N[(1223405590579200.0 * x), $MachinePrecision] - 355687428096000.0), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(6402373705728000.0 * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(\left(1223405590579200 \cdot x - 355687428096000\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(6402373705728000 \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f648.6%
Applied rewrites8.6%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites6.0%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(*
(* (+ 6402373705728000.0 (* -22376988058521600.0 x)) (- x 19.0))
(- x 20.0))
(* (* 6402373705728000.0 (- x 19.0)) (- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((6402373705728000.0 + (-22376988058521600.0 * x)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((6402373705728000.0d0 + ((-22376988058521600.0d0) * x)) * (x - 19.0d0)) * (x - 20.0d0)
else
tmp = (6402373705728000.0d0 * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((6402373705728000.0 + (-22376988058521600.0 * x)) * (x - 19.0)) * (x - 20.0);
} else {
tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((6402373705728000.0 + (-22376988058521600.0 * x)) * (x - 19.0)) * (x - 20.0) else: tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(6402373705728000.0 + Float64(-22376988058521600.0 * x)) * Float64(x - 19.0)) * Float64(x - 20.0)); else tmp = Float64(Float64(6402373705728000.0 * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((6402373705728000.0 + (-22376988058521600.0 * x)) * (x - 19.0)) * (x - 20.0); else tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(6402373705728000.0 + N[(-22376988058521600.0 * x), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(6402373705728000.0 * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(\left(6402373705728000 + -22376988058521600 \cdot x\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(6402373705728000 \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f648.0%
Applied rewrites8.0%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites6.0%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(* (- (* 431565146817638400.0 x) 121645100408832000.0) (- x 20.0))
(* (* 6402373705728000.0 (- x 19.0)) (- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((431565146817638400.0 * x) - 121645100408832000.0) * (x - 20.0);
} else {
tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((431565146817638400.0d0 * x) - 121645100408832000.0d0) * (x - 20.0d0)
else
tmp = (6402373705728000.0d0 * (x - 19.0d0)) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((431565146817638400.0 * x) - 121645100408832000.0) * (x - 20.0);
} else {
tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((431565146817638400.0 * x) - 121645100408832000.0) * (x - 20.0) else: tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(431565146817638400.0 * x) - 121645100408832000.0) * Float64(x - 20.0)); else tmp = Float64(Float64(6402373705728000.0 * Float64(x - 19.0)) * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((431565146817638400.0 * x) - 121645100408832000.0) * (x - 20.0); else tmp = (6402373705728000.0 * (x - 19.0)) * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(431565146817638400.0 * x), $MachinePrecision] - 121645100408832000.0), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(N[(6402373705728000.0 * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(431565146817638400 \cdot x - 121645100408832000\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;\left(6402373705728000 \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f648.1%
Applied rewrites8.1%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites6.0%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(* (- (* 431565146817638400.0 x) 121645100408832000.0) (- x 20.0))
(* -121645100408832000.0 (- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((431565146817638400.0 * x) - 121645100408832000.0) * (x - 20.0);
} else {
tmp = -121645100408832000.0 * (x - 20.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(x)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8) :: tmp
if (((((((((((((((((((((x - 1.0d0) * (x - 2.0d0)) * (x - 3.0d0)) * (x - 4.0d0)) * (x - 5.0d0)) * (x - 6.0d0)) * (x - 7.0d0)) * (x - 8.0d0)) * (x - 9.0d0)) * (x - 10.0d0)) * (x - 11.0d0)) * (x - 12.0d0)) * (x - 13.0d0)) * (x - 14.0d0)) * (x - 15.0d0)) * (x - 16.0d0)) * (x - 17.0d0)) * (x - 18.0d0)) * (x - 19.0d0)) * (x - 20.0d0)) <= (-2000000000.0d0)) then
tmp = ((431565146817638400.0d0 * x) - 121645100408832000.0d0) * (x - 20.0d0)
else
tmp = (-121645100408832000.0d0) * (x - 20.0d0)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = ((431565146817638400.0 * x) - 121645100408832000.0) * (x - 20.0);
} else {
tmp = -121645100408832000.0 * (x - 20.0);
}
return tmp;
}
def code(x): tmp = 0 if ((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0: tmp = ((431565146817638400.0 * x) - 121645100408832000.0) * (x - 20.0) else: tmp = -121645100408832000.0 * (x - 20.0) return tmp
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = Float64(Float64(Float64(431565146817638400.0 * x) - 121645100408832000.0) * Float64(x - 20.0)); else tmp = Float64(-121645100408832000.0 * Float64(x - 20.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) tmp = ((431565146817638400.0 * x) - 121645100408832000.0) * (x - 20.0); else tmp = -121645100408832000.0 * (x - 20.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(N[(N[(431565146817638400.0 * x), $MachinePrecision] - 121645100408832000.0), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], N[(-121645100408832000.0 * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\left(431565146817638400 \cdot x - 121645100408832000\right) \cdot \left(x - 20\right)\\
\mathbf{else}:\\
\;\;\;\;-121645100408832000 \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f648.1%
Applied rewrites8.1%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites5.7%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(fma x -8.7529480367616e+18 2.43290200817664e+18)
(* -121645100408832000.0 (- x 20.0))))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = fma(x, -8.7529480367616e+18, 2.43290200817664e+18);
} else {
tmp = -121645100408832000.0 * (x - 20.0);
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = fma(x, -8.7529480367616e+18, 2.43290200817664e+18); else tmp = Float64(-121645100408832000.0 * Float64(x - 20.0)); end return tmp end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(x * -8.7529480367616e+18 + 2.43290200817664e+18), $MachinePrecision], N[(-121645100408832000.0 * N[(x - 20.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\mathsf{fma}\left(x, -8.7529480367616 \cdot 10^{+18}, 2.43290200817664 \cdot 10^{+18}\right)\\
\mathbf{else}:\\
\;\;\;\;-121645100408832000 \cdot \left(x - 20\right)\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f648.1%
Applied rewrites8.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f648.1%
Applied rewrites8.1%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites5.7%
(FPCore (x)
:precision binary64
(if (<=
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(*
(* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0))
(- x 5.0))
(- x 6.0))
(- x 7.0))
(- x 8.0))
(- x 9.0))
(- x 10.0))
(- x 11.0))
(- x 12.0))
(- x 13.0))
(- x 14.0))
(- x 15.0))
(- x 16.0))
(- x 17.0))
(- x 18.0))
(- x 19.0))
(- x 20.0))
-2000000000.0)
(fma x -8.7529480367616e+18 2.43290200817664e+18)
2.43290200817664e+18))double code(double x) {
double tmp;
if (((((((((((((((((((((x - 1.0) * (x - 2.0)) * (x - 3.0)) * (x - 4.0)) * (x - 5.0)) * (x - 6.0)) * (x - 7.0)) * (x - 8.0)) * (x - 9.0)) * (x - 10.0)) * (x - 11.0)) * (x - 12.0)) * (x - 13.0)) * (x - 14.0)) * (x - 15.0)) * (x - 16.0)) * (x - 17.0)) * (x - 18.0)) * (x - 19.0)) * (x - 20.0)) <= -2000000000.0) {
tmp = fma(x, -8.7529480367616e+18, 2.43290200817664e+18);
} else {
tmp = 2.43290200817664e+18;
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x - 1.0) * Float64(x - 2.0)) * Float64(x - 3.0)) * Float64(x - 4.0)) * Float64(x - 5.0)) * Float64(x - 6.0)) * Float64(x - 7.0)) * Float64(x - 8.0)) * Float64(x - 9.0)) * Float64(x - 10.0)) * Float64(x - 11.0)) * Float64(x - 12.0)) * Float64(x - 13.0)) * Float64(x - 14.0)) * Float64(x - 15.0)) * Float64(x - 16.0)) * Float64(x - 17.0)) * Float64(x - 18.0)) * Float64(x - 19.0)) * Float64(x - 20.0)) <= -2000000000.0) tmp = fma(x, -8.7529480367616e+18, 2.43290200817664e+18); else tmp = 2.43290200817664e+18; end return tmp end
code[x_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x - 3.0), $MachinePrecision]), $MachinePrecision] * N[(x - 4.0), $MachinePrecision]), $MachinePrecision] * N[(x - 5.0), $MachinePrecision]), $MachinePrecision] * N[(x - 6.0), $MachinePrecision]), $MachinePrecision] * N[(x - 7.0), $MachinePrecision]), $MachinePrecision] * N[(x - 8.0), $MachinePrecision]), $MachinePrecision] * N[(x - 9.0), $MachinePrecision]), $MachinePrecision] * N[(x - 10.0), $MachinePrecision]), $MachinePrecision] * N[(x - 11.0), $MachinePrecision]), $MachinePrecision] * N[(x - 12.0), $MachinePrecision]), $MachinePrecision] * N[(x - 13.0), $MachinePrecision]), $MachinePrecision] * N[(x - 14.0), $MachinePrecision]), $MachinePrecision] * N[(x - 15.0), $MachinePrecision]), $MachinePrecision] * N[(x - 16.0), $MachinePrecision]), $MachinePrecision] * N[(x - 17.0), $MachinePrecision]), $MachinePrecision] * N[(x - 18.0), $MachinePrecision]), $MachinePrecision] * N[(x - 19.0), $MachinePrecision]), $MachinePrecision] * N[(x - 20.0), $MachinePrecision]), $MachinePrecision], -2000000000.0], N[(x * -8.7529480367616e+18 + 2.43290200817664e+18), $MachinePrecision], 2.43290200817664e+18]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(\left(x - 1\right) \cdot \left(x - 2\right)\right) \cdot \left(x - 3\right)\right) \cdot \left(x - 4\right)\right) \cdot \left(x - 5\right)\right) \cdot \left(x - 6\right)\right) \cdot \left(x - 7\right)\right) \cdot \left(x - 8\right)\right) \cdot \left(x - 9\right)\right) \cdot \left(x - 10\right)\right) \cdot \left(x - 11\right)\right) \cdot \left(x - 12\right)\right) \cdot \left(x - 13\right)\right) \cdot \left(x - 14\right)\right) \cdot \left(x - 15\right)\right) \cdot \left(x - 16\right)\right) \cdot \left(x - 17\right)\right) \cdot \left(x - 18\right)\right) \cdot \left(x - 19\right)\right) \cdot \left(x - 20\right) \leq -2000000000:\\
\;\;\;\;\mathsf{fma}\left(x, -8.7529480367616 \cdot 10^{+18}, 2.43290200817664 \cdot 10^{+18}\right)\\
\mathbf{else}:\\
\;\;\;\;2.43290200817664 \cdot 10^{+18}\\
\end{array}
if (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) < -2e9Initial program 97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites97.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f648.1%
Applied rewrites8.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f648.1%
Applied rewrites8.1%
if -2e9 < (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (-.f64 x #s(literal 2 binary64))) (-.f64 x #s(literal 3 binary64))) (-.f64 x #s(literal 4 binary64))) (-.f64 x #s(literal 5 binary64))) (-.f64 x #s(literal 6 binary64))) (-.f64 x #s(literal 7 binary64))) (-.f64 x #s(literal 8 binary64))) (-.f64 x #s(literal 9 binary64))) (-.f64 x #s(literal 10 binary64))) (-.f64 x #s(literal 11 binary64))) (-.f64 x #s(literal 12 binary64))) (-.f64 x #s(literal 13 binary64))) (-.f64 x #s(literal 14 binary64))) (-.f64 x #s(literal 15 binary64))) (-.f64 x #s(literal 16 binary64))) (-.f64 x #s(literal 17 binary64))) (-.f64 x #s(literal 18 binary64))) (-.f64 x #s(literal 19 binary64))) (-.f64 x #s(literal 20 binary64))) Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites5.7%
(FPCore (x) :precision binary64 2.43290200817664e+18)
double code(double x) {
return 2.43290200817664e+18;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = 2.43290200817664d+18
end function
public static double code(double x) {
return 2.43290200817664e+18;
}
def code(x): return 2.43290200817664e+18
function code(x) return 2.43290200817664e+18 end
function tmp = code(x) tmp = 2.43290200817664e+18; end
code[x_] := 2.43290200817664e+18
2.43290200817664 \cdot 10^{+18}
Initial program 97.8%
Taylor expanded in x around 0
Applied rewrites5.7%
herbie shell --seed 2025183
(FPCore (x)
:name "(x - 1) to (x - 20)"
:precision binary64
:pre (and (<= 1.0 x) (<= x 20.0))
(* (* (* (* (* (* (* (* (* (* (* (* (* (* (* (* (* (* (* (- x 1.0) (- x 2.0)) (- x 3.0)) (- x 4.0)) (- x 5.0)) (- x 6.0)) (- x 7.0)) (- x 8.0)) (- x 9.0)) (- x 10.0)) (- x 11.0)) (- x 12.0)) (- x 13.0)) (- x 14.0)) (- x 15.0)) (- x 16.0)) (- x 17.0)) (- x 18.0)) (- x 19.0)) (- x 20.0)))