
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))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 * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))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 * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
(FPCore (x y z)
:precision binary64
(if (<=
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304)))
4e+303)
(fma
(/
(fma (fma 0.0692910599291889 z 0.4917317610505968) z 0.279195317918525)
(fma (- z -6.012459259764103) z 3.350343815022304))
y
x)
(+ x (/ 1.0 (/ 14.431876219268936 y)))))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+303) {
tmp = fma((fma(fma(0.0692910599291889, z, 0.4917317610505968), z, 0.279195317918525) / fma((z - -6.012459259764103), z, 3.350343815022304)), y, x);
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
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+303) tmp = fma(Float64(fma(fma(0.0692910599291889, z, 0.4917317610505968), z, 0.279195317918525) / fma(Float64(z - -6.012459259764103), z, 3.350343815022304)), y, x); else tmp = Float64(x + Float64(1.0 / Float64(14.431876219268936 / y))); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+303], N[(N[(N[(N[(0.0692910599291889 * z + 0.4917317610505968), $MachinePrecision] * z + 0.279195317918525), $MachinePrecision] / N[(N[(z - -6.012459259764103), $MachinePrecision] * z + 3.350343815022304), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(x + N[(1.0 / N[(14.431876219268936 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \leq 4 \cdot 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right), z, 0.279195317918525\right)}{\mathsf{fma}\left(z - -6.012459259764103, z, 3.350343815022304\right)}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{14.431876219268936}{y}}\\
\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)))) < 4e303Initial program 69.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.1%
if 4e303 < (+.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 69.5%
Taylor expanded in z around inf
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6464.3%
Applied rewrites64.3%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-/.f64N/A
associate-*r/N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
add-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6453.4%
Applied rewrites53.4%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6453.4%
Applied rewrites53.4%
Taylor expanded in z around inf
lower-/.f6479.4%
Applied rewrites79.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (fma y 0.0692910599291889 (* (/ y z) 0.07512208616047561)))))
(if (<= z -5.5)
t_0
(if (<= z 4.7)
(+
x
(fma
0.08333333333333323
y
(* z (- (* 0.14677053705526136 y) (* 0.14954831483277858 y)))))
t_0))))double code(double x, double y, double z) {
double t_0 = x + fma(y, 0.0692910599291889, ((y / z) * 0.07512208616047561));
double tmp;
if (z <= -5.5) {
tmp = t_0;
} else if (z <= 4.7) {
tmp = x + fma(0.08333333333333323, y, (z * ((0.14677053705526136 * y) - (0.14954831483277858 * y))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(x + fma(y, 0.0692910599291889, Float64(Float64(y / z) * 0.07512208616047561))) tmp = 0.0 if (z <= -5.5) tmp = t_0; elseif (z <= 4.7) tmp = Float64(x + fma(0.08333333333333323, y, Float64(z * Float64(Float64(0.14677053705526136 * y) - Float64(0.14954831483277858 * y))))); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * 0.0692910599291889 + N[(N[(y / z), $MachinePrecision] * 0.07512208616047561), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5], t$95$0, If[LessEqual[z, 4.7], N[(x + N[(0.08333333333333323 * y + N[(z * N[(N[(0.14677053705526136 * y), $MachinePrecision] - N[(0.14954831483277858 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + \mathsf{fma}\left(y, 0.0692910599291889, \frac{y}{z} \cdot 0.07512208616047561\right)\\
\mathbf{if}\;z \leq -5.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.7:\\
\;\;\;\;x + \mathsf{fma}\left(0.08333333333333323, y, z \cdot \left(0.14677053705526136 \cdot y - 0.14954831483277858 \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -5.5 or 4.70000000000000018 < z Initial program 69.5%
Taylor expanded in z around inf
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6464.3%
Applied rewrites64.3%
lift--.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
metadata-eval64.7%
Applied rewrites64.7%
if -5.5 < z < 4.70000000000000018Initial program 69.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6466.5%
Applied rewrites66.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (fma y 0.0692910599291889 (* (/ y z) 0.07512208616047561)))))
(if (<= z -78.0)
t_0
(if (<= z 820000.0) (+ x (* 0.08333333333333323 y)) t_0))))double code(double x, double y, double z) {
double t_0 = x + fma(y, 0.0692910599291889, ((y / z) * 0.07512208616047561));
double tmp;
if (z <= -78.0) {
tmp = t_0;
} else if (z <= 820000.0) {
tmp = x + (0.08333333333333323 * y);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(x + fma(y, 0.0692910599291889, Float64(Float64(y / z) * 0.07512208616047561))) tmp = 0.0 if (z <= -78.0) tmp = t_0; elseif (z <= 820000.0) tmp = Float64(x + Float64(0.08333333333333323 * y)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * 0.0692910599291889 + N[(N[(y / z), $MachinePrecision] * 0.07512208616047561), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -78.0], t$95$0, If[LessEqual[z, 820000.0], N[(x + N[(0.08333333333333323 * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + \mathsf{fma}\left(y, 0.0692910599291889, \frac{y}{z} \cdot 0.07512208616047561\right)\\
\mathbf{if}\;z \leq -78:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 820000:\\
\;\;\;\;x + 0.08333333333333323 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -78 or 8.2e5 < z Initial program 69.5%
Taylor expanded in z around inf
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6464.3%
Applied rewrites64.3%
lift--.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
metadata-eval64.7%
Applied rewrites64.7%
if -78 < z < 8.2e5Initial program 69.5%
Taylor expanded in z around 0
lower-*.f6480.3%
Applied rewrites80.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ 1.0 (/ 14.431876219268936 y)))))
(if (<= z -0.82)
t_0
(if (<= z 8200.0) (+ x (* 0.08333333333333323 y)) t_0))))double code(double x, double y, double z) {
double t_0 = x + (1.0 / (14.431876219268936 / y));
double tmp;
if (z <= -0.82) {
tmp = t_0;
} else if (z <= 8200.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 + (1.0d0 / (14.431876219268936d0 / y))
if (z <= (-0.82d0)) then
tmp = t_0
else if (z <= 8200.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 + (1.0 / (14.431876219268936 / y));
double tmp;
if (z <= -0.82) {
tmp = t_0;
} else if (z <= 8200.0) {
tmp = x + (0.08333333333333323 * y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (1.0 / (14.431876219268936 / y)) tmp = 0 if z <= -0.82: tmp = t_0 elif z <= 8200.0: tmp = x + (0.08333333333333323 * y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(1.0 / Float64(14.431876219268936 / y))) tmp = 0.0 if (z <= -0.82) tmp = t_0; elseif (z <= 8200.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 + (1.0 / (14.431876219268936 / y)); tmp = 0.0; if (z <= -0.82) tmp = t_0; elseif (z <= 8200.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[(1.0 / N[(14.431876219268936 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.82], t$95$0, If[LessEqual[z, 8200.0], N[(x + N[(0.08333333333333323 * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + \frac{1}{\frac{14.431876219268936}{y}}\\
\mathbf{if}\;z \leq -0.82:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 8200:\\
\;\;\;\;x + 0.08333333333333323 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -0.819999999999999951 or 8200 < z Initial program 69.5%
Taylor expanded in z around inf
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6464.3%
Applied rewrites64.3%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-/.f64N/A
associate-*r/N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
add-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6453.4%
Applied rewrites53.4%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6453.4%
Applied rewrites53.4%
Taylor expanded in z around inf
lower-/.f6479.4%
Applied rewrites79.4%
if -0.819999999999999951 < z < 8200Initial program 69.5%
Taylor expanded in z around 0
lower-*.f6480.3%
Applied rewrites80.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* 0.0692910599291889 y))))
(if (<= z -0.82)
t_0
(if (<= z 8200.0) (+ x (* 0.08333333333333323 y)) t_0))))double code(double x, double y, double z) {
double t_0 = x + (0.0692910599291889 * y);
double tmp;
if (z <= -0.82) {
tmp = t_0;
} else if (z <= 8200.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 <= (-0.82d0)) then
tmp = t_0
else if (z <= 8200.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 <= -0.82) {
tmp = t_0;
} else if (z <= 8200.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 <= -0.82: tmp = t_0 elif z <= 8200.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 <= -0.82) tmp = t_0; elseif (z <= 8200.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 <= -0.82) tmp = t_0; elseif (z <= 8200.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[(0.0692910599291889 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.82], t$95$0, If[LessEqual[z, 8200.0], N[(x + N[(0.08333333333333323 * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + 0.0692910599291889 \cdot y\\
\mathbf{if}\;z \leq -0.82:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 8200:\\
\;\;\;\;x + 0.08333333333333323 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -0.819999999999999951 or 8200 < z Initial program 69.5%
Taylor expanded in z around inf
lower-*.f6479.3%
Applied rewrites79.3%
if -0.819999999999999951 < z < 8200Initial program 69.5%
Taylor expanded in z around 0
lower-*.f6480.3%
Applied rewrites80.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304)))
(t_1 (+ x (* 0.0692910599291889 y))))
(if (<= t_0 (- INFINITY))
t_1
(if (<= t_0 -5e-19)
(* 0.08333333333333323 y)
(if (<= t_0 5e+120)
t_1
(if (<= t_0 4e+303) (* 0.08333333333333323 y) t_1))))))double code(double x, double y, double z) {
double t_0 = (y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304);
double t_1 = x + (0.0692910599291889 * y);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_0 <= -5e-19) {
tmp = 0.08333333333333323 * y;
} else if (t_0 <= 5e+120) {
tmp = t_1;
} else if (t_0 <= 4e+303) {
tmp = 0.08333333333333323 * y;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304);
double t_1 = x + (0.0692910599291889 * y);
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_0 <= -5e-19) {
tmp = 0.08333333333333323 * y;
} else if (t_0 <= 5e+120) {
tmp = t_1;
} else if (t_0 <= 4e+303) {
tmp = 0.08333333333333323 * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304) t_1 = x + (0.0692910599291889 * y) tmp = 0 if t_0 <= -math.inf: tmp = t_1 elif t_0 <= -5e-19: tmp = 0.08333333333333323 * y elif t_0 <= 5e+120: tmp = t_1 elif t_0 <= 4e+303: tmp = 0.08333333333333323 * y else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304)) t_1 = Float64(x + Float64(0.0692910599291889 * y)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = t_1; elseif (t_0 <= -5e-19) tmp = Float64(0.08333333333333323 * y); elseif (t_0 <= 5e+120) tmp = t_1; elseif (t_0 <= 4e+303) tmp = Float64(0.08333333333333323 * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304); t_1 = x + (0.0692910599291889 * y); tmp = 0.0; if (t_0 <= -Inf) tmp = t_1; elseif (t_0 <= -5e-19) tmp = 0.08333333333333323 * y; elseif (t_0 <= 5e+120) tmp = t_1; elseif (t_0 <= 4e+303) tmp = 0.08333333333333323 * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(0.0692910599291889 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], t$95$1, If[LessEqual[t$95$0, -5e-19], N[(0.08333333333333323 * y), $MachinePrecision], If[LessEqual[t$95$0, 5e+120], t$95$1, If[LessEqual[t$95$0, 4e+303], N[(0.08333333333333323 * y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t_0 := \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}\\
t_1 := x + 0.0692910599291889 \cdot y\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq -5 \cdot 10^{-19}:\\
\;\;\;\;0.08333333333333323 \cdot y\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;0.08333333333333323 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.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))) < -inf.0 or -5.0000000000000004e-19 < (/.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))) < 5.00000000000000019e120 or 4e303 < (/.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 69.5%
Taylor expanded in z around inf
lower-*.f6479.3%
Applied rewrites79.3%
if -inf.0 < (/.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))) < -5.0000000000000004e-19 or 5.00000000000000019e120 < (/.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))) < 4e303Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6432.5%
Applied rewrites32.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.1%
Taylor expanded in z around 0
Applied rewrites30.7%
(FPCore (x y z) :precision binary64 (if (<= y -2.15e+110) (* 0.08333333333333323 y) (if (<= y 1.8e+44) (* x 1.0) (* 0.0692910599291889 y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.15e+110) {
tmp = 0.08333333333333323 * y;
} else if (y <= 1.8e+44) {
tmp = x * 1.0;
} else {
tmp = 0.0692910599291889 * y;
}
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 <= (-2.15d+110)) then
tmp = 0.08333333333333323d0 * y
else if (y <= 1.8d+44) then
tmp = x * 1.0d0
else
tmp = 0.0692910599291889d0 * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.15e+110) {
tmp = 0.08333333333333323 * y;
} else if (y <= 1.8e+44) {
tmp = x * 1.0;
} else {
tmp = 0.0692910599291889 * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.15e+110: tmp = 0.08333333333333323 * y elif y <= 1.8e+44: tmp = x * 1.0 else: tmp = 0.0692910599291889 * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.15e+110) tmp = Float64(0.08333333333333323 * y); elseif (y <= 1.8e+44) tmp = Float64(x * 1.0); else tmp = Float64(0.0692910599291889 * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.15e+110) tmp = 0.08333333333333323 * y; elseif (y <= 1.8e+44) tmp = x * 1.0; else tmp = 0.0692910599291889 * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.15e+110], N[(0.08333333333333323 * y), $MachinePrecision], If[LessEqual[y, 1.8e+44], N[(x * 1.0), $MachinePrecision], N[(0.0692910599291889 * y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+110}:\\
\;\;\;\;0.08333333333333323 \cdot y\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+44}:\\
\;\;\;\;x \cdot 1\\
\mathbf{else}:\\
\;\;\;\;0.0692910599291889 \cdot y\\
\end{array}
if y < -2.15000000000000003e110Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6432.5%
Applied rewrites32.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.1%
Taylor expanded in z around 0
Applied rewrites30.7%
if -2.15000000000000003e110 < y < 1.8e44Initial program 69.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6463.0%
Applied rewrites63.0%
Taylor expanded in x around inf
Applied rewrites51.7%
if 1.8e44 < y Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6432.5%
Applied rewrites32.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.1%
Taylor expanded in z around inf
Applied rewrites30.0%
(FPCore (x y z) :precision binary64 (if (<= y -2.15e+110) (* 0.0692910599291889 y) (if (<= y 1.8e+44) (* x 1.0) (* 0.0692910599291889 y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.15e+110) {
tmp = 0.0692910599291889 * y;
} else if (y <= 1.8e+44) {
tmp = x * 1.0;
} else {
tmp = 0.0692910599291889 * y;
}
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 <= (-2.15d+110)) then
tmp = 0.0692910599291889d0 * y
else if (y <= 1.8d+44) then
tmp = x * 1.0d0
else
tmp = 0.0692910599291889d0 * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.15e+110) {
tmp = 0.0692910599291889 * y;
} else if (y <= 1.8e+44) {
tmp = x * 1.0;
} else {
tmp = 0.0692910599291889 * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.15e+110: tmp = 0.0692910599291889 * y elif y <= 1.8e+44: tmp = x * 1.0 else: tmp = 0.0692910599291889 * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.15e+110) tmp = Float64(0.0692910599291889 * y); elseif (y <= 1.8e+44) tmp = Float64(x * 1.0); else tmp = Float64(0.0692910599291889 * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.15e+110) tmp = 0.0692910599291889 * y; elseif (y <= 1.8e+44) tmp = x * 1.0; else tmp = 0.0692910599291889 * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.15e+110], N[(0.0692910599291889 * y), $MachinePrecision], If[LessEqual[y, 1.8e+44], N[(x * 1.0), $MachinePrecision], N[(0.0692910599291889 * y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+110}:\\
\;\;\;\;0.0692910599291889 \cdot y\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+44}:\\
\;\;\;\;x \cdot 1\\
\mathbf{else}:\\
\;\;\;\;0.0692910599291889 \cdot y\\
\end{array}
if y < -2.15000000000000003e110 or 1.8e44 < y Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6432.5%
Applied rewrites32.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.1%
Taylor expanded in z around inf
Applied rewrites30.0%
if -2.15000000000000003e110 < y < 1.8e44Initial program 69.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6463.0%
Applied rewrites63.0%
Taylor expanded in x around inf
Applied rewrites51.7%
(FPCore (x y z) :precision binary64 (* x 1.0))
double code(double x, double y, double z) {
return x * 1.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * 1.0d0
end function
public static double code(double x, double y, double z) {
return x * 1.0;
}
def code(x, y, z): return x * 1.0
function code(x, y, z) return Float64(x * 1.0) end
function tmp = code(x, y, z) tmp = x * 1.0; end
code[x_, y_, z_] := N[(x * 1.0), $MachinePrecision]
x \cdot 1
Initial program 69.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6463.0%
Applied rewrites63.0%
Taylor expanded in x around inf
Applied rewrites51.7%
herbie shell --seed 2025179
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
:precision binary64
(+ x (/ (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))