
(FPCore (x) :precision binary64 (log (/ (sinh x) x)))
double code(double x) {
return log((sinh(x) / x));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = log((sinh(x) / x))
end function
public static double code(double x) {
return Math.log((Math.sinh(x) / x));
}
def code(x): return math.log((math.sinh(x) / x))
function code(x) return log(Float64(sinh(x) / x)) end
function tmp = code(x) tmp = log((sinh(x) / x)); end
code[x_] := N[Log[N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]
\log \left(\frac{\sinh x}{x}\right)
Herbie found 5 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (log (/ (sinh x) x)))
double code(double x) {
return log((sinh(x) / x));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = log((sinh(x) / x))
end function
public static double code(double x) {
return Math.log((Math.sinh(x) / x));
}
def code(x): return math.log((math.sinh(x) / x))
function code(x) return log(Float64(sinh(x) / x)) end
function tmp = code(x) tmp = log((sinh(x) / x)); end
code[x_] := N[Log[N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]
\log \left(\frac{\sinh x}{x}\right)
(FPCore (x)
:precision binary64
(*
(/
(-
(* 3.08641975308642e-5 (pow x 6.0))
(* (* 0.16666666666666666 x) (* 0.16666666666666666 x)))
(-
(*
(*
(- (* (* 0.0003527336860670194 x) x) 0.005555555555555556)
(* x x))
x)
(* 0.16666666666666666 x)))
x))double code(double x) {
return (((3.08641975308642e-5 * pow(x, 6.0)) - ((0.16666666666666666 * x) * (0.16666666666666666 * x))) / ((((((0.0003527336860670194 * x) * x) - 0.005555555555555556) * (x * x)) * x) - (0.16666666666666666 * x))) * x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (((3.08641975308642d-5 * (x ** 6.0d0)) - ((0.16666666666666666d0 * x) * (0.16666666666666666d0 * x))) / ((((((0.0003527336860670194d0 * x) * x) - 0.005555555555555556d0) * (x * x)) * x) - (0.16666666666666666d0 * x))) * x
end function
public static double code(double x) {
return (((3.08641975308642e-5 * Math.pow(x, 6.0)) - ((0.16666666666666666 * x) * (0.16666666666666666 * x))) / ((((((0.0003527336860670194 * x) * x) - 0.005555555555555556) * (x * x)) * x) - (0.16666666666666666 * x))) * x;
}
def code(x): return (((3.08641975308642e-5 * math.pow(x, 6.0)) - ((0.16666666666666666 * x) * (0.16666666666666666 * x))) / ((((((0.0003527336860670194 * x) * x) - 0.005555555555555556) * (x * x)) * x) - (0.16666666666666666 * x))) * x
function code(x) return Float64(Float64(Float64(Float64(3.08641975308642e-5 * (x ^ 6.0)) - Float64(Float64(0.16666666666666666 * x) * Float64(0.16666666666666666 * x))) / Float64(Float64(Float64(Float64(Float64(Float64(0.0003527336860670194 * x) * x) - 0.005555555555555556) * Float64(x * x)) * x) - Float64(0.16666666666666666 * x))) * x) end
function tmp = code(x) tmp = (((3.08641975308642e-5 * (x ^ 6.0)) - ((0.16666666666666666 * x) * (0.16666666666666666 * x))) / ((((((0.0003527336860670194 * x) * x) - 0.005555555555555556) * (x * x)) * x) - (0.16666666666666666 * x))) * x; end
code[x_] := N[(N[(N[(N[(3.08641975308642e-5 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision] - N[(N[(0.16666666666666666 * x), $MachinePrecision] * N[(0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(0.0003527336860670194 * x), $MachinePrecision] * x), $MachinePrecision] - 0.005555555555555556), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{3.08641975308642 \cdot 10^{-5} \cdot {x}^{6} - \left(0.16666666666666666 \cdot x\right) \cdot \left(0.16666666666666666 \cdot x\right)}{\left(\left(\left(0.0003527336860670194 \cdot x\right) \cdot x - 0.005555555555555556\right) \cdot \left(x \cdot x\right)\right) \cdot x - 0.16666666666666666 \cdot x} \cdot x
Initial program 52.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f6496.9%
Applied rewrites96.9%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites97.0%
Applied rewrites96.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-pow.f6497.0%
Applied rewrites97.0%
(FPCore (x)
:precision binary64
(*
(*
(-
(*
(* (- (* 0.0003527336860670194 (* x x)) 0.005555555555555556) x)
x)
-0.16666666666666666)
x)
x))double code(double x) {
return ((((((0.0003527336860670194 * (x * x)) - 0.005555555555555556) * x) * x) - -0.16666666666666666) * x) * x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = ((((((0.0003527336860670194d0 * (x * x)) - 0.005555555555555556d0) * x) * x) - (-0.16666666666666666d0)) * x) * x
end function
public static double code(double x) {
return ((((((0.0003527336860670194 * (x * x)) - 0.005555555555555556) * x) * x) - -0.16666666666666666) * x) * x;
}
def code(x): return ((((((0.0003527336860670194 * (x * x)) - 0.005555555555555556) * x) * x) - -0.16666666666666666) * x) * x
function code(x) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(0.0003527336860670194 * Float64(x * x)) - 0.005555555555555556) * x) * x) - -0.16666666666666666) * x) * x) end
function tmp = code(x) tmp = ((((((0.0003527336860670194 * (x * x)) - 0.005555555555555556) * x) * x) - -0.16666666666666666) * x) * x; end
code[x_] := N[(N[(N[(N[(N[(N[(N[(0.0003527336860670194 * N[(x * x), $MachinePrecision]), $MachinePrecision] - 0.005555555555555556), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] - -0.16666666666666666), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]
\left(\left(\left(\left(0.0003527336860670194 \cdot \left(x \cdot x\right) - 0.005555555555555556\right) \cdot x\right) \cdot x - -0.16666666666666666\right) \cdot x\right) \cdot x
Initial program 52.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f6496.9%
Applied rewrites96.9%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites97.0%
(FPCore (x) :precision binary64 (* (* x x) (+ 0.16666666666666666 (* (* x x) (- (* 0.0003527336860670194 (* x x)) 0.005555555555555556)))))
double code(double x) {
return (x * x) * (0.16666666666666666 + ((x * x) * ((0.0003527336860670194 * (x * x)) - 0.005555555555555556)));
}
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 * x) * (0.16666666666666666d0 + ((x * x) * ((0.0003527336860670194d0 * (x * x)) - 0.005555555555555556d0)))
end function
public static double code(double x) {
return (x * x) * (0.16666666666666666 + ((x * x) * ((0.0003527336860670194 * (x * x)) - 0.005555555555555556)));
}
def code(x): return (x * x) * (0.16666666666666666 + ((x * x) * ((0.0003527336860670194 * (x * x)) - 0.005555555555555556)))
function code(x) return Float64(Float64(x * x) * Float64(0.16666666666666666 + Float64(Float64(x * x) * Float64(Float64(0.0003527336860670194 * Float64(x * x)) - 0.005555555555555556)))) end
function tmp = code(x) tmp = (x * x) * (0.16666666666666666 + ((x * x) * ((0.0003527336860670194 * (x * x)) - 0.005555555555555556))); end
code[x_] := N[(N[(x * x), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * N[(N[(0.0003527336860670194 * N[(x * x), $MachinePrecision]), $MachinePrecision] - 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot x\right) \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot \left(0.0003527336860670194 \cdot \left(x \cdot x\right) - 0.005555555555555556\right)\right)
Initial program 52.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f6496.9%
Applied rewrites96.9%
lift-pow.f64N/A
unpow2N/A
lower-*.f6496.9%
Applied rewrites96.9%
lift-pow.f64N/A
unpow2N/A
lower-*.f6496.9%
Applied rewrites96.9%
lift-pow.f64N/A
unpow2N/A
lower-*.f6496.9%
Applied rewrites96.9%
(FPCore (x) :precision binary64 (* (* 0.16666666666666666 x) x))
double code(double x) {
return (0.16666666666666666 * x) * x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x)
use fmin_fmax_functions
real(8), intent (in) :: x
code = (0.16666666666666666d0 * x) * x
end function
public static double code(double x) {
return (0.16666666666666666 * x) * x;
}
def code(x): return (0.16666666666666666 * x) * x
function code(x) return Float64(Float64(0.16666666666666666 * x) * x) end
function tmp = code(x) tmp = (0.16666666666666666 * x) * x; end
code[x_] := N[(N[(0.16666666666666666 * x), $MachinePrecision] * x), $MachinePrecision]
\left(0.16666666666666666 \cdot x\right) \cdot x
Initial program 52.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f6496.9%
Applied rewrites96.9%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites97.0%
Taylor expanded in x around 0
Applied rewrites96.3%
(FPCore (x) :precision binary64 (* (* x x) 0.16666666666666666))
double code(double x) {
return (x * x) * 0.16666666666666666;
}
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 * x) * 0.16666666666666666d0
end function
public static double code(double x) {
return (x * x) * 0.16666666666666666;
}
def code(x): return (x * x) * 0.16666666666666666
function code(x) return Float64(Float64(x * x) * 0.16666666666666666) end
function tmp = code(x) tmp = (x * x) * 0.16666666666666666; end
code[x_] := N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]
\left(x \cdot x\right) \cdot 0.16666666666666666
Initial program 52.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f6496.9%
Applied rewrites96.9%
Taylor expanded in x around 0
Applied rewrites96.3%
lift-pow.f64N/A
pow2N/A
lift-*.f6496.3%
Applied rewrites96.3%
herbie shell --seed 2025258
(FPCore (x)
:name "bug500, discussion (missed optimization)"
:precision binary64
(log (/ (sinh x) x)))