
(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]
\begin{array}{l}
\\
\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}
\end{array}
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]
\begin{array}{l}
\\
\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}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 460000000000.0)
(-
(/
(fma
(- (* (+ y 0.0007936500793651) z) 0.0027777777777778)
z
0.083333333333333)
x)
(fma (- 0.5 x) (log x) (- x 0.91893853320467)))
(fma
(- (* (+ y 0.0007936500793651) (/ z x)) (/ 0.0027777777777778 x))
z
(- (/ 0.083333333333333 x) (* x (+ 1.0 (log (/ 1.0 x))))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 460000000000.0) {
tmp = (fma((((y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x) - fma((0.5 - x), log(x), (x - 0.91893853320467));
} else {
tmp = fma((((y + 0.0007936500793651) * (z / x)) - (0.0027777777777778 / x)), z, ((0.083333333333333 / x) - (x * (1.0 + log((1.0 / x))))));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 460000000000.0) tmp = Float64(Float64(fma(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x) - fma(Float64(0.5 - x), log(x), Float64(x - 0.91893853320467))); else tmp = fma(Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z / x)) - Float64(0.0027777777777778 / x)), z, Float64(Float64(0.083333333333333 / x) - Float64(x * Float64(1.0 + log(Float64(1.0 / x)))))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 460000000000.0], N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(N[(0.5 - x), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision] * z + N[(N[(0.083333333333333 / x), $MachinePrecision] - N[(x * N[(1.0 + N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 460000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, z, 0.083333333333333\right)}{x} - \mathsf{fma}\left(0.5 - x, \log x, x - 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x} - \frac{0.0027777777777778}{x}, z, \frac{0.083333333333333}{x} - x \cdot \left(1 + \log \left(\frac{1}{x}\right)\right)\right)\\
\end{array}
\end{array}
if x < 4.6e11Initial program 93.7%
Applied rewrites93.7%
if 4.6e11 < x Initial program 93.7%
Applied rewrites97.7%
Applied rewrites98.6%
Taylor expanded in x around inf
Applied rewrites97.6%
(FPCore (x y z)
:precision binary64
(if (<= x 1.5e+17)
(-
(/
(fma
(- (* (+ y 0.0007936500793651) z) 0.0027777777777778)
z
0.083333333333333)
x)
(fma (- 0.5 x) (log x) (- x 0.91893853320467)))
(fma
(- (* (+ y 0.0007936500793651) (/ z x)) (/ 0.0027777777777778 x))
z
(- (/ 0.083333333333333 x) (- x (* (log x) x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.5e+17) {
tmp = (fma((((y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x) - fma((0.5 - x), log(x), (x - 0.91893853320467));
} else {
tmp = fma((((y + 0.0007936500793651) * (z / x)) - (0.0027777777777778 / x)), z, ((0.083333333333333 / x) - (x - (log(x) * x))));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.5e+17) tmp = Float64(Float64(fma(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x) - fma(Float64(0.5 - x), log(x), Float64(x - 0.91893853320467))); else tmp = fma(Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z / x)) - Float64(0.0027777777777778 / x)), z, Float64(Float64(0.083333333333333 / x) - Float64(x - Float64(log(x) * x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.5e+17], N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(N[(0.5 - x), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision] * z + N[(N[(0.083333333333333 / x), $MachinePrecision] - N[(x - N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.5 \cdot 10^{+17}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, z, 0.083333333333333\right)}{x} - \mathsf{fma}\left(0.5 - x, \log x, x - 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x} - \frac{0.0027777777777778}{x}, z, \frac{0.083333333333333}{x} - \left(x - \log x \cdot x\right)\right)\\
\end{array}
\end{array}
if x < 1.5e17Initial program 93.7%
Applied rewrites93.7%
if 1.5e17 < x Initial program 93.7%
Applied rewrites97.7%
Applied rewrites98.6%
Taylor expanded in x around inf
Applied rewrites97.6%
Applied rewrites97.5%
(FPCore (x y z) :precision binary64 (fma (- (* (+ y 0.0007936500793651) (/ z x)) (/ 0.0027777777777778 x)) z (- (/ 0.083333333333333 x) (fma (- 0.5 x) (log x) (- x 0.91893853320467)))))
double code(double x, double y, double z) {
return fma((((y + 0.0007936500793651) * (z / x)) - (0.0027777777777778 / x)), z, ((0.083333333333333 / x) - fma((0.5 - x), log(x), (x - 0.91893853320467))));
}
function code(x, y, z) return fma(Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z / x)) - Float64(0.0027777777777778 / x)), z, Float64(Float64(0.083333333333333 / x) - fma(Float64(0.5 - x), log(x), Float64(x - 0.91893853320467)))) end
code[x_, y_, z_] := N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision] * z + N[(N[(0.083333333333333 / x), $MachinePrecision] - N[(N[(0.5 - x), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x} - \frac{0.0027777777777778}{x}, z, \frac{0.083333333333333}{x} - \mathsf{fma}\left(0.5 - x, \log x, x - 0.91893853320467\right)\right)
\end{array}
Initial program 93.7%
Applied rewrites97.7%
Applied rewrites98.6%
(FPCore (x y z)
:precision binary64
(if (<= x 2.5e+236)
(-
(/
(fma
(- (* (+ y 0.0007936500793651) z) 0.0027777777777778)
z
0.083333333333333)
x)
(fma (- 0.5 x) (log x) (- x 0.91893853320467)))
(- (+ 0.91893853320467 (fma (log x) (- x 0.5) (/ 0.083333333333333 x))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.5e+236) {
tmp = (fma((((y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x) - fma((0.5 - x), log(x), (x - 0.91893853320467));
} else {
tmp = (0.91893853320467 + fma(log(x), (x - 0.5), (0.083333333333333 / x))) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.5e+236) tmp = Float64(Float64(fma(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x) - fma(Float64(0.5 - x), log(x), Float64(x - 0.91893853320467))); else tmp = Float64(Float64(0.91893853320467 + fma(log(x), Float64(x - 0.5), Float64(0.083333333333333 / x))) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.5e+236], N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(N[(0.5 - x), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5 \cdot 10^{+236}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, z, 0.083333333333333\right)}{x} - \mathsf{fma}\left(0.5 - x, \log x, x - 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \mathsf{fma}\left(\log x, x - 0.5, \frac{0.083333333333333}{x}\right)\right) - x\\
\end{array}
\end{array}
if x < 2.49999999999999985e236Initial program 93.7%
Applied rewrites93.7%
if 2.49999999999999985e236 < x Initial program 93.7%
Taylor expanded in z around 0
Applied rewrites94.7%
Taylor expanded in z around 0
Applied rewrites56.9%
Applied rewrites56.9%
(FPCore (x y z)
:precision binary64
(if (<= x 2.5e+236)
(-
0.91893853320467
(-
(fma (- 0.5 x) (log x) x)
(/
(fma
(- (* (+ y 0.0007936500793651) z) 0.0027777777777778)
z
0.083333333333333)
x)))
(- (+ 0.91893853320467 (fma (log x) (- x 0.5) (/ 0.083333333333333 x))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.5e+236) {
tmp = 0.91893853320467 - (fma((0.5 - x), log(x), x) - (fma((((y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x));
} else {
tmp = (0.91893853320467 + fma(log(x), (x - 0.5), (0.083333333333333 / x))) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.5e+236) tmp = Float64(0.91893853320467 - Float64(fma(Float64(0.5 - x), log(x), x) - Float64(fma(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x))); else tmp = Float64(Float64(0.91893853320467 + fma(log(x), Float64(x - 0.5), Float64(0.083333333333333 / x))) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.5e+236], N[(0.91893853320467 - N[(N[(N[(0.5 - x), $MachinePrecision] * N[Log[x], $MachinePrecision] + x), $MachinePrecision] - N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5 \cdot 10^{+236}:\\
\;\;\;\;0.91893853320467 - \left(\mathsf{fma}\left(0.5 - x, \log x, x\right) - \frac{\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, z, 0.083333333333333\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \mathsf{fma}\left(\log x, x - 0.5, \frac{0.083333333333333}{x}\right)\right) - x\\
\end{array}
\end{array}
if x < 2.49999999999999985e236Initial program 93.7%
Applied rewrites93.7%
if 2.49999999999999985e236 < x Initial program 93.7%
Taylor expanded in z around 0
Applied rewrites94.7%
Taylor expanded in z around 0
Applied rewrites56.9%
Applied rewrites56.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fma (- 0.5 x) (log x) (- x 0.91893853320467)))
(t_1 (- (/ (fma (* y z) z 0.083333333333333) x) t_0)))
(if (<= y -0.0008)
t_1
(if (<= y 1.75e+131)
(-
(/
(fma
(- (* 0.0007936500793651 z) 0.0027777777777778)
z
0.083333333333333)
x)
t_0)
t_1))))
double code(double x, double y, double z) {
double t_0 = fma((0.5 - x), log(x), (x - 0.91893853320467));
double t_1 = (fma((y * z), z, 0.083333333333333) / x) - t_0;
double tmp;
if (y <= -0.0008) {
tmp = t_1;
} else if (y <= 1.75e+131) {
tmp = (fma(((0.0007936500793651 * z) - 0.0027777777777778), z, 0.083333333333333) / x) - t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z) t_0 = fma(Float64(0.5 - x), log(x), Float64(x - 0.91893853320467)) t_1 = Float64(Float64(fma(Float64(y * z), z, 0.083333333333333) / x) - t_0) tmp = 0.0 if (y <= -0.0008) tmp = t_1; elseif (y <= 1.75e+131) tmp = Float64(Float64(fma(Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778), z, 0.083333333333333) / x) - t_0); else tmp = t_1; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.5 - x), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[y, -0.0008], t$95$1, If[LessEqual[y, 1.75e+131], N[(N[(N[(N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.5 - x, \log x, x - 0.91893853320467\right)\\
t_1 := \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} - t\_0\\
\mathbf{if}\;y \leq -0.0008:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+131}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.0007936500793651 \cdot z - 0.0027777777777778, z, 0.083333333333333\right)}{x} - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.00000000000000038e-4 or 1.7499999999999999e131 < y Initial program 93.7%
Applied rewrites93.7%
Taylor expanded in y around inf
Applied rewrites81.7%
if -8.00000000000000038e-4 < y < 1.7499999999999999e131Initial program 93.7%
Applied rewrites93.7%
Taylor expanded in y around 0
Applied rewrites78.1%
(FPCore (x y z)
:precision binary64
(if (<= x 2.5e-8)
(-
(/
(fma
(- (* (+ y 0.0007936500793651) z) 0.0027777777777778)
z
0.083333333333333)
x)
(- (* 0.5 (log x)) 0.91893853320467))
(if (<= x 2.1e+236)
(-
(/ (fma (* y z) z 0.083333333333333) x)
(fma (- 0.5 x) (log x) (- x 0.91893853320467)))
(-
(+ 0.91893853320467 (fma (log x) (- x 0.5) (/ 0.083333333333333 x)))
x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.5e-8) {
tmp = (fma((((y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x) - ((0.5 * log(x)) - 0.91893853320467);
} else if (x <= 2.1e+236) {
tmp = (fma((y * z), z, 0.083333333333333) / x) - fma((0.5 - x), log(x), (x - 0.91893853320467));
} else {
tmp = (0.91893853320467 + fma(log(x), (x - 0.5), (0.083333333333333 / x))) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.5e-8) tmp = Float64(Float64(fma(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x) - Float64(Float64(0.5 * log(x)) - 0.91893853320467)); elseif (x <= 2.1e+236) tmp = Float64(Float64(fma(Float64(y * z), z, 0.083333333333333) / x) - fma(Float64(0.5 - x), log(x), Float64(x - 0.91893853320467))); else tmp = Float64(Float64(0.91893853320467 + fma(log(x), Float64(x - 0.5), Float64(0.083333333333333 / x))) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.5e-8], N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(N[(0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision] - 0.91893853320467), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+236], N[(N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(N[(0.5 - x), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5 \cdot 10^{-8}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, z, 0.083333333333333\right)}{x} - \left(0.5 \cdot \log x - 0.91893853320467\right)\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+236}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} - \mathsf{fma}\left(0.5 - x, \log x, x - 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \mathsf{fma}\left(\log x, x - 0.5, \frac{0.083333333333333}{x}\right)\right) - x\\
\end{array}
\end{array}
if x < 2.4999999999999999e-8Initial program 93.7%
Applied rewrites93.7%
Taylor expanded in x around 0
Applied rewrites63.6%
if 2.4999999999999999e-8 < x < 2.10000000000000006e236Initial program 93.7%
Applied rewrites93.7%
Taylor expanded in y around inf
Applied rewrites81.7%
if 2.10000000000000006e236 < x Initial program 93.7%
Taylor expanded in z around 0
Applied rewrites94.7%
Taylor expanded in z around 0
Applied rewrites56.9%
Applied rewrites56.9%
(FPCore (x y z)
:precision binary64
(if (<= x 4.3e-11)
(/
(fma
(- (* (+ y 0.0007936500793651) z) 0.0027777777777778)
z
0.083333333333333)
x)
(if (<= x 2.1e+236)
(-
(/ (fma (* y z) z 0.083333333333333) x)
(fma (- 0.5 x) (log x) (- x 0.91893853320467)))
(-
(+ 0.91893853320467 (fma (log x) (- x 0.5) (/ 0.083333333333333 x)))
x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.3e-11) {
tmp = fma((((y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x;
} else if (x <= 2.1e+236) {
tmp = (fma((y * z), z, 0.083333333333333) / x) - fma((0.5 - x), log(x), (x - 0.91893853320467));
} else {
tmp = (0.91893853320467 + fma(log(x), (x - 0.5), (0.083333333333333 / x))) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 4.3e-11) tmp = Float64(fma(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x); elseif (x <= 2.1e+236) tmp = Float64(Float64(fma(Float64(y * z), z, 0.083333333333333) / x) - fma(Float64(0.5 - x), log(x), Float64(x - 0.91893853320467))); else tmp = Float64(Float64(0.91893853320467 + fma(log(x), Float64(x - 0.5), Float64(0.083333333333333 / x))) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 4.3e-11], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.1e+236], N[(N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(N[(0.5 - x), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.3 \cdot 10^{-11}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+236}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} - \mathsf{fma}\left(0.5 - x, \log x, x - 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \mathsf{fma}\left(\log x, x - 0.5, \frac{0.083333333333333}{x}\right)\right) - x\\
\end{array}
\end{array}
if x < 4.30000000000000001e-11Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Applied rewrites63.9%
if 4.30000000000000001e-11 < x < 2.10000000000000006e236Initial program 93.7%
Applied rewrites93.7%
Taylor expanded in y around inf
Applied rewrites81.7%
if 2.10000000000000006e236 < x Initial program 93.7%
Taylor expanded in z around 0
Applied rewrites94.7%
Taylor expanded in z around 0
Applied rewrites56.9%
Applied rewrites56.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -2e+205)
(* (* (+ y 0.0007936500793651) (/ z x)) z)
(if (<= t_0 1e+31)
(-
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(fma (- 0.5 x) (log x) (- x 0.91893853320467)))
(* (* (/ (- (- 0.0007936500793651) y) x) z) (- z))))))
double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -2e+205) {
tmp = ((y + 0.0007936500793651) * (z / x)) * z;
} else if (t_0 <= 1e+31) {
tmp = (fma(-0.0027777777777778, z, 0.083333333333333) / x) - fma((0.5 - x), log(x), (x - 0.91893853320467));
} else {
tmp = (((-0.0007936500793651 - y) / x) * z) * -z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_0 <= -2e+205) tmp = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z / x)) * z); elseif (t_0 <= 1e+31) tmp = Float64(Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x) - fma(Float64(0.5 - x), log(x), Float64(x - 0.91893853320467))); else tmp = Float64(Float64(Float64(Float64(Float64(-0.0007936500793651) - y) / x) * z) * Float64(-z)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+205], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$0, 1e+31], N[(N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(N[(0.5 - x), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[((-0.0007936500793651) - y), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * (-z)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+205}:\\
\;\;\;\;\left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right) \cdot z\\
\mathbf{elif}\;t\_0 \leq 10^{+31}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x} - \mathsf{fma}\left(0.5 - x, \log x, x - 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\left(-0.0007936500793651\right) - y}{x} \cdot z\right) \cdot \left(-z\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -2.00000000000000003e205Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites44.6%
if -2.00000000000000003e205 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 9.9999999999999996e30Initial program 93.7%
Applied rewrites93.7%
Taylor expanded in z around 0
Applied rewrites62.5%
if 9.9999999999999996e30 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites44.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -2e+205)
(* (* (+ y 0.0007936500793651) (/ z x)) z)
(if (<= t_0 1e+31)
(-
(+ 0.91893853320467 (fma (log x) (- x 0.5) (/ 0.083333333333333 x)))
x)
(* (* (/ (- (- 0.0007936500793651) y) x) z) (- z))))))
double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -2e+205) {
tmp = ((y + 0.0007936500793651) * (z / x)) * z;
} else if (t_0 <= 1e+31) {
tmp = (0.91893853320467 + fma(log(x), (x - 0.5), (0.083333333333333 / x))) - x;
} else {
tmp = (((-0.0007936500793651 - y) / x) * z) * -z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_0 <= -2e+205) tmp = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z / x)) * z); elseif (t_0 <= 1e+31) tmp = Float64(Float64(0.91893853320467 + fma(log(x), Float64(x - 0.5), Float64(0.083333333333333 / x))) - x); else tmp = Float64(Float64(Float64(Float64(Float64(-0.0007936500793651) - y) / x) * z) * Float64(-z)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+205], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$0, 1e+31], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(N[((-0.0007936500793651) - y), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * (-z)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+205}:\\
\;\;\;\;\left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right) \cdot z\\
\mathbf{elif}\;t\_0 \leq 10^{+31}:\\
\;\;\;\;\left(0.91893853320467 + \mathsf{fma}\left(\log x, x - 0.5, \frac{0.083333333333333}{x}\right)\right) - x\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\left(-0.0007936500793651\right) - y}{x} \cdot z\right) \cdot \left(-z\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -2.00000000000000003e205Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites44.6%
if -2.00000000000000003e205 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 9.9999999999999996e30Initial program 93.7%
Taylor expanded in z around 0
Applied rewrites94.7%
Taylor expanded in z around 0
Applied rewrites56.9%
Applied rewrites56.9%
if 9.9999999999999996e30 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites44.2%
(FPCore (x y z)
:precision binary64
(if (<= x 3.3e+15)
(/
(fma
(- (* (+ y 0.0007936500793651) z) 0.0027777777777778)
z
0.083333333333333)
x)
(* x (- (* -1.0 (log (/ 1.0 x))) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.3e+15) {
tmp = fma((((y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = x * ((-1.0 * log((1.0 / x))) - 1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3.3e+15) tmp = Float64(fma(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(x * Float64(Float64(-1.0 * log(Float64(1.0 / x))) - 1.0)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3.3e+15], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[(-1.0 * N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.3 \cdot 10^{+15}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)\\
\end{array}
\end{array}
if x < 3.3e15Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Applied rewrites63.9%
if 3.3e15 < x Initial program 93.7%
Taylor expanded in x around inf
Applied rewrites34.2%
(FPCore (x y z)
:precision binary64
(if (<= x 1.12e+58)
(/
(fma
(- (* (+ y 0.0007936500793651) z) 0.0027777777777778)
z
0.083333333333333)
x)
(* (* (+ y 0.0007936500793651) (/ z x)) z)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.12e+58) {
tmp = fma((((y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((y + 0.0007936500793651) * (z / x)) * z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.12e+58) tmp = Float64(fma(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z / x)) * z); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.12e+58], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.12 \cdot 10^{+58}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right) \cdot z\\
\end{array}
\end{array}
if x < 1.12e58Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Applied rewrites63.9%
if 1.12e58 < x Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites44.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -40000000000.0)
(* (+ y 0.0007936500793651) (* (/ z x) z))
(if (<= t_0 0.1)
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)
(* (* (/ (- (- 0.0007936500793651) y) x) z) (- z))))))
double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -40000000000.0) {
tmp = (y + 0.0007936500793651) * ((z / x) * z);
} else if (t_0 <= 0.1) {
tmp = (0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x;
} else {
tmp = (((-0.0007936500793651 - y) / x) * 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 = ((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0
if (t_0 <= (-40000000000.0d0)) then
tmp = (y + 0.0007936500793651d0) * ((z / x) * z)
else if (t_0 <= 0.1d0) then
tmp = (0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x
else
tmp = (((-0.0007936500793651d0 - y) / x) * z) * -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -40000000000.0) {
tmp = (y + 0.0007936500793651) * ((z / x) * z);
} else if (t_0 <= 0.1) {
tmp = (0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x;
} else {
tmp = (((-0.0007936500793651 - y) / x) * z) * -z;
}
return tmp;
}
def code(x, y, z): t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333 tmp = 0 if t_0 <= -40000000000.0: tmp = (y + 0.0007936500793651) * ((z / x) * z) elif t_0 <= 0.1: tmp = (0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x else: tmp = (((-0.0007936500793651 - y) / x) * z) * -z return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_0 <= -40000000000.0) tmp = Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z / x) * z)); elseif (t_0 <= 0.1) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x); else tmp = Float64(Float64(Float64(Float64(Float64(-0.0007936500793651) - y) / x) * z) * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333; tmp = 0.0; if (t_0 <= -40000000000.0) tmp = (y + 0.0007936500793651) * ((z / x) * z); elseif (t_0 <= 0.1) tmp = (0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x; else tmp = (((-0.0007936500793651 - y) / x) * z) * -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$0, -40000000000.0], N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.1], N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[((-0.0007936500793651) - y), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * (-z)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_0 \leq -40000000000:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(\frac{z}{x} \cdot z\right)\\
\mathbf{elif}\;t\_0 \leq 0.1:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\left(-0.0007936500793651\right) - y}{x} \cdot z\right) \cdot \left(-z\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -4e10Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites42.3%
Applied rewrites44.9%
if -4e10 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.10000000000000001Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Taylor expanded in y around 0
Applied rewrites47.4%
if 0.10000000000000001 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites44.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -40000000000.0)
(* (+ y 0.0007936500793651) (* (/ z x) z))
(if (<= t_0 0.1)
(/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x)
(* (* (/ (- (- 0.0007936500793651) y) x) z) (- z))))))
double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -40000000000.0) {
tmp = (y + 0.0007936500793651) * ((z / x) * z);
} else if (t_0 <= 0.1) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = (((-0.0007936500793651 - y) / x) * 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 = ((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0
if (t_0 <= (-40000000000.0d0)) then
tmp = (y + 0.0007936500793651d0) * ((z / x) * z)
else if (t_0 <= 0.1d0) then
tmp = (0.083333333333333d0 + ((-0.0027777777777778d0) * z)) / x
else
tmp = (((-0.0007936500793651d0 - y) / x) * z) * -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -40000000000.0) {
tmp = (y + 0.0007936500793651) * ((z / x) * z);
} else if (t_0 <= 0.1) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = (((-0.0007936500793651 - y) / x) * z) * -z;
}
return tmp;
}
def code(x, y, z): t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333 tmp = 0 if t_0 <= -40000000000.0: tmp = (y + 0.0007936500793651) * ((z / x) * z) elif t_0 <= 0.1: tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x else: tmp = (((-0.0007936500793651 - y) / x) * z) * -z return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_0 <= -40000000000.0) tmp = Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z / x) * z)); elseif (t_0 <= 0.1) tmp = Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x); else tmp = Float64(Float64(Float64(Float64(Float64(-0.0007936500793651) - y) / x) * z) * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333; tmp = 0.0; if (t_0 <= -40000000000.0) tmp = (y + 0.0007936500793651) * ((z / x) * z); elseif (t_0 <= 0.1) tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x; else tmp = (((-0.0007936500793651 - y) / x) * z) * -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$0, -40000000000.0], N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.1], N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[((-0.0007936500793651) - y), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * (-z)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_0 \leq -40000000000:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(\frac{z}{x} \cdot z\right)\\
\mathbf{elif}\;t\_0 \leq 0.1:\\
\;\;\;\;\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\left(-0.0007936500793651\right) - y}{x} \cdot z\right) \cdot \left(-z\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -4e10Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites42.3%
Applied rewrites44.9%
if -4e10 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.10000000000000001Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Taylor expanded in z around 0
Applied rewrites29.6%
if 0.10000000000000001 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites44.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (+ y 0.0007936500793651) (* (/ z x) z)))
(t_1
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_1 -40000000000.0)
t_0
(if (<= t_1 5e+22)
(/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x)
t_0))))
double code(double x, double y, double z) {
double t_0 = (y + 0.0007936500793651) * ((z / x) * z);
double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_1 <= -40000000000.0) {
tmp = t_0;
} else if (t_1 <= 5e+22) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / 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) :: t_1
real(8) :: tmp
t_0 = (y + 0.0007936500793651d0) * ((z / x) * z)
t_1 = ((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0
if (t_1 <= (-40000000000.0d0)) then
tmp = t_0
else if (t_1 <= 5d+22) then
tmp = (0.083333333333333d0 + ((-0.0027777777777778d0) * z)) / 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.0007936500793651) * ((z / x) * z);
double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_1 <= -40000000000.0) {
tmp = t_0;
} else if (t_1 <= 5e+22) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y + 0.0007936500793651) * ((z / x) * z) t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333 tmp = 0 if t_1 <= -40000000000.0: tmp = t_0 elif t_1 <= 5e+22: tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z / x) * z)) t_1 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_1 <= -40000000000.0) tmp = t_0; elseif (t_1 <= 5e+22) tmp = Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y + 0.0007936500793651) * ((z / x) * z); t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333; tmp = 0.0; if (t_1 <= -40000000000.0) tmp = t_0; elseif (t_1 <= 5e+22) tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$1, -40000000000.0], t$95$0, If[LessEqual[t$95$1, 5e+22], N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y + 0.0007936500793651\right) \cdot \left(\frac{z}{x} \cdot z\right)\\
t_1 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_1 \leq -40000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+22}:\\
\;\;\;\;\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -4e10 or 4.9999999999999996e22 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites42.3%
Applied rewrites44.9%
if -4e10 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 4.9999999999999996e22Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Taylor expanded in z around 0
Applied rewrites29.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (* (+ y 0.0007936500793651) (/ z x)) z))
(t_1
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_1 -40000000000.0)
t_0
(if (<= t_1 0.1)
(/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x)
t_0))))
double code(double x, double y, double z) {
double t_0 = ((y + 0.0007936500793651) * (z / x)) * z;
double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_1 <= -40000000000.0) {
tmp = t_0;
} else if (t_1 <= 0.1) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / 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) :: t_1
real(8) :: tmp
t_0 = ((y + 0.0007936500793651d0) * (z / x)) * z
t_1 = ((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0
if (t_1 <= (-40000000000.0d0)) then
tmp = t_0
else if (t_1 <= 0.1d0) then
tmp = (0.083333333333333d0 + ((-0.0027777777777778d0) * z)) / 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.0007936500793651) * (z / x)) * z;
double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_1 <= -40000000000.0) {
tmp = t_0;
} else if (t_1 <= 0.1) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y + 0.0007936500793651) * (z / x)) * z t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333 tmp = 0 if t_1 <= -40000000000.0: tmp = t_0 elif t_1 <= 0.1: tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z / x)) * z) t_1 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_1 <= -40000000000.0) tmp = t_0; elseif (t_1 <= 0.1) tmp = Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y + 0.0007936500793651) * (z / x)) * z; t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333; tmp = 0.0; if (t_1 <= -40000000000.0) tmp = t_0; elseif (t_1 <= 0.1) tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$1, -40000000000.0], t$95$0, If[LessEqual[t$95$1, 0.1], N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right) \cdot z\\
t_1 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_1 \leq -40000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 0.1:\\
\;\;\;\;\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -4e10 or 0.10000000000000001 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites44.6%
if -4e10 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.10000000000000001Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Taylor expanded in z around 0
Applied rewrites29.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (+ y 0.0007936500793651) z))
(t_1 (* t_0 (/ z x)))
(t_2 (+ (* (- t_0 0.0027777777777778) z) 0.083333333333333)))
(if (<= t_2 -40000000000.0)
t_1
(if (<= t_2 0.1)
(/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x)
t_1))))
double code(double x, double y, double z) {
double t_0 = (y + 0.0007936500793651) * z;
double t_1 = t_0 * (z / x);
double t_2 = ((t_0 - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_2 <= -40000000000.0) {
tmp = t_1;
} else if (t_2 <= 0.1) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (y + 0.0007936500793651d0) * z
t_1 = t_0 * (z / x)
t_2 = ((t_0 - 0.0027777777777778d0) * z) + 0.083333333333333d0
if (t_2 <= (-40000000000.0d0)) then
tmp = t_1
else if (t_2 <= 0.1d0) then
tmp = (0.083333333333333d0 + ((-0.0027777777777778d0) * z)) / x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y + 0.0007936500793651) * z;
double t_1 = t_0 * (z / x);
double t_2 = ((t_0 - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_2 <= -40000000000.0) {
tmp = t_1;
} else if (t_2 <= 0.1) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (y + 0.0007936500793651) * z t_1 = t_0 * (z / x) t_2 = ((t_0 - 0.0027777777777778) * z) + 0.083333333333333 tmp = 0 if t_2 <= -40000000000.0: tmp = t_1 elif t_2 <= 0.1: tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(y + 0.0007936500793651) * z) t_1 = Float64(t_0 * Float64(z / x)) t_2 = Float64(Float64(Float64(t_0 - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_2 <= -40000000000.0) tmp = t_1; elseif (t_2 <= 0.1) tmp = Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y + 0.0007936500793651) * z; t_1 = t_0 * (z / x); t_2 = ((t_0 - 0.0027777777777778) * z) + 0.083333333333333; tmp = 0.0; if (t_2 <= -40000000000.0) tmp = t_1; elseif (t_2 <= 0.1) tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(z / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$2, -40000000000.0], t$95$1, If[LessEqual[t$95$2, 0.1], N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y + 0.0007936500793651\right) \cdot z\\
t_1 := t\_0 \cdot \frac{z}{x}\\
t_2 := \left(t\_0 - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_2 \leq -40000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0.1:\\
\;\;\;\;\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -4e10 or 0.10000000000000001 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites44.6%
if -4e10 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.10000000000000001Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Taylor expanded in z around 0
Applied rewrites29.6%
(FPCore (x y z)
:precision binary64
(if (<=
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
5e+22)
(/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x)
(/ (* z (* -0.0007936500793651 z)) (- x))))
double code(double x, double y, double z) {
double tmp;
if ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) <= 5e+22) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = (z * (-0.0007936500793651 * z)) / -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 ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) <= 5d+22) then
tmp = (0.083333333333333d0 + ((-0.0027777777777778d0) * z)) / x
else
tmp = (z * ((-0.0007936500793651d0) * z)) / -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) <= 5e+22) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = (z * (-0.0007936500793651 * z)) / -x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) <= 5e+22: tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x else: tmp = (z * (-0.0007936500793651 * z)) / -x return tmp
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) <= 5e+22) tmp = Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x); else tmp = Float64(Float64(z * Float64(-0.0007936500793651 * z)) / Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) <= 5e+22) tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x; else tmp = (z * (-0.0007936500793651 * z)) / -x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision], 5e+22], N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(z * N[(-0.0007936500793651 * z), $MachinePrecision]), $MachinePrecision] / (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333 \leq 5 \cdot 10^{+22}:\\
\;\;\;\;\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(-0.0007936500793651 \cdot z\right)}{-x}\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 4.9999999999999996e22Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Taylor expanded in z around 0
Applied rewrites29.6%
if 4.9999999999999996e22 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 93.7%
Taylor expanded in z around inf
Applied rewrites42.3%
Applied rewrites42.3%
Taylor expanded in y around 0
Applied rewrites26.0%
(FPCore (x y z) :precision binary64 (if (<= z 7.2e+22) (/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x) (/ (* 0.083333333333333 x) (* x x))))
double code(double x, double y, double z) {
double tmp;
if (z <= 7.2e+22) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = (0.083333333333333 * x) / (x * 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 <= 7.2d+22) then
tmp = (0.083333333333333d0 + ((-0.0027777777777778d0) * z)) / x
else
tmp = (0.083333333333333d0 * x) / (x * x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 7.2e+22) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = (0.083333333333333 * x) / (x * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 7.2e+22: tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x else: tmp = (0.083333333333333 * x) / (x * x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 7.2e+22) tmp = Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x); else tmp = Float64(Float64(0.083333333333333 * x) / Float64(x * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 7.2e+22) tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x; else tmp = (0.083333333333333 * x) / (x * x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 7.2e+22], N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.083333333333333 * x), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.2 \cdot 10^{+22}:\\
\;\;\;\;\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 \cdot x}{x \cdot x}\\
\end{array}
\end{array}
if z < 7.2e22Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Taylor expanded in z around 0
Applied rewrites29.6%
if 7.2e22 < z Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Applied rewrites47.9%
Taylor expanded in z around 0
Applied rewrites21.9%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (-0.0027777777777778 * 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 = (0.083333333333333d0 + ((-0.0027777777777778d0) * z)) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (-0.0027777777777778 * z)) / x;
}
def code(x, y, z): return (0.083333333333333 + (-0.0027777777777778 * z)) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}
\end{array}
Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Taylor expanded in z around 0
Applied rewrites29.6%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 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 = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 93.7%
Taylor expanded in x around 0
Applied rewrites63.9%
Taylor expanded in z around 0
Applied rewrites24.1%
herbie shell --seed 2025153
(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)))