
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (+ (* (- (+ (* z y) (* z 0.0007936500793651)) 0.0027777777777778) (/ z x)) (* 0.083333333333333 (/ 1.0 x)))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((((z * y) + (z * 0.0007936500793651)) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (((((z * y) + (z * 0.0007936500793651d0)) - 0.0027777777777778d0) * (z / x)) + (0.083333333333333d0 * (1.0d0 / x)))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (((((z * y) + (z * 0.0007936500793651)) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x)));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (((((z * y) + (z * 0.0007936500793651)) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x)))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(z * y) + Float64(z * 0.0007936500793651)) - 0.0027777777777778) * Float64(z / x)) + Float64(0.083333333333333 * Float64(1.0 / x)))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((((z * y) + (z * 0.0007936500793651)) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x))); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(z * y), $MachinePrecision] + N[(z * 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(\left(z \cdot y + z \cdot 0.0007936500793651\right) - 0.0027777777777778\right) \cdot \frac{z}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)
Initial program 94.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6494.5%
Applied rewrites94.5%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
Applied rewrites98.8%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-lft-inN/A
*-commutativeN/A
lift-*.f64N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6498.8%
Applied rewrites98.8%
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (+ (* (- (* (- y -0.0007936500793651) z) 0.0027777777777778) (/ z x)) (* 0.083333333333333 (/ 1.0 x)))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((((y - -0.0007936500793651) * z) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (((((y - (-0.0007936500793651d0)) * z) - 0.0027777777777778d0) * (z / x)) + (0.083333333333333d0 * (1.0d0 / x)))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (((((y - -0.0007936500793651) * z) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x)));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (((((y - -0.0007936500793651) * z) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x)))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(y - -0.0007936500793651) * z) - 0.0027777777777778) * Float64(z / x)) + Float64(0.083333333333333 * Float64(1.0 / x)))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((((y - -0.0007936500793651) * z) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x))); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(\left(y - -0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot \frac{z}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)
Initial program 94.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6494.5%
Applied rewrites94.5%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
Applied rewrites98.8%
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (- (/ 0.083333333333333 x) (* (/ (- 0.0027777777777778 (* (- y -0.0007936500793651) z)) x) z))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 / x) - (((0.0027777777777778 - ((y - -0.0007936500793651) * z)) / x) * z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((0.083333333333333d0 / x) - (((0.0027777777777778d0 - ((y - (-0.0007936500793651d0)) * z)) / x) * z))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 / x) - (((0.0027777777777778 - ((y - -0.0007936500793651) * z)) / x) * z));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 / x) - (((0.0027777777777778 - ((y - -0.0007936500793651) * z)) / x) * z))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 / x) - Float64(Float64(Float64(0.0027777777777778 - Float64(Float64(y - -0.0007936500793651) * z)) / x) * z))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 / x) - (((0.0027777777777778 - ((y - -0.0007936500793651) * z)) / x) * z)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 / x), $MachinePrecision] - N[(N[(N[(0.0027777777777778 - N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\frac{0.083333333333333}{x} - \frac{0.0027777777777778 - \left(y - -0.0007936500793651\right) \cdot z}{x} \cdot z\right)
Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Applied rewrites97.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<=
(+
t_0
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
2e+307)
(+
t_0
(/
(+
(-
(* (* z (- y -0.0007936500793651)) z)
(* 0.0027777777777778 z))
0.083333333333333)
x))
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(+
(*
(- (* (- y -0.0007936500793651) z) 0.0027777777777778)
(/ z x))
(* 0.083333333333333 (/ 1.0 x)))))))double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) {
tmp = t_0 + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + (-0.5 * log(x))) + (((((y - -0.0007936500793651) * z) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
if ((t_0 + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)) <= 2d+307) then
tmp = t_0 + (((((z * (y - (-0.0007936500793651d0))) * z) - (0.0027777777777778d0 * z)) + 0.083333333333333d0) / x)
else
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + (((((y - (-0.0007936500793651d0)) * z) - 0.0027777777777778d0) * (z / x)) + (0.083333333333333d0 * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) {
tmp = t_0 + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + (((((y - -0.0007936500793651) * z) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307: tmp = t_0 + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x) else: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + (((((y - -0.0007936500793651) * z) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (Float64(t_0 + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) tmp = Float64(t_0 + Float64(Float64(Float64(Float64(Float64(z * Float64(y - -0.0007936500793651)) * z) - Float64(0.0027777777777778 * z)) + 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(Float64(Float64(Float64(y - -0.0007936500793651) * z) - 0.0027777777777778) * Float64(z / x)) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) tmp = t_0 + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x); else tmp = (0.91893853320467 + (-0.5 * log(x))) + (((((y - -0.0007936500793651) * z) - 0.0027777777777778) * (z / x)) + (0.083333333333333 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[N[(t$95$0 + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], 2e+307], N[(t$95$0 + N[(N[(N[(N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] - N[(0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;t\_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_0 + \frac{\left(\left(z \cdot \left(y - -0.0007936500793651\right)\right) \cdot z - 0.0027777777777778 \cdot z\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \left(\left(\left(y - -0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot \frac{z}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 2e307Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
if 2e307 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6494.5%
Applied rewrites94.5%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
Applied rewrites98.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6465.4%
Applied rewrites65.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<=
(+
t_0
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
2e+307)
(+
t_0
(/
(+
(-
(* (* z (- y -0.0007936500793651)) z)
(* 0.0027777777777778 z))
0.083333333333333)
x))
(* (/ 1.0 (/ x (* (- y -0.0007936500793651) z))) z))))double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) {
tmp = t_0 + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x);
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
if ((t_0 + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)) <= 2d+307) then
tmp = t_0 + (((((z * (y - (-0.0007936500793651d0))) * z) - (0.0027777777777778d0 * z)) + 0.083333333333333d0) / x)
else
tmp = (1.0d0 / (x / ((y - (-0.0007936500793651d0)) * z))) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) {
tmp = t_0 + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x);
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
def code(x, y, z): t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307: tmp = t_0 + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x) else: tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (Float64(t_0 + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) tmp = Float64(t_0 + Float64(Float64(Float64(Float64(Float64(z * Float64(y - -0.0007936500793651)) * z) - Float64(0.0027777777777778 * z)) + 0.083333333333333) / x)); else tmp = Float64(Float64(1.0 / Float64(x / Float64(Float64(y - -0.0007936500793651) * z))) * z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) tmp = t_0 + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x); else tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[N[(t$95$0 + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], 2e+307], N[(t$95$0 + N[(N[(N[(N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] - N[(0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x / N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;t\_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_0 + \frac{\left(\left(z \cdot \left(y - -0.0007936500793651\right)\right) \cdot z - 0.0027777777777778 \cdot z\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\left(y - -0.0007936500793651\right) \cdot z}} \cdot z\\
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 2e307Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
if 2e307 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-lft-outN/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6443.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-outN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6443.6%
Applied rewrites43.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<=
(+
t_0
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
2e+307)
(+
t_0
(*
(/ 1.0 x)
(-
(* (- (* z (- y -0.0007936500793651)) 0.0027777777777778) z)
-0.083333333333333)))
(* (/ 1.0 (/ x (* (- y -0.0007936500793651) z))) z))))double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) {
tmp = t_0 + ((1.0 / x) * ((((z * (y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333));
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
if ((t_0 + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)) <= 2d+307) then
tmp = t_0 + ((1.0d0 / x) * ((((z * (y - (-0.0007936500793651d0))) - 0.0027777777777778d0) * z) - (-0.083333333333333d0)))
else
tmp = (1.0d0 / (x / ((y - (-0.0007936500793651d0)) * z))) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) {
tmp = t_0 + ((1.0 / x) * ((((z * (y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333));
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
def code(x, y, z): t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307: tmp = t_0 + ((1.0 / x) * ((((z * (y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333)) else: tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (Float64(t_0 + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) tmp = Float64(t_0 + Float64(Float64(1.0 / x) * Float64(Float64(Float64(Float64(z * Float64(y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333))); else tmp = Float64(Float64(1.0 / Float64(x / Float64(Float64(y - -0.0007936500793651) * z))) * z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) tmp = t_0 + ((1.0 / x) * ((((z * (y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333)); else tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[N[(t$95$0 + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], 2e+307], N[(t$95$0 + N[(N[(1.0 / x), $MachinePrecision] * N[(N[(N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] - -0.083333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x / N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;t\_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_0 + \frac{1}{x} \cdot \left(\left(z \cdot \left(y - -0.0007936500793651\right) - 0.0027777777777778\right) \cdot z - -0.083333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\left(y - -0.0007936500793651\right) \cdot z}} \cdot z\\
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 2e307Initial program 94.2%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.1%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-eval94.1%
Applied rewrites94.1%
if 2e307 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-lft-outN/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6443.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-outN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6443.6%
Applied rewrites43.6%
(FPCore (x y z)
:precision binary64
(if (<=
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
2e+307)
(-
(-
(/
(-
(* (- (* z (- y -0.0007936500793651)) 0.0027777777777778) z)
-0.083333333333333)
x)
-0.91893853320467)
(- x (* (log x) (- x 0.5))))
(* (/ 1.0 (/ x (* (- y -0.0007936500793651) z))) z)))double code(double x, double y, double z) {
double tmp;
if ((((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) {
tmp = ((((((z * (y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333) / x) - -0.91893853320467) - (x - (log(x) * (x - 0.5)));
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)) <= 2d+307) then
tmp = ((((((z * (y - (-0.0007936500793651d0))) - 0.0027777777777778d0) * z) - (-0.083333333333333d0)) / x) - (-0.91893853320467d0)) - (x - (log(x) * (x - 0.5d0)))
else
tmp = (1.0d0 / (x / ((y - (-0.0007936500793651d0)) * z))) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) {
tmp = ((((((z * (y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333) / x) - -0.91893853320467) - (x - (Math.log(x) * (x - 0.5)));
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307: tmp = ((((((z * (y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333) / x) - -0.91893853320467) - (x - (math.log(x) * (x - 0.5))) else: tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z return tmp
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * Float64(y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333) / x) - -0.91893853320467) - Float64(x - Float64(log(x) * Float64(x - 0.5)))); else tmp = Float64(Float64(1.0 / Float64(x / Float64(Float64(y - -0.0007936500793651) * z))) * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= 2e+307) tmp = ((((((z * (y - -0.0007936500793651)) - 0.0027777777777778) * z) - -0.083333333333333) / x) - -0.91893853320467) - (x - (log(x) * (x - 0.5))); else tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], 2e+307], N[(N[(N[(N[(N[(N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] - -0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - -0.91893853320467), $MachinePrecision] - N[(x - N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x / N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \leq 2 \cdot 10^{+307}:\\
\;\;\;\;\left(\frac{\left(z \cdot \left(y - -0.0007936500793651\right) - 0.0027777777777778\right) \cdot z - -0.083333333333333}{x} - -0.91893853320467\right) - \left(x - \log x \cdot \left(x - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\left(y - -0.0007936500793651\right) \cdot z}} \cdot z\\
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 2e307Initial program 94.2%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
add-flipN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
Applied rewrites94.2%
if 2e307 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-lft-outN/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6443.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-outN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6443.6%
Applied rewrites43.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))))
(if (<= t_0 2e+307)
t_0
(* (/ 1.0 (/ x (* (- y -0.0007936500793651) z))) z))))double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
double tmp;
if (t_0 <= 2e+307) {
tmp = t_0;
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
if (t_0 <= 2d+307) then
tmp = t_0
else
tmp = (1.0d0 / (x / ((y - (-0.0007936500793651d0)) * z))) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
double tmp;
if (t_0 <= 2e+307) {
tmp = t_0;
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
def code(x, y, z): t_0 = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) tmp = 0 if t_0 <= 2e+307: tmp = t_0 else: tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) tmp = 0.0 if (t_0 <= 2e+307) tmp = t_0; else tmp = Float64(Float64(1.0 / Float64(x / Float64(Float64(y - -0.0007936500793651) * z))) * z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); tmp = 0.0; if (t_0 <= 2e+307) tmp = t_0; else tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+307], t$95$0, N[(N[(1.0 / N[(x / N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\left(y - -0.0007936500793651\right) \cdot z}} \cdot z\\
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 2e307Initial program 94.2%
if 2e307 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-lft-outN/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6443.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-outN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6443.6%
Applied rewrites43.6%
(FPCore (x y z)
:precision binary64
(if (<= x 86.0)
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/
(+
(-
(* (* z (- y -0.0007936500793651)) z)
(* 0.0027777777777778 z))
0.083333333333333)
x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ (+ (* (- (* y z) 0.0027777777777778) z) 0.083333333333333) x))))double code(double x, double y, double z) {
double tmp;
if (x <= 86.0) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((((y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 86.0d0) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + (((((z * (y - (-0.0007936500793651d0))) * z) - (0.0027777777777778d0 * z)) + 0.083333333333333d0) / x)
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (((((y * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 86.0) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x);
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (((((y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 86.0: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (((((y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 86.0) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(Float64(Float64(Float64(z * Float64(y - -0.0007936500793651)) * z) - Float64(0.0027777777777778 * z)) + 0.083333333333333) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 86.0) tmp = (0.91893853320467 + (-0.5 * log(x))) + (((((z * (y - -0.0007936500793651)) * z) - (0.0027777777777778 * z)) + 0.083333333333333) / x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((((y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 86.0], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] - N[(0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(y * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 86:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{\left(\left(z \cdot \left(y - -0.0007936500793651\right)\right) \cdot z - 0.0027777777777778 \cdot z\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(y \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\end{array}
if x < 86Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6463.3%
Applied rewrites63.3%
if 86 < x Initial program 94.2%
Taylor expanded in y around inf
lower-*.f6483.7%
Applied rewrites83.7%
(FPCore (x y z)
:precision binary64
(if (<= x 86.0)
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ (+ (* (- (* y z) 0.0027777777777778) z) 0.083333333333333) x))))double code(double x, double y, double z) {
double tmp;
if (x <= 86.0) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((((y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 86.0d0) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (((((y * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 86.0) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (((((y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 86.0: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (((((y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 86.0) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 86.0) tmp = (0.91893853320467 + (-0.5 * log(x))) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((((y * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 86.0], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(y * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 86:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(y \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\end{array}
if x < 86Initial program 94.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6463.3%
Applied rewrites63.3%
if 86 < x Initial program 94.2%
Taylor expanded in y around inf
lower-*.f6483.7%
Applied rewrites83.7%
(FPCore (x y z)
:precision binary64
(if (<= x 98.0)
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))double code(double x, double y, double z) {
double tmp;
if (x <= 98.0) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 98.0d0) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 98.0) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 98.0: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 98.0) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 98.0) tmp = (0.91893853320467 + (-0.5 * log(x))) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 98.0], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 98:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
if x < 98Initial program 94.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6463.3%
Applied rewrites63.3%
if 98 < x Initial program 94.2%
Taylor expanded in z around 0
Applied rewrites57.5%
(FPCore (x y z)
:precision binary64
(if (<= x 98.0)
(/
(-
(+ 0.083333333333333 (* (pow z 2.0) (+ 0.0007936500793651 y)))
(* 0.0027777777777778 z))
x)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))double code(double x, double y, double z) {
double tmp;
if (x <= 98.0) {
tmp = ((0.083333333333333 + (pow(z, 2.0) * (0.0007936500793651 + y))) - (0.0027777777777778 * z)) / x;
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 98.0d0) then
tmp = ((0.083333333333333d0 + ((z ** 2.0d0) * (0.0007936500793651d0 + y))) - (0.0027777777777778d0 * z)) / x
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 98.0) {
tmp = ((0.083333333333333 + (Math.pow(z, 2.0) * (0.0007936500793651 + y))) - (0.0027777777777778 * z)) / x;
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 98.0: tmp = ((0.083333333333333 + (math.pow(z, 2.0) * (0.0007936500793651 + y))) - (0.0027777777777778 * z)) / x else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 98.0) tmp = Float64(Float64(Float64(0.083333333333333 + Float64((z ^ 2.0) * Float64(0.0007936500793651 + y))) - Float64(0.0027777777777778 * z)) / x); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 98.0) tmp = ((0.083333333333333 + ((z ^ 2.0) * (0.0007936500793651 + y))) - (0.0027777777777778 * z)) / x; else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 98.0], N[(N[(N[(0.083333333333333 + N[(N[Power[z, 2.0], $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 98:\\
\;\;\;\;\frac{\left(0.083333333333333 + {z}^{2} \cdot \left(0.0007936500793651 + y\right)\right) - 0.0027777777777778 \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
if x < 98Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f6463.6%
Applied rewrites63.6%
if 98 < x Initial program 94.2%
Taylor expanded in z around 0
Applied rewrites57.5%
(FPCore (x y z)
:precision binary64
(if (<= x 98.0)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))double code(double x, double y, double z) {
double tmp;
if (x <= 98.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 98.0d0) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 98.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 98.0: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 98.0) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 98.0) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 98.0], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 98:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
if x < 98Initial program 94.2%
Taylor expanded in z around 0
Applied rewrites57.5%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites40.6%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.7%
Applied rewrites63.7%
if 98 < x Initial program 94.2%
Taylor expanded in z around 0
Applied rewrites57.5%
(FPCore (x y z)
:precision binary64
(if (<= x 3.8e+19)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(-
(+ (/ 0.083333333333333 x) (* (- (log x) 1.0) x))
-0.91893853320467)))double code(double x, double y, double z) {
double tmp;
if (x <= 3.8e+19) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = ((0.083333333333333 / x) + ((log(x) - 1.0) * x)) - -0.91893853320467;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 3.8d+19) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = ((0.083333333333333d0 / x) + ((log(x) - 1.0d0) * x)) - (-0.91893853320467d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.8e+19) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = ((0.083333333333333 / x) + ((Math.log(x) - 1.0) * x)) - -0.91893853320467;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.8e+19: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = ((0.083333333333333 / x) + ((math.log(x) - 1.0) * x)) - -0.91893853320467 return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.8e+19) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(Float64(0.083333333333333 / x) + Float64(Float64(log(x) - 1.0) * x)) - -0.91893853320467); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.8e+19) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = ((0.083333333333333 / x) + ((log(x) - 1.0) * x)) - -0.91893853320467; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.8e+19], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - -0.91893853320467), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{+19}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{0.083333333333333}{x} + \left(\log x - 1\right) \cdot x\right) - -0.91893853320467\\
\end{array}
if x < 3.8e19Initial program 94.2%
Taylor expanded in z around 0
Applied rewrites57.5%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites40.6%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.7%
Applied rewrites63.7%
if 3.8e19 < x Initial program 94.2%
Taylor expanded in z around 0
Applied rewrites57.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f6456.5%
Applied rewrites56.5%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
add-flipN/A
associate-+r-N/A
lower--.f64N/A
Applied rewrites56.5%
(FPCore (x y z)
:precision binary64
(if (<= x 61000000000.0)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(* (/ (* (- y -0.0007936500793651) z) x) z)))double code(double x, double y, double z) {
double tmp;
if (x <= 61000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (((y - -0.0007936500793651) * z) / x) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 61000000000.0d0) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = (((y - (-0.0007936500793651d0)) * z) / x) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 61000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (((y - -0.0007936500793651) * z) / x) * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 61000000000.0: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = (((y - -0.0007936500793651) * z) / x) * z return tmp
function code(x, y, z) tmp = 0.0 if (x <= 61000000000.0) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(Float64(Float64(y - -0.0007936500793651) * z) / x) * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 61000000000.0) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = (((y - -0.0007936500793651) * z) / x) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 61000000000.0], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 61000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y - -0.0007936500793651\right) \cdot z}{x} \cdot z\\
\end{array}
if x < 6.1e10Initial program 94.2%
Taylor expanded in z around 0
Applied rewrites57.5%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites40.6%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.7%
Applied rewrites63.7%
if 6.1e10 < x Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-lft-outN/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-/.f6443.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-outN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6443.6%
Applied rewrites43.6%
(FPCore (x y z)
:precision binary64
(if (<= x 61000000000.0)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(* (/ 1.0 (/ x (* (- y -0.0007936500793651) z))) z)))double code(double x, double y, double z) {
double tmp;
if (x <= 61000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 61000000000.0d0) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = (1.0d0 / (x / ((y - (-0.0007936500793651d0)) * z))) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 61000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 61000000000.0: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z return tmp
function code(x, y, z) tmp = 0.0 if (x <= 61000000000.0) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(1.0 / Float64(x / Float64(Float64(y - -0.0007936500793651) * z))) * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 61000000000.0) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = (1.0 / (x / ((y - -0.0007936500793651) * z))) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 61000000000.0], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(1.0 / N[(x / N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 61000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\left(y - -0.0007936500793651\right) \cdot z}} \cdot z\\
\end{array}
if x < 6.1e10Initial program 94.2%
Taylor expanded in z around 0
Applied rewrites57.5%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites40.6%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.7%
Applied rewrites63.7%
if 6.1e10 < x Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-lft-outN/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6443.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-outN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6443.6%
Applied rewrites43.6%
(FPCore (x y z) :precision binary64 (* (/ (* (- y -0.0007936500793651) z) x) z))
double code(double x, double y, double z) {
return (((y - -0.0007936500793651) * z) / x) * z;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((y - (-0.0007936500793651d0)) * z) / x) * z
end function
public static double code(double x, double y, double z) {
return (((y - -0.0007936500793651) * z) / x) * z;
}
def code(x, y, z): return (((y - -0.0007936500793651) * z) / x) * z
function code(x, y, z) return Float64(Float64(Float64(Float64(y - -0.0007936500793651) * z) / x) * z) end
function tmp = code(x, y, z) tmp = (((y - -0.0007936500793651) * z) / x) * z; end
code[x_, y_, z_] := N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision]
\frac{\left(y - -0.0007936500793651\right) \cdot z}{x} \cdot z
Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-lft-outN/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-/.f6443.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-outN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6443.6%
Applied rewrites43.6%
(FPCore (x y z) :precision binary64 (* (- y -0.0007936500793651) (* z (/ z x))))
double code(double x, double y, double z) {
return (y - -0.0007936500793651) * (z * (z / x));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y - (-0.0007936500793651d0)) * (z * (z / x))
end function
public static double code(double x, double y, double z) {
return (y - -0.0007936500793651) * (z * (z / x));
}
def code(x, y, z): return (y - -0.0007936500793651) * (z * (z / x))
function code(x, y, z) return Float64(Float64(y - -0.0007936500793651) * Float64(z * Float64(z / x))) end
function tmp = code(x, y, z) tmp = (y - -0.0007936500793651) * (z * (z / x)); end
code[x_, y_, z_] := N[(N[(y - -0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(y - -0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)
Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
unpow2N/A
lift-pow.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f6442.8%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
lift-/.f64N/A
lower-*.f6444.4%
Applied rewrites44.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (* y z) x) z)))
(if (<= (+ y 0.0007936500793651) -2.0)
t_0
(if (<= (+ y 0.0007936500793651) 0.000794)
(* (* z (/ z x)) 0.0007936500793651)
t_0))))double code(double x, double y, double z) {
double t_0 = ((y * z) / x) * z;
double tmp;
if ((y + 0.0007936500793651) <= -2.0) {
tmp = t_0;
} else if ((y + 0.0007936500793651) <= 0.000794) {
tmp = (z * (z / x)) * 0.0007936500793651;
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y * z) / x) * z
if ((y + 0.0007936500793651d0) <= (-2.0d0)) then
tmp = t_0
else if ((y + 0.0007936500793651d0) <= 0.000794d0) then
tmp = (z * (z / x)) * 0.0007936500793651d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y * z) / x) * z;
double tmp;
if ((y + 0.0007936500793651) <= -2.0) {
tmp = t_0;
} else if ((y + 0.0007936500793651) <= 0.000794) {
tmp = (z * (z / x)) * 0.0007936500793651;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y * z) / x) * z tmp = 0 if (y + 0.0007936500793651) <= -2.0: tmp = t_0 elif (y + 0.0007936500793651) <= 0.000794: tmp = (z * (z / x)) * 0.0007936500793651 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y * z) / x) * z) tmp = 0.0 if (Float64(y + 0.0007936500793651) <= -2.0) tmp = t_0; elseif (Float64(y + 0.0007936500793651) <= 0.000794) tmp = Float64(Float64(z * Float64(z / x)) * 0.0007936500793651); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y * z) / x) * z; tmp = 0.0; if ((y + 0.0007936500793651) <= -2.0) tmp = t_0; elseif ((y + 0.0007936500793651) <= 0.000794) tmp = (z * (z / x)) * 0.0007936500793651; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -2.0], t$95$0, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 0.000794], N[(N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision] * 0.0007936500793651), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{y \cdot z}{x} \cdot z\\
\mathbf{if}\;y + 0.0007936500793651 \leq -2:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y + 0.0007936500793651 \leq 0.000794:\\
\;\;\;\;\left(z \cdot \frac{z}{x}\right) \cdot 0.0007936500793651\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < -2 or 7.94e-4 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
if -2 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < 7.94e-4Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6425.8%
Applied rewrites25.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6425.8%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
lift-/.f64N/A
lower-*.f6426.2%
Applied rewrites26.2%
(FPCore (x y z) :precision binary64 (* (* (/ (- y -0.0007936500793651) x) z) z))
double code(double x, double y, double z) {
return (((y - -0.0007936500793651) / x) * z) * z;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((y - (-0.0007936500793651d0)) / x) * z) * z
end function
public static double code(double x, double y, double z) {
return (((y - -0.0007936500793651) / x) * z) * z;
}
def code(x, y, z): return (((y - -0.0007936500793651) / x) * z) * z
function code(x, y, z) return Float64(Float64(Float64(Float64(y - -0.0007936500793651) / x) * z) * z) end
function tmp = code(x, y, z) tmp = (((y - -0.0007936500793651) / x) * z) * z; end
code[x_, y_, z_] := N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]
\left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z
Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6443.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
div-add-revN/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
lower-/.f6443.5%
Applied rewrites43.5%
(FPCore (x y z) :precision binary64 (* (* z (/ z x)) 0.0007936500793651))
double code(double x, double y, double z) {
return (z * (z / x)) * 0.0007936500793651;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (z * (z / x)) * 0.0007936500793651d0
end function
public static double code(double x, double y, double z) {
return (z * (z / x)) * 0.0007936500793651;
}
def code(x, y, z): return (z * (z / x)) * 0.0007936500793651
function code(x, y, z) return Float64(Float64(z * Float64(z / x)) * 0.0007936500793651) end
function tmp = code(x, y, z) tmp = (z * (z / x)) * 0.0007936500793651; end
code[x_, y_, z_] := N[(N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision] * 0.0007936500793651), $MachinePrecision]
\left(z \cdot \frac{z}{x}\right) \cdot 0.0007936500793651
Initial program 94.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
remove-double-negN/A
lower-*.f6494.2%
Applied rewrites94.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6441.7%
Applied rewrites41.7%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6425.8%
Applied rewrites25.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6425.8%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
lift-/.f64N/A
lower-*.f6426.2%
Applied rewrites26.2%
herbie shell --seed 2025258
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))