
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
(FPCore (x y z t) :precision binary64 (if (<= z -2e+111) (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))) (- x (/ (- y (/ t y)) (* 3.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+111) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x - ((y - (t / y)) / (3.0 * 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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2d+111)) then
tmp = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
else
tmp = x - ((y - (t / y)) / (3.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+111) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x - ((y - (t / y)) / (3.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2e+111: tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)) else: tmp = x - ((y - (t / y)) / (3.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2e+111) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2e+111) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); else tmp = x - ((y - (t / y)) / (3.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e+111], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+111}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\end{array}
if z < -1.9999999999999999e111Initial program 96.0%
if -1.9999999999999999e111 < z Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
(FPCore (x y z t) :precision binary64 (if (<= z -2e+110) (fma (/ 0.3333333333333333 (* z y)) t (fma (/ -0.3333333333333333 z) y x)) (- x (/ (- y (/ t y)) (* 3.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+110) {
tmp = fma((0.3333333333333333 / (z * y)), t, fma((-0.3333333333333333 / z), y, x));
} else {
tmp = x - ((y - (t / y)) / (3.0 * z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -2e+110) tmp = fma(Float64(0.3333333333333333 / Float64(z * y)), t, fma(Float64(-0.3333333333333333 / z), y, x)); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e+110], N[(N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision] * t + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * y + x), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(\frac{0.3333333333333333}{z \cdot y}, t, \mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\end{array}
if z < -2e110Initial program 96.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
metadata-evalN/A
lower-*.f6495.7%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-neg-frac2N/A
lower-fma.f64N/A
Applied rewrites95.7%
if -2e110 < z Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
(FPCore (x y z t) :precision binary64 (if (<= z -2e+111) (+ (- x (/ y (* z 3.0))) (/ t (* (* 3.0 y) z))) (- x (/ (- y (/ t y)) (* 3.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+111) {
tmp = (x - (y / (z * 3.0))) + (t / ((3.0 * y) * z));
} else {
tmp = x - ((y - (t / y)) / (3.0 * 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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2d+111)) then
tmp = (x - (y / (z * 3.0d0))) + (t / ((3.0d0 * y) * z))
else
tmp = x - ((y - (t / y)) / (3.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+111) {
tmp = (x - (y / (z * 3.0))) + (t / ((3.0 * y) * z));
} else {
tmp = x - ((y - (t / y)) / (3.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2e+111: tmp = (x - (y / (z * 3.0))) + (t / ((3.0 * y) * z)) else: tmp = x - ((y - (t / y)) / (3.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2e+111) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(3.0 * y) * z))); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2e+111) tmp = (x - (y / (z * 3.0))) + (t / ((3.0 * y) * z)); else tmp = x - ((y - (t / y)) / (3.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e+111], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(3.0 * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+111}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(3 \cdot y\right) \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\end{array}
if z < -1.9999999999999999e111Initial program 96.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6496.0%
Applied rewrites96.0%
if -1.9999999999999999e111 < z Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
(FPCore (x y z t) :precision binary64 (if (<= z -3.15e+206) (- x (* -0.3333333333333333 (/ t (* y z)))) (- x (/ (- y (/ t y)) (* 3.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e+206) {
tmp = x - (-0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - ((y - (t / y)) / (3.0 * 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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.15d+206)) then
tmp = x - ((-0.3333333333333333d0) * (t / (y * z)))
else
tmp = x - ((y - (t / y)) / (3.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e+206) {
tmp = x - (-0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - ((y - (t / y)) / (3.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.15e+206: tmp = x - (-0.3333333333333333 * (t / (y * z))) else: tmp = x - ((y - (t / y)) / (3.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.15e+206) tmp = Float64(x - Float64(-0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.15e+206) tmp = x - (-0.3333333333333333 * (t / (y * z))); else tmp = x - ((y - (t / y)) / (3.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.15e+206], N[(x - N[(-0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+206}:\\
\;\;\;\;x - -0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\end{array}
if z < -3.15e206Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.5%
Applied rewrites63.5%
if -3.15e206 < z Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* 0.3333333333333333 (/ y z)))))
(if (<= y -2e+49)
t_1
(if (<= y 3.9e-13) (/ (fma 0.3333333333333333 (/ t z) (* x y)) y) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -2e+49) {
tmp = t_1;
} else if (y <= 3.9e-13) {
tmp = fma(0.3333333333333333, (t / z), (x * y)) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -2e+49) tmp = t_1; elseif (y <= 3.9e-13) tmp = Float64(fma(0.3333333333333333, Float64(t / z), Float64(x * y)) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+49], t$95$1, If[LessEqual[y, 3.9e-13], N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -2 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-13}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333, \frac{t}{z}, x \cdot y\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.9999999999999999e49 or 3.9e-13 < y Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6464.0%
Applied rewrites64.0%
if -1.9999999999999999e49 < y < 3.9e-13Initial program 96.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6462.2%
Applied rewrites62.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* 0.3333333333333333 (/ y z)))))
(if (<= y -1.3e+54)
t_1
(if (<= y 3.9e-13) (- x (* -0.3333333333333333 (/ t (* y z)))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -1.3e+54) {
tmp = t_1;
} else if (y <= 3.9e-13) {
tmp = x - (-0.3333333333333333 * (t / (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-1.3d+54)) then
tmp = t_1
else if (y <= 3.9d-13) then
tmp = x - ((-0.3333333333333333d0) * (t / (y * z)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -1.3e+54) {
tmp = t_1;
} else if (y <= 3.9e-13) {
tmp = x - (-0.3333333333333333 * (t / (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -1.3e+54: tmp = t_1 elif y <= 3.9e-13: tmp = x - (-0.3333333333333333 * (t / (y * z))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -1.3e+54) tmp = t_1; elseif (y <= 3.9e-13) tmp = Float64(x - Float64(-0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -1.3e+54) tmp = t_1; elseif (y <= 3.9e-13) tmp = x - (-0.3333333333333333 * (t / (y * z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+54], t$95$1, If[LessEqual[y, 3.9e-13], N[(x - N[(-0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-13}:\\
\;\;\;\;x - -0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.3e54 or 3.9e-13 < y Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6464.0%
Applied rewrites64.0%
if -1.3e54 < y < 3.9e-13Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.5%
Applied rewrites63.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* 0.3333333333333333 (/ y z)))))
(if (<= y -4.5e-64)
t_1
(if (<= y 1.34e-17) (* (/ 0.3333333333333333 y) (/ t z)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = (0.3333333333333333 / y) * (t / z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-4.5d-64)) then
tmp = t_1
else if (y <= 1.34d-17) then
tmp = (0.3333333333333333d0 / y) * (t / z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = (0.3333333333333333 / y) * (t / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -4.5e-64: tmp = t_1 elif y <= 1.34e-17: tmp = (0.3333333333333333 / y) * (t / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = Float64(Float64(0.3333333333333333 / y) * Float64(t / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = (0.3333333333333333 / y) * (t / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e-64], t$95$1, If[LessEqual[y, 1.34e-17], N[(N[(0.3333333333333333 / y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.34 \cdot 10^{-17}:\\
\;\;\;\;\frac{0.3333333333333333}{y} \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.5000000000000001e-64 or 1.34e-17 < y Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6464.0%
Applied rewrites64.0%
if -4.5000000000000001e-64 < y < 1.34e-17Initial program 96.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.5%
Applied rewrites35.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6438.8%
Applied rewrites38.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* 0.3333333333333333 (/ y z)))))
(if (<= y -4.5e-64)
t_1
(if (<= y 1.34e-17) (* 0.3333333333333333 (/ (/ t z) y)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = 0.3333333333333333 * ((t / z) / y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-4.5d-64)) then
tmp = t_1
else if (y <= 1.34d-17) then
tmp = 0.3333333333333333d0 * ((t / z) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = 0.3333333333333333 * ((t / z) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -4.5e-64: tmp = t_1 elif y <= 1.34e-17: tmp = 0.3333333333333333 * ((t / z) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = Float64(0.3333333333333333 * Float64(Float64(t / z) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = 0.3333333333333333 * ((t / z) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e-64], t$95$1, If[LessEqual[y, 1.34e-17], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.34 \cdot 10^{-17}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.5000000000000001e-64 or 1.34e-17 < y Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6464.0%
Applied rewrites64.0%
if -4.5000000000000001e-64 < y < 1.34e-17Initial program 96.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.5%
Applied rewrites35.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6438.8%
Applied rewrites38.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- x (* 0.3333333333333333 (/ y z))))) (if (<= y -4.5e-64) t_1 (if (<= y 1.34e-17) (/ t (* (* z 3.0) y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = t / ((z * 3.0) * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-4.5d-64)) then
tmp = t_1
else if (y <= 1.34d-17) then
tmp = t / ((z * 3.0d0) * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = t / ((z * 3.0) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -4.5e-64: tmp = t_1 elif y <= 1.34e-17: tmp = t / ((z * 3.0) * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = Float64(t / Float64(Float64(z * 3.0) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = t / ((z * 3.0) * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e-64], t$95$1, If[LessEqual[y, 1.34e-17], N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.34 \cdot 10^{-17}:\\
\;\;\;\;\frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.5000000000000001e-64 or 1.34e-17 < y Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6464.0%
Applied rewrites64.0%
if -4.5000000000000001e-64 < y < 1.34e-17Initial program 96.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.5%
Applied rewrites35.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r/N/A
mult-flipN/A
lift-/.f6435.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6435.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6435.5%
Applied rewrites35.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6435.5%
Applied rewrites35.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- x (* 0.3333333333333333 (/ y z))))) (if (<= y -4.5e-64) t_1 (if (<= y 1.34e-17) (/ t (* (* 3.0 y) z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = t / ((3.0 * y) * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-4.5d-64)) then
tmp = t_1
else if (y <= 1.34d-17) then
tmp = t / ((3.0d0 * y) * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = t / ((3.0 * y) * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -4.5e-64: tmp = t_1 elif y <= 1.34e-17: tmp = t / ((3.0 * y) * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = Float64(t / Float64(Float64(3.0 * y) * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = t / ((3.0 * y) * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e-64], t$95$1, If[LessEqual[y, 1.34e-17], N[(t / N[(N[(3.0 * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.34 \cdot 10^{-17}:\\
\;\;\;\;\frac{t}{\left(3 \cdot y\right) \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.5000000000000001e-64 or 1.34e-17 < y Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6464.0%
Applied rewrites64.0%
if -4.5000000000000001e-64 < y < 1.34e-17Initial program 96.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.5%
Applied rewrites35.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r/N/A
mult-flipN/A
lift-/.f6435.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6435.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6435.5%
Applied rewrites35.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6435.5%
Applied rewrites35.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* 0.3333333333333333 (/ y z)))))
(if (<= y -4.5e-64)
t_1
(if (<= y 1.34e-17) (* 0.3333333333333333 (/ t (* y z))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-4.5d-64)) then
tmp = t_1
else if (y <= 1.34d-17) then
tmp = 0.3333333333333333d0 * (t / (y * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -4.5e-64) {
tmp = t_1;
} else if (y <= 1.34e-17) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -4.5e-64: tmp = t_1 elif y <= 1.34e-17: tmp = 0.3333333333333333 * (t / (y * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -4.5e-64) tmp = t_1; elseif (y <= 1.34e-17) tmp = 0.3333333333333333 * (t / (y * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e-64], t$95$1, If[LessEqual[y, 1.34e-17], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.34 \cdot 10^{-17}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.5000000000000001e-64 or 1.34e-17 < y Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6464.0%
Applied rewrites64.0%
if -4.5000000000000001e-64 < y < 1.34e-17Initial program 96.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.5%
Applied rewrites35.5%
(FPCore (x y z t) :precision binary64 (- x (* 0.3333333333333333 (/ y z))))
double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 * (y / 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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x - (0.3333333333333333d0 * (y / z))
end function
public static double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 * (y / z));
}
def code(x, y, z, t): return x - (0.3333333333333333 * (y / z))
function code(x, y, z, t) return Float64(x - Float64(0.3333333333333333 * Float64(y / z))) end
function tmp = code(x, y, z, t) tmp = x - (0.3333333333333333 * (y / z)); end
code[x_, y_, z_, t_] := N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - 0.3333333333333333 \cdot \frac{y}{z}
Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6464.0%
Applied rewrites64.0%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e+153) x (if (<= z 4.1e+71) (/ (/ y z) -3.0) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+153) {
tmp = x;
} else if (z <= 4.1e+71) {
tmp = (y / z) / -3.0;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.2d+153)) then
tmp = x
else if (z <= 4.1d+71) then
tmp = (y / z) / (-3.0d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+153) {
tmp = x;
} else if (z <= 4.1e+71) {
tmp = (y / z) / -3.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e+153: tmp = x elif z <= 4.1e+71: tmp = (y / z) / -3.0 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e+153) tmp = x; elseif (z <= 4.1e+71) tmp = Float64(Float64(y / z) / -3.0); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e+153) tmp = x; elseif (z <= 4.1e+71) tmp = (y / z) / -3.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e+153], x, If[LessEqual[z, 4.1e+71], N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision], x]]
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+153}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+71}:\\
\;\;\;\;\frac{\frac{y}{z}}{-3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
if z < -5.1999999999999998e153 or 4.1000000000000002e71 < z Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6467.4%
Applied rewrites67.4%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
associate-*r/N/A
mult-flip-revN/A
frac-2neg-revN/A
distribute-neg-fracN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f6467.4%
Applied rewrites67.4%
Taylor expanded in x around inf
Applied rewrites30.7%
if -5.1999999999999998e153 < z < 4.1000000000000002e71Initial program 96.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6460.5%
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
associate-/r*N/A
associate-/r*N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
metadata-eval35.3%
Applied rewrites35.3%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e+153) x (if (<= z 4.1e+71) (/ y (* -3.0 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+153) {
tmp = x;
} else if (z <= 4.1e+71) {
tmp = y / (-3.0 * z);
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.2d+153)) then
tmp = x
else if (z <= 4.1d+71) then
tmp = y / ((-3.0d0) * z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+153) {
tmp = x;
} else if (z <= 4.1e+71) {
tmp = y / (-3.0 * z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e+153: tmp = x elif z <= 4.1e+71: tmp = y / (-3.0 * z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e+153) tmp = x; elseif (z <= 4.1e+71) tmp = Float64(y / Float64(-3.0 * z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e+153) tmp = x; elseif (z <= 4.1e+71) tmp = y / (-3.0 * z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e+153], x, If[LessEqual[z, 4.1e+71], N[(y / N[(-3.0 * z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+153}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+71}:\\
\;\;\;\;\frac{y}{-3 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
if z < -5.1999999999999998e153 or 4.1000000000000002e71 < z Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6467.4%
Applied rewrites67.4%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
associate-*r/N/A
mult-flip-revN/A
frac-2neg-revN/A
distribute-neg-fracN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f6467.4%
Applied rewrites67.4%
Taylor expanded in x around inf
Applied rewrites30.7%
if -5.1999999999999998e153 < z < 4.1000000000000002e71Initial program 96.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6460.5%
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f6435.3%
Applied rewrites35.3%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
associate-/r*N/A
distribute-neg-frac2N/A
lower-/.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval35.3%
Applied rewrites35.3%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e+153) x (if (<= z 4.1e+71) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+153) {
tmp = x;
} else if (z <= 4.1e+71) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.2d+153)) then
tmp = x
else if (z <= 4.1d+71) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+153) {
tmp = x;
} else if (z <= 4.1e+71) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e+153: tmp = x elif z <= 4.1e+71: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e+153) tmp = x; elseif (z <= 4.1e+71) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e+153) tmp = x; elseif (z <= 4.1e+71) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e+153], x, If[LessEqual[z, 4.1e+71], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+153}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+71}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
if z < -5.1999999999999998e153 or 4.1000000000000002e71 < z Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6467.4%
Applied rewrites67.4%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
associate-*r/N/A
mult-flip-revN/A
frac-2neg-revN/A
distribute-neg-fracN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f6467.4%
Applied rewrites67.4%
Taylor expanded in x around inf
Applied rewrites30.7%
if -5.1999999999999998e153 < z < 4.1000000000000002e71Initial program 96.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6460.5%
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f6435.3%
Applied rewrites35.3%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
x
Initial program 96.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6467.4%
Applied rewrites67.4%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
associate-*r/N/A
mult-flip-revN/A
frac-2neg-revN/A
distribute-neg-fracN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f6467.4%
Applied rewrites67.4%
Taylor expanded in x around inf
Applied rewrites30.7%
herbie shell --seed 2025187
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))