
(FPCore ()
:precision binary64
(+
(+
(+
(* 333.75 (pow 33096.0 6.0))
(*
(* 77617.0 77617.0)
(+
(+
(+
(* (* 11.0 (* 77617.0 77617.0)) (* 33096.0 33096.0))
(- (pow 33096.0 6.0)))
(* -121.0 (pow 33096.0 4.0)))
-2.0)))
(* 5.5 (pow 33096.0 8.0)))
(/ 77617.0 (* 2.0 33096.0))))
double code() {
return (((333.75 * pow(33096.0, 6.0)) + ((77617.0 * 77617.0) * (((((11.0 * (77617.0 * 77617.0)) * (33096.0 * 33096.0)) + -pow(33096.0, 6.0)) + (-121.0 * pow(33096.0, 4.0))) + -2.0))) + (5.5 * pow(33096.0, 8.0))) + (77617.0 / (2.0 * 33096.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()
use fmin_fmax_functions
code = (((333.75d0 * (33096.0d0 ** 6.0d0)) + ((77617.0d0 * 77617.0d0) * (((((11.0d0 * (77617.0d0 * 77617.0d0)) * (33096.0d0 * 33096.0d0)) + -(33096.0d0 ** 6.0d0)) + ((-121.0d0) * (33096.0d0 ** 4.0d0))) + (-2.0d0)))) + (5.5d0 * (33096.0d0 ** 8.0d0))) + (77617.0d0 / (2.0d0 * 33096.0d0))
end function
public static double code() {
return (((333.75 * Math.pow(33096.0, 6.0)) + ((77617.0 * 77617.0) * (((((11.0 * (77617.0 * 77617.0)) * (33096.0 * 33096.0)) + -Math.pow(33096.0, 6.0)) + (-121.0 * Math.pow(33096.0, 4.0))) + -2.0))) + (5.5 * Math.pow(33096.0, 8.0))) + (77617.0 / (2.0 * 33096.0));
}
def code(): return (((333.75 * math.pow(33096.0, 6.0)) + ((77617.0 * 77617.0) * (((((11.0 * (77617.0 * 77617.0)) * (33096.0 * 33096.0)) + -math.pow(33096.0, 6.0)) + (-121.0 * math.pow(33096.0, 4.0))) + -2.0))) + (5.5 * math.pow(33096.0, 8.0))) + (77617.0 / (2.0 * 33096.0))
function code() return Float64(Float64(Float64(Float64(333.75 * (33096.0 ^ 6.0)) + Float64(Float64(77617.0 * 77617.0) * Float64(Float64(Float64(Float64(Float64(11.0 * Float64(77617.0 * 77617.0)) * Float64(33096.0 * 33096.0)) + Float64(-(33096.0 ^ 6.0))) + Float64(-121.0 * (33096.0 ^ 4.0))) + -2.0))) + Float64(5.5 * (33096.0 ^ 8.0))) + Float64(77617.0 / Float64(2.0 * 33096.0))) end
function tmp = code() tmp = (((333.75 * (33096.0 ^ 6.0)) + ((77617.0 * 77617.0) * (((((11.0 * (77617.0 * 77617.0)) * (33096.0 * 33096.0)) + -(33096.0 ^ 6.0)) + (-121.0 * (33096.0 ^ 4.0))) + -2.0))) + (5.5 * (33096.0 ^ 8.0))) + (77617.0 / (2.0 * 33096.0)); end
code[] := N[(N[(N[(N[(333.75 * N[Power[33096.0, 6.0], $MachinePrecision]), $MachinePrecision] + N[(N[(77617.0 * 77617.0), $MachinePrecision] * N[(N[(N[(N[(N[(11.0 * N[(77617.0 * 77617.0), $MachinePrecision]), $MachinePrecision] * N[(33096.0 * 33096.0), $MachinePrecision]), $MachinePrecision] + (-N[Power[33096.0, 6.0], $MachinePrecision])), $MachinePrecision] + N[(-121.0 * N[Power[33096.0, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(5.5 * N[Power[33096.0, 8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(77617.0 / N[(2.0 * 33096.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(333.75 \cdot {33096}^{6} + \left(77617 \cdot 77617\right) \cdot \left(\left(\left(\left(11 \cdot \left(77617 \cdot 77617\right)\right) \cdot \left(33096 \cdot 33096\right) + \left(-{33096}^{6}\right)\right) + -121 \cdot {33096}^{4}\right) + -2\right)\right) + 5.5 \cdot {33096}^{8}\right) + \frac{77617}{2 \cdot 33096}
\end{array}
Herbie found 1 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore ()
:precision binary64
(+
(+
(+
(* 333.75 (pow 33096.0 6.0))
(*
(* 77617.0 77617.0)
(+
(+
(+
(* (* 11.0 (* 77617.0 77617.0)) (* 33096.0 33096.0))
(- (pow 33096.0 6.0)))
(* -121.0 (pow 33096.0 4.0)))
-2.0)))
(* 5.5 (pow 33096.0 8.0)))
(/ 77617.0 (* 2.0 33096.0))))
double code() {
return (((333.75 * pow(33096.0, 6.0)) + ((77617.0 * 77617.0) * (((((11.0 * (77617.0 * 77617.0)) * (33096.0 * 33096.0)) + -pow(33096.0, 6.0)) + (-121.0 * pow(33096.0, 4.0))) + -2.0))) + (5.5 * pow(33096.0, 8.0))) + (77617.0 / (2.0 * 33096.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()
use fmin_fmax_functions
code = (((333.75d0 * (33096.0d0 ** 6.0d0)) + ((77617.0d0 * 77617.0d0) * (((((11.0d0 * (77617.0d0 * 77617.0d0)) * (33096.0d0 * 33096.0d0)) + -(33096.0d0 ** 6.0d0)) + ((-121.0d0) * (33096.0d0 ** 4.0d0))) + (-2.0d0)))) + (5.5d0 * (33096.0d0 ** 8.0d0))) + (77617.0d0 / (2.0d0 * 33096.0d0))
end function
public static double code() {
return (((333.75 * Math.pow(33096.0, 6.0)) + ((77617.0 * 77617.0) * (((((11.0 * (77617.0 * 77617.0)) * (33096.0 * 33096.0)) + -Math.pow(33096.0, 6.0)) + (-121.0 * Math.pow(33096.0, 4.0))) + -2.0))) + (5.5 * Math.pow(33096.0, 8.0))) + (77617.0 / (2.0 * 33096.0));
}
def code(): return (((333.75 * math.pow(33096.0, 6.0)) + ((77617.0 * 77617.0) * (((((11.0 * (77617.0 * 77617.0)) * (33096.0 * 33096.0)) + -math.pow(33096.0, 6.0)) + (-121.0 * math.pow(33096.0, 4.0))) + -2.0))) + (5.5 * math.pow(33096.0, 8.0))) + (77617.0 / (2.0 * 33096.0))
function code() return Float64(Float64(Float64(Float64(333.75 * (33096.0 ^ 6.0)) + Float64(Float64(77617.0 * 77617.0) * Float64(Float64(Float64(Float64(Float64(11.0 * Float64(77617.0 * 77617.0)) * Float64(33096.0 * 33096.0)) + Float64(-(33096.0 ^ 6.0))) + Float64(-121.0 * (33096.0 ^ 4.0))) + -2.0))) + Float64(5.5 * (33096.0 ^ 8.0))) + Float64(77617.0 / Float64(2.0 * 33096.0))) end
function tmp = code() tmp = (((333.75 * (33096.0 ^ 6.0)) + ((77617.0 * 77617.0) * (((((11.0 * (77617.0 * 77617.0)) * (33096.0 * 33096.0)) + -(33096.0 ^ 6.0)) + (-121.0 * (33096.0 ^ 4.0))) + -2.0))) + (5.5 * (33096.0 ^ 8.0))) + (77617.0 / (2.0 * 33096.0)); end
code[] := N[(N[(N[(N[(333.75 * N[Power[33096.0, 6.0], $MachinePrecision]), $MachinePrecision] + N[(N[(77617.0 * 77617.0), $MachinePrecision] * N[(N[(N[(N[(N[(11.0 * N[(77617.0 * 77617.0), $MachinePrecision]), $MachinePrecision] * N[(33096.0 * 33096.0), $MachinePrecision]), $MachinePrecision] + (-N[Power[33096.0, 6.0], $MachinePrecision])), $MachinePrecision] + N[(-121.0 * N[Power[33096.0, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(5.5 * N[Power[33096.0, 8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(77617.0 / N[(2.0 * 33096.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(333.75 \cdot {33096}^{6} + \left(77617 \cdot 77617\right) \cdot \left(\left(\left(\left(11 \cdot \left(77617 \cdot 77617\right)\right) \cdot \left(33096 \cdot 33096\right) + \left(-{33096}^{6}\right)\right) + -121 \cdot {33096}^{4}\right) + -2\right)\right) + 5.5 \cdot {33096}^{8}\right) + \frac{77617}{2 \cdot 33096}
\end{array}
(FPCore () :precision binary64 -0.8273960599468214)
double code() {
return -0.8273960599468214;
}
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()
use fmin_fmax_functions
code = -0.8273960599468214d0
end function
public static double code() {
return -0.8273960599468214;
}
def code(): return -0.8273960599468214
function code() return -0.8273960599468214 end
function tmp = code() tmp = -0.8273960599468214; end
code[] := -0.8273960599468214
\begin{array}{l}
\\
-0.8273960599468214
\end{array}
Initial program 9.2%
lift-+.f64N/A
Applied rewrites100.0%
herbie shell --seed 2025130
(FPCore ()
:name "From Warwick Tucker's Validated Numerics"
:precision binary64
(+ (+ (+ (* 333.75 (pow 33096.0 6.0)) (* (* 77617.0 77617.0) (+ (+ (+ (* (* 11.0 (* 77617.0 77617.0)) (* 33096.0 33096.0)) (- (pow 33096.0 6.0))) (* -121.0 (pow 33096.0 4.0))) -2.0))) (* 5.5 (pow 33096.0 8.0))) (/ 77617.0 (* 2.0 33096.0))))