
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
(FPCore (x y z) :precision binary64 (+ x (134-z0z1z2z3z4 z y 6 x 6)))
x + \mathsf{134\_z0z1z2z3z4}\left(z, y, 6, x, 6\right)
Initial program 99.7%
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-neg-inN/A
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
distribute-rgt-out--N/A
lower-134-z0z1z2z3z4100.0%
Applied rewrites100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6 (* z (- y x)))))
(if (<= z -49000)
t_0
(if (<= z 3961408125713217/2475880078570760549798248448)
(+ x (* (* y 6) z))
t_0))))double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 1.6e-12) {
tmp = x + ((y * 6.0) * z);
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (z * (y - x))
if (z <= (-49000.0d0)) then
tmp = t_0
else if (z <= 1.6d-12) then
tmp = x + ((y * 6.0d0) * z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 1.6e-12) {
tmp = x + ((y * 6.0) * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * (y - x)) tmp = 0 if z <= -49000.0: tmp = t_0 elif z <= 1.6e-12: tmp = x + ((y * 6.0) * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -49000.0) tmp = t_0; elseif (z <= 1.6e-12) tmp = Float64(x + Float64(Float64(y * 6.0) * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * (y - x)); tmp = 0.0; if (z <= -49000.0) tmp = t_0; elseif (z <= 1.6e-12) tmp = x + ((y * 6.0) * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -49000], t$95$0, If[LessEqual[z, 3961408125713217/2475880078570760549798248448], N[(x + N[(N[(y * 6), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -49000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{3961408125713217}{2475880078570760549798248448}:\\
\;\;\;\;x + \left(y \cdot 6\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -49000 or 1.6e-12 < z Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f6464.9%
Applied rewrites64.9%
if -49000 < z < 1.6e-12Initial program 99.7%
Taylor expanded in x around 0
Applied rewrites76.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6 (* z (- y x)))))
(if (<= z -49000)
t_0
(if (<= z 3961408125713217/2475880078570760549798248448)
(+ x (* (* 6 z) y))
t_0))))double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 1.6e-12) {
tmp = x + ((6.0 * z) * 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 = 6.0d0 * (z * (y - x))
if (z <= (-49000.0d0)) then
tmp = t_0
else if (z <= 1.6d-12) then
tmp = x + ((6.0d0 * z) * y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 1.6e-12) {
tmp = x + ((6.0 * z) * y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * (y - x)) tmp = 0 if z <= -49000.0: tmp = t_0 elif z <= 1.6e-12: tmp = x + ((6.0 * z) * y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -49000.0) tmp = t_0; elseif (z <= 1.6e-12) tmp = Float64(x + Float64(Float64(6.0 * z) * y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * (y - x)); tmp = 0.0; if (z <= -49000.0) tmp = t_0; elseif (z <= 1.6e-12) tmp = x + ((6.0 * z) * y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -49000], t$95$0, If[LessEqual[z, 3961408125713217/2475880078570760549798248448], N[(x + N[(N[(6 * z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -49000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{3961408125713217}{2475880078570760549798248448}:\\
\;\;\;\;x + \left(6 \cdot z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -49000 or 1.6e-12 < z Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f6464.9%
Applied rewrites64.9%
if -49000 < z < 1.6e-12Initial program 99.7%
Taylor expanded in x around 0
Applied rewrites76.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-*.f6476.2%
Applied rewrites76.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6 (* z (- y x)))))
(if (<= z -49000)
t_0
(if (<= z 3961408125713217/2475880078570760549798248448)
(+ x (* 6 (* y z)))
t_0))))double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 1.6e-12) {
tmp = x + (6.0 * (y * z));
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (z * (y - x))
if (z <= (-49000.0d0)) then
tmp = t_0
else if (z <= 1.6d-12) then
tmp = x + (6.0d0 * (y * z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 1.6e-12) {
tmp = x + (6.0 * (y * z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * (y - x)) tmp = 0 if z <= -49000.0: tmp = t_0 elif z <= 1.6e-12: tmp = x + (6.0 * (y * z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -49000.0) tmp = t_0; elseif (z <= 1.6e-12) tmp = Float64(x + Float64(6.0 * Float64(y * z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * (y - x)); tmp = 0.0; if (z <= -49000.0) tmp = t_0; elseif (z <= 1.6e-12) tmp = x + (6.0 * (y * z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -49000], t$95$0, If[LessEqual[z, 3961408125713217/2475880078570760549798248448], N[(x + N[(6 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -49000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{3961408125713217}{2475880078570760549798248448}:\\
\;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -49000 or 1.6e-12 < z Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f6464.9%
Applied rewrites64.9%
if -49000 < z < 1.6e-12Initial program 99.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6476.2%
Applied rewrites76.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6 (* z (- y x)))))
(if (<= z -870426590122533/19342813113834066795298816)
t_0
(if (<=
z
2918326469422347/187072209578355573530071658587684226515959365500928)
(+ x (* -6 (* x z)))
t_0))))double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -4.5e-11) {
tmp = t_0;
} else if (z <= 1.56e-35) {
tmp = x + (-6.0 * (x * z));
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (z * (y - x))
if (z <= (-4.5d-11)) then
tmp = t_0
else if (z <= 1.56d-35) then
tmp = x + ((-6.0d0) * (x * z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -4.5e-11) {
tmp = t_0;
} else if (z <= 1.56e-35) {
tmp = x + (-6.0 * (x * z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * (y - x)) tmp = 0 if z <= -4.5e-11: tmp = t_0 elif z <= 1.56e-35: tmp = x + (-6.0 * (x * z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -4.5e-11) tmp = t_0; elseif (z <= 1.56e-35) tmp = Float64(x + Float64(-6.0 * Float64(x * z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * (y - x)); tmp = 0.0; if (z <= -4.5e-11) tmp = t_0; elseif (z <= 1.56e-35) tmp = x + (-6.0 * (x * z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -870426590122533/19342813113834066795298816], t$95$0, If[LessEqual[z, 2918326469422347/187072209578355573530071658587684226515959365500928], N[(x + N[(-6 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq \frac{-870426590122533}{19342813113834066795298816}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{2918326469422347}{187072209578355573530071658587684226515959365500928}:\\
\;\;\;\;x + -6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -4.5e-11 or 1.56e-35 < z Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f6464.9%
Applied rewrites64.9%
if -4.5e-11 < z < 1.56e-35Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6 (* z (- y x)))))
(if (<= z -870426590122533/19342813113834066795298816)
t_0
(if (<=
z
2918326469422347/187072209578355573530071658587684226515959365500928)
(* x (+ 1 (* -6 z)))
t_0))))double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -4.5e-11) {
tmp = t_0;
} else if (z <= 1.56e-35) {
tmp = x * (1.0 + (-6.0 * z));
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (z * (y - x))
if (z <= (-4.5d-11)) then
tmp = t_0
else if (z <= 1.56d-35) then
tmp = x * (1.0d0 + ((-6.0d0) * z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -4.5e-11) {
tmp = t_0;
} else if (z <= 1.56e-35) {
tmp = x * (1.0 + (-6.0 * z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * (y - x)) tmp = 0 if z <= -4.5e-11: tmp = t_0 elif z <= 1.56e-35: tmp = x * (1.0 + (-6.0 * z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -4.5e-11) tmp = t_0; elseif (z <= 1.56e-35) tmp = Float64(x * Float64(1.0 + Float64(-6.0 * z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * (y - x)); tmp = 0.0; if (z <= -4.5e-11) tmp = t_0; elseif (z <= 1.56e-35) tmp = x * (1.0 + (-6.0 * z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -870426590122533/19342813113834066795298816], t$95$0, If[LessEqual[z, 2918326469422347/187072209578355573530071658587684226515959365500928], N[(x * N[(1 + N[(-6 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq \frac{-870426590122533}{19342813113834066795298816}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{2918326469422347}{187072209578355573530071658587684226515959365500928}:\\
\;\;\;\;x \cdot \left(1 + -6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -4.5e-11 or 1.56e-35 < z Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f6464.9%
Applied rewrites64.9%
if -4.5e-11 < z < 1.56e-35Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6 (* z (- y x)))))
(if (<= z -870426590122533/19342813113834066795298816)
t_0
(if (<=
z
2918326469422347/187072209578355573530071658587684226515959365500928)
(* x 1)
t_0))))double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -4.5e-11) {
tmp = t_0;
} else if (z <= 1.56e-35) {
tmp = x * 1.0;
} 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 = 6.0d0 * (z * (y - x))
if (z <= (-4.5d-11)) then
tmp = t_0
else if (z <= 1.56d-35) then
tmp = x * 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -4.5e-11) {
tmp = t_0;
} else if (z <= 1.56e-35) {
tmp = x * 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * (y - x)) tmp = 0 if z <= -4.5e-11: tmp = t_0 elif z <= 1.56e-35: tmp = x * 1.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -4.5e-11) tmp = t_0; elseif (z <= 1.56e-35) tmp = Float64(x * 1.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * (y - x)); tmp = 0.0; if (z <= -4.5e-11) tmp = t_0; elseif (z <= 1.56e-35) tmp = x * 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -870426590122533/19342813113834066795298816], t$95$0, If[LessEqual[z, 2918326469422347/187072209578355573530071658587684226515959365500928], N[(x * 1), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq \frac{-870426590122533}{19342813113834066795298816}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{2918326469422347}{187072209578355573530071658587684226515959365500928}:\\
\;\;\;\;x \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -4.5e-11 or 1.56e-35 < z Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f6464.9%
Applied rewrites64.9%
if -4.5e-11 < z < 1.56e-35Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
(FPCore (x y z)
:precision binary64
(if (<= z -870426590122533/19342813113834066795298816)
(* (* 6 y) z)
(if (<=
z
2918326469422347/187072209578355573530071658587684226515959365500928)
(* x 1)
(if (<=
z
59999999999999995807196081557826383708039989008338610955695381169883378996985483422571781521365526805463368204288)
(* 6 (* y z))
(* -6 (* x z))))))double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e-11) {
tmp = (6.0 * y) * z;
} else if (z <= 1.56e-35) {
tmp = x * 1.0;
} else if (z <= 6e+112) {
tmp = 6.0 * (y * z);
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-4.5d-11)) then
tmp = (6.0d0 * y) * z
else if (z <= 1.56d-35) then
tmp = x * 1.0d0
else if (z <= 6d+112) then
tmp = 6.0d0 * (y * z)
else
tmp = (-6.0d0) * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e-11) {
tmp = (6.0 * y) * z;
} else if (z <= 1.56e-35) {
tmp = x * 1.0;
} else if (z <= 6e+112) {
tmp = 6.0 * (y * z);
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.5e-11: tmp = (6.0 * y) * z elif z <= 1.56e-35: tmp = x * 1.0 elif z <= 6e+112: tmp = 6.0 * (y * z) else: tmp = -6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.5e-11) tmp = Float64(Float64(6.0 * y) * z); elseif (z <= 1.56e-35) tmp = Float64(x * 1.0); elseif (z <= 6e+112) tmp = Float64(6.0 * Float64(y * z)); else tmp = Float64(-6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.5e-11) tmp = (6.0 * y) * z; elseif (z <= 1.56e-35) tmp = x * 1.0; elseif (z <= 6e+112) tmp = 6.0 * (y * z); else tmp = -6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -870426590122533/19342813113834066795298816], N[(N[(6 * y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 2918326469422347/187072209578355573530071658587684226515959365500928], N[(x * 1), $MachinePrecision], If[LessEqual[z, 59999999999999995807196081557826383708039989008338610955695381169883378996985483422571781521365526805463368204288], N[(6 * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(-6 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-870426590122533}{19342813113834066795298816}:\\
\;\;\;\;\left(6 \cdot y\right) \cdot z\\
\mathbf{elif}\;z \leq \frac{2918326469422347}{187072209578355573530071658587684226515959365500928}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;z \leq 59999999999999995807196081557826383708039989008338610955695381169883378996985483422571781521365526805463368204288:\\
\;\;\;\;6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\end{array}
if z < -4.5e-11Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
if -4.5e-11 < z < 1.56e-35Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
if 1.56e-35 < z < 5.9999999999999996e112Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
if 5.9999999999999996e112 < z Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in z around inf
lower-*.f6427.4%
Applied rewrites27.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6427.4%
Applied rewrites27.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6 (* y z))))
(if (<= z -870426590122533/19342813113834066795298816)
t_0
(if (<=
z
2918326469422347/187072209578355573530071658587684226515959365500928)
(* x 1)
(if (<=
z
59999999999999995807196081557826383708039989008338610955695381169883378996985483422571781521365526805463368204288)
t_0
(* -6 (* x z)))))))double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double tmp;
if (z <= -4.5e-11) {
tmp = t_0;
} else if (z <= 1.56e-35) {
tmp = x * 1.0;
} else if (z <= 6e+112) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (y * z)
if (z <= (-4.5d-11)) then
tmp = t_0
else if (z <= 1.56d-35) then
tmp = x * 1.0d0
else if (z <= 6d+112) then
tmp = t_0
else
tmp = (-6.0d0) * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double tmp;
if (z <= -4.5e-11) {
tmp = t_0;
} else if (z <= 1.56e-35) {
tmp = x * 1.0;
} else if (z <= 6e+112) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * z) tmp = 0 if z <= -4.5e-11: tmp = t_0 elif z <= 1.56e-35: tmp = x * 1.0 elif z <= 6e+112: tmp = t_0 else: tmp = -6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * z)) tmp = 0.0 if (z <= -4.5e-11) tmp = t_0; elseif (z <= 1.56e-35) tmp = Float64(x * 1.0); elseif (z <= 6e+112) tmp = t_0; else tmp = Float64(-6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * z); tmp = 0.0; if (z <= -4.5e-11) tmp = t_0; elseif (z <= 1.56e-35) tmp = x * 1.0; elseif (z <= 6e+112) tmp = t_0; else tmp = -6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -870426590122533/19342813113834066795298816], t$95$0, If[LessEqual[z, 2918326469422347/187072209578355573530071658587684226515959365500928], N[(x * 1), $MachinePrecision], If[LessEqual[z, 59999999999999995807196081557826383708039989008338610955695381169883378996985483422571781521365526805463368204288], t$95$0, N[(-6 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq \frac{-870426590122533}{19342813113834066795298816}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{2918326469422347}{187072209578355573530071658587684226515959365500928}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;z \leq 59999999999999995807196081557826383708039989008338610955695381169883378996985483422571781521365526805463368204288:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\end{array}
if z < -4.5e-11 or 1.56e-35 < z < 5.9999999999999996e112Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6442.0%
Applied rewrites42.0%
if -4.5e-11 < z < 1.56e-35Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
if 5.9999999999999996e112 < z Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in z around inf
lower-*.f6427.4%
Applied rewrites27.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6427.4%
Applied rewrites27.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6 (* x z))))
(if (<= z -49000)
t_0
(if (<= z 700976274800963/9223372036854775808) (* x 1) t_0))))double code(double x, double y, double z) {
double t_0 = -6.0 * (x * z);
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 7.6e-5) {
tmp = x * 1.0;
} 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 = (-6.0d0) * (x * z)
if (z <= (-49000.0d0)) then
tmp = t_0
else if (z <= 7.6d-5) then
tmp = x * 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (x * z);
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 7.6e-5) {
tmp = x * 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (x * z) tmp = 0 if z <= -49000.0: tmp = t_0 elif z <= 7.6e-5: tmp = x * 1.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(x * z)) tmp = 0.0 if (z <= -49000.0) tmp = t_0; elseif (z <= 7.6e-5) tmp = Float64(x * 1.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (x * z); tmp = 0.0; if (z <= -49000.0) tmp = t_0; elseif (z <= 7.6e-5) tmp = x * 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -49000], t$95$0, If[LessEqual[z, 700976274800963/9223372036854775808], N[(x * 1), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := -6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -49000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{700976274800963}{9223372036854775808}:\\
\;\;\;\;x \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -49000 or 7.6000000000000004e-5 < z Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
Taylor expanded in z around inf
lower-*.f6427.4%
Applied rewrites27.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6427.4%
Applied rewrites27.4%
if -49000 < z < 7.6000000000000004e-5Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
(FPCore (x y z) :precision binary64 (* x 1))
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), $MachinePrecision]
x \cdot 1
Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6461.6%
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites36.5%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
:precision binary64
(+ x (* (* (- y x) 6) z)))