
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(*
(+
(* z 692910599291889/10000000000000000)
307332350656623/625000000000000)
z)
11167812716741/40000000000000))
(+
(* (+ z 6012459259764103/1000000000000000) z)
104698244219447/31250000000000))))double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
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 + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 692910599291889/10000000000000000), $MachinePrecision] + 307332350656623/625000000000000), $MachinePrecision] * z), $MachinePrecision] + 11167812716741/40000000000000), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6012459259764103/1000000000000000), $MachinePrecision] * z), $MachinePrecision] + 104698244219447/31250000000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z + \frac{11167812716741}{40000000000000}\right)}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(*
(+
(* z 692910599291889/10000000000000000)
307332350656623/625000000000000)
z)
11167812716741/40000000000000))
(+
(* (+ z 6012459259764103/1000000000000000) z)
104698244219447/31250000000000))))double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
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 + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 692910599291889/10000000000000000), $MachinePrecision] + 307332350656623/625000000000000), $MachinePrecision] * z), $MachinePrecision] + 11167812716741/40000000000000), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6012459259764103/1000000000000000), $MachinePrecision] * z), $MachinePrecision] + 104698244219447/31250000000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z + \frac{11167812716741}{40000000000000}\right)}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}}
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(-
(/
(*
y
751220861604756070699018739433/10000000000000000000000000000000)
z)
(/ y -10000000000000000/692910599291889))
x)))
(if (<= z -9999999999999999635896294965248)
t_0
(if (<= z 880000)
(+
x
(/
(*
y
(+
(*
(+
(* z 692910599291889/10000000000000000)
307332350656623/625000000000000)
z)
11167812716741/40000000000000))
(+
(* (+ z 6012459259764103/1000000000000000) z)
104698244219447/31250000000000)))
t_0))))double code(double x, double y, double z) {
double t_0 = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x;
double tmp;
if (z <= -1e+31) {
tmp = t_0;
} else if (z <= 880000.0) {
tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
} 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 * 0.07512208616047561d0) / z) - (y / (-14.431876219268936d0))) + x
if (z <= (-1d+31)) then
tmp = t_0
else if (z <= 880000.0d0) then
tmp = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x;
double tmp;
if (z <= -1e+31) {
tmp = t_0;
} else if (z <= 880000.0) {
tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x tmp = 0 if z <= -1e+31: tmp = t_0 elif z <= 880000.0: tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y * 0.07512208616047561) / z) - Float64(y / -14.431876219268936)) + x) tmp = 0.0 if (z <= -1e+31) tmp = t_0; elseif (z <= 880000.0) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x; tmp = 0.0; if (z <= -1e+31) tmp = t_0; elseif (z <= 880000.0) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y * 751220861604756070699018739433/10000000000000000000000000000000), $MachinePrecision] / z), $MachinePrecision] - N[(y / -10000000000000000/692910599291889), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -9999999999999999635896294965248], t$95$0, If[LessEqual[z, 880000], N[(x + N[(N[(y * N[(N[(N[(N[(z * 692910599291889/10000000000000000), $MachinePrecision] + 307332350656623/625000000000000), $MachinePrecision] * z), $MachinePrecision] + 11167812716741/40000000000000), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6012459259764103/1000000000000000), $MachinePrecision] * z), $MachinePrecision] + 104698244219447/31250000000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left(\frac{y \cdot \frac{751220861604756070699018739433}{10000000000000000000000000000000}}{z} - \frac{y}{\frac{-10000000000000000}{692910599291889}}\right) + x\\
\mathbf{if}\;z \leq -9999999999999999635896294965248:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 880000:\\
\;\;\;\;x + \frac{y \cdot \left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z + \frac{11167812716741}{40000000000000}\right)}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -9.9999999999999996e30 or 8.8e5 < z Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6466.2%
Applied rewrites66.2%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6466.2%
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
mult-flipN/A
distribute-neg-frac2N/A
lower-/.f64N/A
metadata-eval66.4%
Applied rewrites66.4%
if -9.9999999999999996e30 < z < 8.8e5Initial program 68.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(-
(/
(*
y
751220861604756070699018739433/10000000000000000000000000000000)
z)
(/ y -10000000000000000/692910599291889))
x)))
(if (<= z -6530219459687219/1125899906842624)
t_0
(if (<= z 5404319552844595/1125899906842624)
(+
(-
(*
(*
-155900051080628738716045985239/56124018394291031809500087342080
y)
z)
(* -279195317918525/3350343815022304 y))
x)
t_0))))double code(double x, double y, double z) {
double t_0 = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x;
double tmp;
if (z <= -5.8) {
tmp = t_0;
} else if (z <= 4.8) {
tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x;
} 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 * 0.07512208616047561d0) / z) - (y / (-14.431876219268936d0))) + x
if (z <= (-5.8d0)) then
tmp = t_0
else if (z <= 4.8d0) then
tmp = ((((-0.00277777777751721d0) * y) * z) - ((-0.08333333333333323d0) * y)) + x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x;
double tmp;
if (z <= -5.8) {
tmp = t_0;
} else if (z <= 4.8) {
tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x tmp = 0 if z <= -5.8: tmp = t_0 elif z <= 4.8: tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y * 0.07512208616047561) / z) - Float64(y / -14.431876219268936)) + x) tmp = 0.0 if (z <= -5.8) tmp = t_0; elseif (z <= 4.8) tmp = Float64(Float64(Float64(Float64(-0.00277777777751721 * y) * z) - Float64(-0.08333333333333323 * y)) + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x; tmp = 0.0; if (z <= -5.8) tmp = t_0; elseif (z <= 4.8) tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y * 751220861604756070699018739433/10000000000000000000000000000000), $MachinePrecision] / z), $MachinePrecision] - N[(y / -10000000000000000/692910599291889), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -6530219459687219/1125899906842624], t$95$0, If[LessEqual[z, 5404319552844595/1125899906842624], N[(N[(N[(N[(-155900051080628738716045985239/56124018394291031809500087342080 * y), $MachinePrecision] * z), $MachinePrecision] - N[(-279195317918525/3350343815022304 * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left(\frac{y \cdot \frac{751220861604756070699018739433}{10000000000000000000000000000000}}{z} - \frac{y}{\frac{-10000000000000000}{692910599291889}}\right) + x\\
\mathbf{if}\;z \leq \frac{-6530219459687219}{1125899906842624}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{5404319552844595}{1125899906842624}:\\
\;\;\;\;\left(\left(\frac{-155900051080628738716045985239}{56124018394291031809500087342080} \cdot y\right) \cdot z - \frac{-279195317918525}{3350343815022304} \cdot y\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -5.7999999999999998 or 4.7999999999999998 < z Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6466.2%
Applied rewrites66.2%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6466.2%
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
mult-flipN/A
distribute-neg-frac2N/A
lower-/.f64N/A
metadata-eval66.4%
Applied rewrites66.4%
if -5.7999999999999998 < z < 4.7999999999999998Initial program 68.3%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6464.8%
Applied rewrites64.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6464.8%
Applied rewrites64.8%
(FPCore (x y z)
:precision binary64
(if (<= z -2582544170319337/4611686018427387904)
(+ x (/ 1 (/ 10000000000000000/692910599291889 y)))
(if (<= z 5404319552844595/1125899906842624)
(+
(-
(*
(*
-155900051080628738716045985239/56124018394291031809500087342080
y)
z)
(* -279195317918525/3350343815022304 y))
x)
(+
(*
y
(-
(/
751220861604756070699018739433/10000000000000000000000000000000
z)
-692910599291889/10000000000000000))
x))))double code(double x, double y, double z) {
double tmp;
if (z <= -0.00056) {
tmp = x + (1.0 / (14.431876219268936 / y));
} else if (z <= 4.8) {
tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x;
} else {
tmp = (y * ((0.07512208616047561 / z) - -0.0692910599291889)) + 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 (z <= (-0.00056d0)) then
tmp = x + (1.0d0 / (14.431876219268936d0 / y))
else if (z <= 4.8d0) then
tmp = ((((-0.00277777777751721d0) * y) * z) - ((-0.08333333333333323d0) * y)) + x
else
tmp = (y * ((0.07512208616047561d0 / z) - (-0.0692910599291889d0))) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.00056) {
tmp = x + (1.0 / (14.431876219268936 / y));
} else if (z <= 4.8) {
tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x;
} else {
tmp = (y * ((0.07512208616047561 / z) - -0.0692910599291889)) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.00056: tmp = x + (1.0 / (14.431876219268936 / y)) elif z <= 4.8: tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x else: tmp = (y * ((0.07512208616047561 / z) - -0.0692910599291889)) + x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.00056) tmp = Float64(x + Float64(1.0 / Float64(14.431876219268936 / y))); elseif (z <= 4.8) tmp = Float64(Float64(Float64(Float64(-0.00277777777751721 * y) * z) - Float64(-0.08333333333333323 * y)) + x); else tmp = Float64(Float64(y * Float64(Float64(0.07512208616047561 / z) - -0.0692910599291889)) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.00056) tmp = x + (1.0 / (14.431876219268936 / y)); elseif (z <= 4.8) tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x; else tmp = (y * ((0.07512208616047561 / z) - -0.0692910599291889)) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2582544170319337/4611686018427387904], N[(x + N[(1 / N[(10000000000000000/692910599291889 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5404319552844595/1125899906842624], N[(N[(N[(N[(-155900051080628738716045985239/56124018394291031809500087342080 * y), $MachinePrecision] * z), $MachinePrecision] - N[(-279195317918525/3350343815022304 * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(y * N[(N[(751220861604756070699018739433/10000000000000000000000000000000 / z), $MachinePrecision] - -692910599291889/10000000000000000), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-2582544170319337}{4611686018427387904}:\\
\;\;\;\;x + \frac{1}{\frac{\frac{10000000000000000}{692910599291889}}{y}}\\
\mathbf{elif}\;z \leq \frac{5404319552844595}{1125899906842624}:\\
\;\;\;\;\left(\left(\frac{-155900051080628738716045985239}{56124018394291031809500087342080} \cdot y\right) \cdot z - \frac{-279195317918525}{3350343815022304} \cdot y\right) + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{\frac{751220861604756070699018739433}{10000000000000000000000000000000}}{z} - \frac{-692910599291889}{10000000000000000}\right) + x\\
\end{array}
if z < -5.5999999999999995e-4Initial program 68.3%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6468.3%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-eval68.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.3%
Applied rewrites68.3%
Taylor expanded in z around inf
lower-/.f6480.1%
Applied rewrites80.1%
if -5.5999999999999995e-4 < z < 4.7999999999999998Initial program 68.3%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6464.8%
Applied rewrites64.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6464.8%
Applied rewrites64.8%
if 4.7999999999999998 < z Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6466.2%
Applied rewrites66.2%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6466.2%
Applied rewrites66.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f6466.2%
Applied rewrites66.2%
(FPCore (x y z)
:precision binary64
(if (<= z -2582544170319337/4611686018427387904)
(+ x (* 692910599291889/10000000000000000 y))
(if (<= z 5404319552844595/1125899906842624)
(+
(-
(*
(*
-155900051080628738716045985239/56124018394291031809500087342080
y)
z)
(* -279195317918525/3350343815022304 y))
x)
(+
(*
y
(-
(/
751220861604756070699018739433/10000000000000000000000000000000
z)
-692910599291889/10000000000000000))
x))))double code(double x, double y, double z) {
double tmp;
if (z <= -0.00056) {
tmp = x + (0.0692910599291889 * y);
} else if (z <= 4.8) {
tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x;
} else {
tmp = (y * ((0.07512208616047561 / z) - -0.0692910599291889)) + 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 (z <= (-0.00056d0)) then
tmp = x + (0.0692910599291889d0 * y)
else if (z <= 4.8d0) then
tmp = ((((-0.00277777777751721d0) * y) * z) - ((-0.08333333333333323d0) * y)) + x
else
tmp = (y * ((0.07512208616047561d0 / z) - (-0.0692910599291889d0))) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.00056) {
tmp = x + (0.0692910599291889 * y);
} else if (z <= 4.8) {
tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x;
} else {
tmp = (y * ((0.07512208616047561 / z) - -0.0692910599291889)) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.00056: tmp = x + (0.0692910599291889 * y) elif z <= 4.8: tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x else: tmp = (y * ((0.07512208616047561 / z) - -0.0692910599291889)) + x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.00056) tmp = Float64(x + Float64(0.0692910599291889 * y)); elseif (z <= 4.8) tmp = Float64(Float64(Float64(Float64(-0.00277777777751721 * y) * z) - Float64(-0.08333333333333323 * y)) + x); else tmp = Float64(Float64(y * Float64(Float64(0.07512208616047561 / z) - -0.0692910599291889)) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.00056) tmp = x + (0.0692910599291889 * y); elseif (z <= 4.8) tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x; else tmp = (y * ((0.07512208616047561 / z) - -0.0692910599291889)) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2582544170319337/4611686018427387904], N[(x + N[(692910599291889/10000000000000000 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5404319552844595/1125899906842624], N[(N[(N[(N[(-155900051080628738716045985239/56124018394291031809500087342080 * y), $MachinePrecision] * z), $MachinePrecision] - N[(-279195317918525/3350343815022304 * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(y * N[(N[(751220861604756070699018739433/10000000000000000000000000000000 / z), $MachinePrecision] - -692910599291889/10000000000000000), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-2582544170319337}{4611686018427387904}:\\
\;\;\;\;x + \frac{692910599291889}{10000000000000000} \cdot y\\
\mathbf{elif}\;z \leq \frac{5404319552844595}{1125899906842624}:\\
\;\;\;\;\left(\left(\frac{-155900051080628738716045985239}{56124018394291031809500087342080} \cdot y\right) \cdot z - \frac{-279195317918525}{3350343815022304} \cdot y\right) + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{\frac{751220861604756070699018739433}{10000000000000000000000000000000}}{z} - \frac{-692910599291889}{10000000000000000}\right) + x\\
\end{array}
if z < -5.5999999999999995e-4Initial program 68.3%
Taylor expanded in z around inf
lower-*.f6480.1%
Applied rewrites80.1%
if -5.5999999999999995e-4 < z < 4.7999999999999998Initial program 68.3%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6464.8%
Applied rewrites64.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6464.8%
Applied rewrites64.8%
if 4.7999999999999998 < z Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6466.2%
Applied rewrites66.2%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6466.2%
Applied rewrites66.2%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f6466.2%
Applied rewrites66.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* 692910599291889/10000000000000000 y))))
(if (<= z -2582544170319337/4611686018427387904)
t_0
(if (<= z 7378697629483821/73786976294838206464)
(+
(-
(*
(*
-155900051080628738716045985239/56124018394291031809500087342080
y)
z)
(* -279195317918525/3350343815022304 y))
x)
t_0))))double code(double x, double y, double z) {
double t_0 = x + (0.0692910599291889 * y);
double tmp;
if (z <= -0.00056) {
tmp = t_0;
} else if (z <= 0.0001) {
tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x;
} 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 = x + (0.0692910599291889d0 * y)
if (z <= (-0.00056d0)) then
tmp = t_0
else if (z <= 0.0001d0) then
tmp = ((((-0.00277777777751721d0) * y) * z) - ((-0.08333333333333323d0) * y)) + x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (0.0692910599291889 * y);
double tmp;
if (z <= -0.00056) {
tmp = t_0;
} else if (z <= 0.0001) {
tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (0.0692910599291889 * y) tmp = 0 if z <= -0.00056: tmp = t_0 elif z <= 0.0001: tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(0.0692910599291889 * y)) tmp = 0.0 if (z <= -0.00056) tmp = t_0; elseif (z <= 0.0001) tmp = Float64(Float64(Float64(Float64(-0.00277777777751721 * y) * z) - Float64(-0.08333333333333323 * y)) + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (0.0692910599291889 * y); tmp = 0.0; if (z <= -0.00056) tmp = t_0; elseif (z <= 0.0001) tmp = (((-0.00277777777751721 * y) * z) - (-0.08333333333333323 * y)) + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(692910599291889/10000000000000000 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2582544170319337/4611686018427387904], t$95$0, If[LessEqual[z, 7378697629483821/73786976294838206464], N[(N[(N[(N[(-155900051080628738716045985239/56124018394291031809500087342080 * y), $MachinePrecision] * z), $MachinePrecision] - N[(-279195317918525/3350343815022304 * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + \frac{692910599291889}{10000000000000000} \cdot y\\
\mathbf{if}\;z \leq \frac{-2582544170319337}{4611686018427387904}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{7378697629483821}{73786976294838206464}:\\
\;\;\;\;\left(\left(\frac{-155900051080628738716045985239}{56124018394291031809500087342080} \cdot y\right) \cdot z - \frac{-279195317918525}{3350343815022304} \cdot y\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -5.5999999999999995e-4 or 1e-4 < z Initial program 68.3%
Taylor expanded in z around inf
lower-*.f6480.1%
Applied rewrites80.1%
if -5.5999999999999995e-4 < z < 1e-4Initial program 68.3%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6464.8%
Applied rewrites64.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6464.8%
Applied rewrites64.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* 692910599291889/10000000000000000 y))))
(if (<= z -2582544170319337/4611686018427387904)
t_0
(if (<= z 7378697629483821/73786976294838206464)
(+
x
(*
y
(+
279195317918525/3350343815022304
(*
-155900051080628738716045985239/56124018394291031809500087342080
z))))
t_0))))double code(double x, double y, double z) {
double t_0 = x + (0.0692910599291889 * y);
double tmp;
if (z <= -0.00056) {
tmp = t_0;
} else if (z <= 0.0001) {
tmp = x + (y * (0.08333333333333323 + (-0.00277777777751721 * z)));
} 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 = x + (0.0692910599291889d0 * y)
if (z <= (-0.00056d0)) then
tmp = t_0
else if (z <= 0.0001d0) then
tmp = x + (y * (0.08333333333333323d0 + ((-0.00277777777751721d0) * z)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (0.0692910599291889 * y);
double tmp;
if (z <= -0.00056) {
tmp = t_0;
} else if (z <= 0.0001) {
tmp = x + (y * (0.08333333333333323 + (-0.00277777777751721 * z)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (0.0692910599291889 * y) tmp = 0 if z <= -0.00056: tmp = t_0 elif z <= 0.0001: tmp = x + (y * (0.08333333333333323 + (-0.00277777777751721 * z))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(0.0692910599291889 * y)) tmp = 0.0 if (z <= -0.00056) tmp = t_0; elseif (z <= 0.0001) tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(-0.00277777777751721 * z)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (0.0692910599291889 * y); tmp = 0.0; if (z <= -0.00056) tmp = t_0; elseif (z <= 0.0001) tmp = x + (y * (0.08333333333333323 + (-0.00277777777751721 * z))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(692910599291889/10000000000000000 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2582544170319337/4611686018427387904], t$95$0, If[LessEqual[z, 7378697629483821/73786976294838206464], N[(x + N[(y * N[(279195317918525/3350343815022304 + N[(-155900051080628738716045985239/56124018394291031809500087342080 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + \frac{692910599291889}{10000000000000000} \cdot y\\
\mathbf{if}\;z \leq \frac{-2582544170319337}{4611686018427387904}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{7378697629483821}{73786976294838206464}:\\
\;\;\;\;x + y \cdot \left(\frac{279195317918525}{3350343815022304} + \frac{-155900051080628738716045985239}{56124018394291031809500087342080} \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -5.5999999999999995e-4 or 1e-4 < z Initial program 68.3%
Taylor expanded in z around inf
lower-*.f6480.1%
Applied rewrites80.1%
if -5.5999999999999995e-4 < z < 1e-4Initial program 68.3%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6464.8%
Applied rewrites64.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6464.8%
Applied rewrites64.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* 692910599291889/10000000000000000 y))))
(if (<= z -3150000000)
t_0
(if (<= z 5200000)
(+ x (* 279195317918525/3350343815022304 y))
t_0))))double code(double x, double y, double z) {
double t_0 = x + (0.0692910599291889 * y);
double tmp;
if (z <= -3150000000.0) {
tmp = t_0;
} else if (z <= 5200000.0) {
tmp = x + (0.08333333333333323 * y);
} 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 = x + (0.0692910599291889d0 * y)
if (z <= (-3150000000.0d0)) then
tmp = t_0
else if (z <= 5200000.0d0) then
tmp = x + (0.08333333333333323d0 * y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (0.0692910599291889 * y);
double tmp;
if (z <= -3150000000.0) {
tmp = t_0;
} else if (z <= 5200000.0) {
tmp = x + (0.08333333333333323 * y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (0.0692910599291889 * y) tmp = 0 if z <= -3150000000.0: tmp = t_0 elif z <= 5200000.0: tmp = x + (0.08333333333333323 * y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(0.0692910599291889 * y)) tmp = 0.0 if (z <= -3150000000.0) tmp = t_0; elseif (z <= 5200000.0) tmp = Float64(x + Float64(0.08333333333333323 * y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (0.0692910599291889 * y); tmp = 0.0; if (z <= -3150000000.0) tmp = t_0; elseif (z <= 5200000.0) tmp = x + (0.08333333333333323 * y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(692910599291889/10000000000000000 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3150000000], t$95$0, If[LessEqual[z, 5200000], N[(x + N[(279195317918525/3350343815022304 * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + \frac{692910599291889}{10000000000000000} \cdot y\\
\mathbf{if}\;z \leq -3150000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5200000:\\
\;\;\;\;x + \frac{279195317918525}{3350343815022304} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -3.15e9 or 5.2e6 < z Initial program 68.3%
Taylor expanded in z around inf
lower-*.f6480.1%
Applied rewrites80.1%
if -3.15e9 < z < 5.2e6Initial program 68.3%
Taylor expanded in z around 0
lower-*.f6479.1%
Applied rewrites79.1%
(FPCore (x y z)
:precision binary64
(if (<=
(+
x
(/
(*
y
(+
(*
(+
(* z 692910599291889/10000000000000000)
307332350656623/625000000000000)
z)
11167812716741/40000000000000))
(+
(* (+ z 6012459259764103/1000000000000000) z)
104698244219447/31250000000000)))
39999999999999997570142100221458487440161148880469299812763086285292818252052935611373237029762030993747424472224648690314868774970544122120943195363467531099949205766728044164270841012649763623374879210194206396306558730203287330638196449078431799221384139674650289625630417523383839448299617392552574976)
(-
x
(*
(-
-11167812716741/40000000000000
(*
(-
(* 692910599291889/10000000000000000 z)
-307332350656623/625000000000000)
z))
(/
y
(-
(* (- z -6012459259764103/1000000000000000) z)
-104698244219447/31250000000000))))
(+
(-
(/
(*
y
751220861604756070699018739433/10000000000000000000000000000000)
z)
(/ y -10000000000000000/692910599291889))
x)))double code(double x, double y, double z) {
double tmp;
if ((x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))) <= 4e+304) {
tmp = x - ((-0.279195317918525 - (((0.0692910599291889 * z) - -0.4917317610505968) * z)) * (y / (((z - -6.012459259764103) * z) - -3.350343815022304)));
} else {
tmp = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + 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 + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))) <= 4d+304) then
tmp = x - (((-0.279195317918525d0) - (((0.0692910599291889d0 * z) - (-0.4917317610505968d0)) * z)) * (y / (((z - (-6.012459259764103d0)) * z) - (-3.350343815022304d0))))
else
tmp = (((y * 0.07512208616047561d0) / z) - (y / (-14.431876219268936d0))) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))) <= 4e+304) {
tmp = x - ((-0.279195317918525 - (((0.0692910599291889 * z) - -0.4917317610505968) * z)) * (y / (((z - -6.012459259764103) * z) - -3.350343815022304)));
} else {
tmp = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))) <= 4e+304: tmp = x - ((-0.279195317918525 - (((0.0692910599291889 * z) - -0.4917317610505968) * z)) * (y / (((z - -6.012459259764103) * z) - -3.350343815022304))) else: tmp = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x return tmp
function code(x, y, z) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) <= 4e+304) tmp = Float64(x - Float64(Float64(-0.279195317918525 - Float64(Float64(Float64(0.0692910599291889 * z) - -0.4917317610505968) * z)) * Float64(y / Float64(Float64(Float64(z - -6.012459259764103) * z) - -3.350343815022304)))); else tmp = Float64(Float64(Float64(Float64(y * 0.07512208616047561) / z) - Float64(y / -14.431876219268936)) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))) <= 4e+304) tmp = x - ((-0.279195317918525 - (((0.0692910599291889 * z) - -0.4917317610505968) * z)) * (y / (((z - -6.012459259764103) * z) - -3.350343815022304))); else tmp = (((y * 0.07512208616047561) / z) - (y / -14.431876219268936)) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(z * 692910599291889/10000000000000000), $MachinePrecision] + 307332350656623/625000000000000), $MachinePrecision] * z), $MachinePrecision] + 11167812716741/40000000000000), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6012459259764103/1000000000000000), $MachinePrecision] * z), $MachinePrecision] + 104698244219447/31250000000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 39999999999999997570142100221458487440161148880469299812763086285292818252052935611373237029762030993747424472224648690314868774970544122120943195363467531099949205766728044164270841012649763623374879210194206396306558730203287330638196449078431799221384139674650289625630417523383839448299617392552574976], N[(x - N[(N[(-11167812716741/40000000000000 - N[(N[(N[(692910599291889/10000000000000000 * z), $MachinePrecision] - -307332350656623/625000000000000), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(N[(z - -6012459259764103/1000000000000000), $MachinePrecision] * z), $MachinePrecision] - -104698244219447/31250000000000), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * 751220861604756070699018739433/10000000000000000000000000000000), $MachinePrecision] / z), $MachinePrecision] - N[(y / -10000000000000000/692910599291889), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z + \frac{11167812716741}{40000000000000}\right)}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \leq 39999999999999997570142100221458487440161148880469299812763086285292818252052935611373237029762030993747424472224648690314868774970544122120943195363467531099949205766728044164270841012649763623374879210194206396306558730203287330638196449078431799221384139674650289625630417523383839448299617392552574976:\\
\;\;\;\;x - \left(\frac{-11167812716741}{40000000000000} - \left(\frac{692910599291889}{10000000000000000} \cdot z - \frac{-307332350656623}{625000000000000}\right) \cdot z\right) \cdot \frac{y}{\left(z - \frac{-6012459259764103}{1000000000000000}\right) \cdot z - \frac{-104698244219447}{31250000000000}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y \cdot \frac{751220861604756070699018739433}{10000000000000000000000000000000}}{z} - \frac{y}{\frac{-10000000000000000}{692910599291889}}\right) + x\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64)))) < 3.9999999999999998e304Initial program 68.3%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites73.4%
if 3.9999999999999998e304 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64)))) Initial program 68.3%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6466.2%
Applied rewrites66.2%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6466.2%
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
mult-flipN/A
distribute-neg-frac2N/A
lower-/.f64N/A
metadata-eval66.4%
Applied rewrites66.4%
(FPCore (x y z) :precision binary64 (+ x (* 692910599291889/10000000000000000 y)))
double code(double x, double y, double z) {
return x + (0.0692910599291889 * y);
}
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.0692910599291889d0 * y)
end function
public static double code(double x, double y, double z) {
return x + (0.0692910599291889 * y);
}
def code(x, y, z): return x + (0.0692910599291889 * y)
function code(x, y, z) return Float64(x + Float64(0.0692910599291889 * y)) end
function tmp = code(x, y, z) tmp = x + (0.0692910599291889 * y); end
code[x_, y_, z_] := N[(x + N[(692910599291889/10000000000000000 * y), $MachinePrecision]), $MachinePrecision]
x + \frac{692910599291889}{10000000000000000} \cdot y
Initial program 68.3%
Taylor expanded in z around inf
lower-*.f6480.1%
Applied rewrites80.1%
(FPCore (x y z) :precision binary64 (* 1 x))
double code(double x, double y, double z) {
return 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z) {
return 1.0 * x;
}
def code(x, y, z): return 1.0 * x
function code(x, y, z) return Float64(1.0 * x) end
function tmp = code(x, y, z) tmp = 1.0 * x; end
code[x_, y_, z_] := N[(1 * x), $MachinePrecision]
1 \cdot x
Initial program 68.3%
Taylor expanded in z around inf
lower-*.f6480.1%
Applied rewrites80.1%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
lower-unsound-+.f64N/A
lower-unsound-/.f6473.7%
Applied rewrites73.7%
Taylor expanded in x around inf
Applied rewrites51.2%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
:precision binary64
(+ x (/ (* y (+ (* (+ (* z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+ (* (+ z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000))))