
(FPCore (x y z t) :precision binary64 (- x (/ (log (+ (- 1 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
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 - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t): return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t) return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t)) end
function tmp = code(x, y, z, t) tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t); end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- x (/ (log (+ (- 1 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
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 - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t): return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t) return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t)) end
function tmp = code(x, y, z, t) tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t); end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
(FPCore (x y z t) :precision binary64 (if (<= z -22500000) (- x (/ 1 (+ (* 1/2 t) (/ t (* (- (exp z) 1) y))))) (- x (/ 1 (/ (/ (+ t (* z (- (* 1/2 (* t y)) (* 1/2 t)))) z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -22500000.0) {
tmp = x - (1.0 / ((0.5 * t) + (t / ((exp(z) - 1.0) * y))));
} else {
tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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 <= (-22500000.0d0)) then
tmp = x - (1.0d0 / ((0.5d0 * t) + (t / ((exp(z) - 1.0d0) * y))))
else
tmp = x - (1.0d0 / (((t + (z * ((0.5d0 * (t * y)) - (0.5d0 * t)))) / z) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -22500000.0) {
tmp = x - (1.0 / ((0.5 * t) + (t / ((Math.exp(z) - 1.0) * y))));
} else {
tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -22500000.0: tmp = x - (1.0 / ((0.5 * t) + (t / ((math.exp(z) - 1.0) * y)))) else: tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -22500000.0) tmp = Float64(x - Float64(1.0 / Float64(Float64(0.5 * t) + Float64(t / Float64(Float64(exp(z) - 1.0) * y))))); else tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(t + Float64(z * Float64(Float64(0.5 * Float64(t * y)) - Float64(0.5 * t)))) / z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -22500000.0) tmp = x - (1.0 / ((0.5 * t) + (t / ((exp(z) - 1.0) * y)))); else tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -22500000], N[(x - N[(1 / N[(N[(1/2 * t), $MachinePrecision] + N[(t / N[(N[(N[Exp[z], $MachinePrecision] - 1), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(1 / N[(N[(N[(t + N[(z * N[(N[(1/2 * N[(t * y), $MachinePrecision]), $MachinePrecision] - N[(1/2 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -22500000:\\
\;\;\;\;x - \frac{1}{\frac{1}{2} \cdot t + \frac{t}{\left(e^{z} - 1\right) \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}}\\
\end{array}
if z < -2.25e7Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6473.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-*.f64N/A
lift-/.f64N/A
associate-/l/N/A
*-commutativeN/A
lift--.f64N/A
lift-exp.f64N/A
lower-/.f64N/A
lift-exp.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6478.9%
Applied rewrites78.9%
if -2.25e7 < z Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6473.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6484.9%
Applied rewrites84.9%
(FPCore (x y z t) :precision binary64 (if (<= z -410000000) (- x (/ (* y (- (exp z) 1)) t)) (- x (/ 1 (/ (/ (+ t (* z (- (* 1/2 (* t y)) (* 1/2 t)))) z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -410000000.0) {
tmp = x - ((y * (exp(z) - 1.0)) / t);
} else {
tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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 <= (-410000000.0d0)) then
tmp = x - ((y * (exp(z) - 1.0d0)) / t)
else
tmp = x - (1.0d0 / (((t + (z * ((0.5d0 * (t * y)) - (0.5d0 * t)))) / z) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -410000000.0) {
tmp = x - ((y * (Math.exp(z) - 1.0)) / t);
} else {
tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -410000000.0: tmp = x - ((y * (math.exp(z) - 1.0)) / t) else: tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -410000000.0) tmp = Float64(x - Float64(Float64(y * Float64(exp(z) - 1.0)) / t)); else tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(t + Float64(z * Float64(Float64(0.5 * Float64(t * y)) - Float64(0.5 * t)))) / z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -410000000.0) tmp = x - ((y * (exp(z) - 1.0)) / t); else tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -410000000], N[(x - N[(N[(y * N[(N[Exp[z], $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x - N[(1 / N[(N[(N[(t + N[(z * N[(N[(1/2 * N[(t * y), $MachinePrecision]), $MachinePrecision] - N[(1/2 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -410000000:\\
\;\;\;\;x - \frac{y \cdot \left(e^{z} - 1\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}}\\
\end{array}
if z < -4.1e8Initial program 60.6%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
if -4.1e8 < z Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6473.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6484.9%
Applied rewrites84.9%
(FPCore (x y z t) :precision binary64 (if (<= z -410000000) (- x (* (/ (- (exp z) 1) t) y)) (- x (/ 1 (/ (/ (+ t (* z (- (* 1/2 (* t y)) (* 1/2 t)))) z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -410000000.0) {
tmp = x - (((exp(z) - 1.0) / t) * y);
} else {
tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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 <= (-410000000.0d0)) then
tmp = x - (((exp(z) - 1.0d0) / t) * y)
else
tmp = x - (1.0d0 / (((t + (z * ((0.5d0 * (t * y)) - (0.5d0 * t)))) / z) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -410000000.0) {
tmp = x - (((Math.exp(z) - 1.0) / t) * y);
} else {
tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -410000000.0: tmp = x - (((math.exp(z) - 1.0) / t) * y) else: tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -410000000.0) tmp = Float64(x - Float64(Float64(Float64(exp(z) - 1.0) / t) * y)); else tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(t + Float64(z * Float64(Float64(0.5 * Float64(t * y)) - Float64(0.5 * t)))) / z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -410000000.0) tmp = x - (((exp(z) - 1.0) / t) * y); else tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -410000000], N[(x - N[(N[(N[(N[Exp[z], $MachinePrecision] - 1), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(1 / N[(N[(N[(t + N[(z * N[(N[(1/2 * N[(t * y), $MachinePrecision]), $MachinePrecision] - N[(1/2 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -410000000:\\
\;\;\;\;x - \frac{e^{z} - 1}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}}\\
\end{array}
if z < -4.1e8Initial program 60.6%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-exp.f6475.8%
Applied rewrites75.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
lower-/.f6475.9%
Applied rewrites75.9%
if -4.1e8 < z Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6473.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6484.9%
Applied rewrites84.9%
(FPCore (x y z t) :precision binary64 (- x (/ 1 (/ (/ (+ t (* z (- (* 1/2 (* t y)) (* 1/2 t)))) z) y))))
double code(double x, double y, double z, double t) {
return x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / 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 - (1.0d0 / (((t + (z * ((0.5d0 * (t * y)) - (0.5d0 * t)))) / z) / y))
end function
public static double code(double x, double y, double z, double t) {
return x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y));
}
def code(x, y, z, t): return x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y))
function code(x, y, z, t) return Float64(x - Float64(1.0 / Float64(Float64(Float64(t + Float64(z * Float64(Float64(0.5 * Float64(t * y)) - Float64(0.5 * t)))) / z) / y))) end
function tmp = code(x, y, z, t) tmp = x - (1.0 / (((t + (z * ((0.5 * (t * y)) - (0.5 * t)))) / z) / y)); end
code[x_, y_, z_, t_] := N[(x - N[(1 / N[(N[(N[(t + N[(z * N[(N[(1/2 * N[(t * y), $MachinePrecision]), $MachinePrecision] - N[(1/2 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}}
Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6473.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6484.9%
Applied rewrites84.9%
(FPCore (x y z t)
:precision binary64
(if (<=
z
-130000000000000005723571947544438292554521954144678769275685764875122985731145995914860441978030839927144448)
(* 1 x)
(if (<=
z
-5791434876257087/5515652263101987298728728207430913795608113109085112352897269396216198887424215820128660001943808587833784893551335930816647064191168732319583111500951066614122648616177179922993422016587311577585463592732098692120576)
(- x (/ 1 (/ (+ (* 1/2 (* t y)) (/ t z)) y)))
(-
x
(/ (* y (* z (+ 1 (* z (+ 1/2 (* z (+ 1/6 (* 1/24 z)))))))) t)))))double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e+107) {
tmp = 1.0 * x;
} else if (z <= -1.05e-201) {
tmp = x - (1.0 / (((0.5 * (t * y)) + (t / z)) / y));
} else {
tmp = x - ((y * (z * (1.0 + (z * (0.5 + (z * (0.16666666666666666 + (0.041666666666666664 * z)))))))) / t);
}
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 <= (-1.3d+107)) then
tmp = 1.0d0 * x
else if (z <= (-1.05d-201)) then
tmp = x - (1.0d0 / (((0.5d0 * (t * y)) + (t / z)) / y))
else
tmp = x - ((y * (z * (1.0d0 + (z * (0.5d0 + (z * (0.16666666666666666d0 + (0.041666666666666664d0 * z)))))))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e+107) {
tmp = 1.0 * x;
} else if (z <= -1.05e-201) {
tmp = x - (1.0 / (((0.5 * (t * y)) + (t / z)) / y));
} else {
tmp = x - ((y * (z * (1.0 + (z * (0.5 + (z * (0.16666666666666666 + (0.041666666666666664 * z)))))))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.3e+107: tmp = 1.0 * x elif z <= -1.05e-201: tmp = x - (1.0 / (((0.5 * (t * y)) + (t / z)) / y)) else: tmp = x - ((y * (z * (1.0 + (z * (0.5 + (z * (0.16666666666666666 + (0.041666666666666664 * z)))))))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.3e+107) tmp = Float64(1.0 * x); elseif (z <= -1.05e-201) tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(0.5 * Float64(t * y)) + Float64(t / z)) / y))); else tmp = Float64(x - Float64(Float64(y * Float64(z * Float64(1.0 + Float64(z * Float64(0.5 + Float64(z * Float64(0.16666666666666666 + Float64(0.041666666666666664 * z)))))))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.3e+107) tmp = 1.0 * x; elseif (z <= -1.05e-201) tmp = x - (1.0 / (((0.5 * (t * y)) + (t / z)) / y)); else tmp = x - ((y * (z * (1.0 + (z * (0.5 + (z * (0.16666666666666666 + (0.041666666666666664 * z)))))))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -130000000000000005723571947544438292554521954144678769275685764875122985731145995914860441978030839927144448], N[(1 * x), $MachinePrecision], If[LessEqual[z, -5791434876257087/5515652263101987298728728207430913795608113109085112352897269396216198887424215820128660001943808587833784893551335930816647064191168732319583111500951066614122648616177179922993422016587311577585463592732098692120576], N[(x - N[(1 / N[(N[(N[(1/2 * N[(t * y), $MachinePrecision]), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(z * N[(1 + N[(z * N[(1/2 + N[(z * N[(1/6 + N[(1/24 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -130000000000000005723571947544438292554521954144678769275685764875122985731145995914860441978030839927144448:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq \frac{-5791434876257087}{5515652263101987298728728207430913795608113109085112352897269396216198887424215820128660001943808587833784893551335930816647064191168732319583111500951066614122648616177179922993422016587311577585463592732098692120576}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{z}}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(z \cdot \left(1 + z \cdot \left(\frac{1}{2} + z \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot z\right)\right)\right)\right)}{t}\\
\end{array}
if z < -1.3000000000000001e107Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6471.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.6%
Applied rewrites71.6%
Taylor expanded in x around inf
Applied rewrites71.9%
if -1.3000000000000001e107 < z < -1.0500000000000001e-201Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6473.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-/.f6479.2%
Applied rewrites79.2%
if -1.0500000000000001e-201 < z Initial program 60.6%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6465.1%
Applied rewrites65.1%
(FPCore (x y z t)
:precision binary64
(if (<=
z
-130000000000000005723571947544438292554521954144678769275685764875122985731145995914860441978030839927144448)
(* 1 x)
(if (<=
z
-5791434876257087/5515652263101987298728728207430913795608113109085112352897269396216198887424215820128660001943808587833784893551335930816647064191168732319583111500951066614122648616177179922993422016587311577585463592732098692120576)
(- x (/ 1 (/ (+ (* 1/2 (* t y)) (/ t z)) y)))
(-
x
(/
(*
z
(+ y (* z (+ (* 1/2 y) (* z (+ (* 1/24 (* y z)) (* 1/6 y)))))))
t)))))double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e+107) {
tmp = 1.0 * x;
} else if (z <= -1.05e-201) {
tmp = x - (1.0 / (((0.5 * (t * y)) + (t / z)) / y));
} else {
tmp = x - ((z * (y + (z * ((0.5 * y) + (z * ((0.041666666666666664 * (y * z)) + (0.16666666666666666 * y))))))) / t);
}
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 <= (-1.3d+107)) then
tmp = 1.0d0 * x
else if (z <= (-1.05d-201)) then
tmp = x - (1.0d0 / (((0.5d0 * (t * y)) + (t / z)) / y))
else
tmp = x - ((z * (y + (z * ((0.5d0 * y) + (z * ((0.041666666666666664d0 * (y * z)) + (0.16666666666666666d0 * y))))))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e+107) {
tmp = 1.0 * x;
} else if (z <= -1.05e-201) {
tmp = x - (1.0 / (((0.5 * (t * y)) + (t / z)) / y));
} else {
tmp = x - ((z * (y + (z * ((0.5 * y) + (z * ((0.041666666666666664 * (y * z)) + (0.16666666666666666 * y))))))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.3e+107: tmp = 1.0 * x elif z <= -1.05e-201: tmp = x - (1.0 / (((0.5 * (t * y)) + (t / z)) / y)) else: tmp = x - ((z * (y + (z * ((0.5 * y) + (z * ((0.041666666666666664 * (y * z)) + (0.16666666666666666 * y))))))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.3e+107) tmp = Float64(1.0 * x); elseif (z <= -1.05e-201) tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(0.5 * Float64(t * y)) + Float64(t / z)) / y))); else tmp = Float64(x - Float64(Float64(z * Float64(y + Float64(z * Float64(Float64(0.5 * y) + Float64(z * Float64(Float64(0.041666666666666664 * Float64(y * z)) + Float64(0.16666666666666666 * y))))))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.3e+107) tmp = 1.0 * x; elseif (z <= -1.05e-201) tmp = x - (1.0 / (((0.5 * (t * y)) + (t / z)) / y)); else tmp = x - ((z * (y + (z * ((0.5 * y) + (z * ((0.041666666666666664 * (y * z)) + (0.16666666666666666 * y))))))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -130000000000000005723571947544438292554521954144678769275685764875122985731145995914860441978030839927144448], N[(1 * x), $MachinePrecision], If[LessEqual[z, -5791434876257087/5515652263101987298728728207430913795608113109085112352897269396216198887424215820128660001943808587833784893551335930816647064191168732319583111500951066614122648616177179922993422016587311577585463592732098692120576], N[(x - N[(1 / N[(N[(N[(1/2 * N[(t * y), $MachinePrecision]), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * N[(y + N[(z * N[(N[(1/2 * y), $MachinePrecision] + N[(z * N[(N[(1/24 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(1/6 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -130000000000000005723571947544438292554521954144678769275685764875122985731145995914860441978030839927144448:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq \frac{-5791434876257087}{5515652263101987298728728207430913795608113109085112352897269396216198887424215820128660001943808587833784893551335930816647064191168732319583111500951066614122648616177179922993422016587311577585463592732098692120576}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{z}}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot \left(y + z \cdot \left(\frac{1}{2} \cdot y + z \cdot \left(\frac{1}{24} \cdot \left(y \cdot z\right) + \frac{1}{6} \cdot y\right)\right)\right)}{t}\\
\end{array}
if z < -1.3000000000000001e107Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6471.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.6%
Applied rewrites71.6%
Taylor expanded in x around inf
Applied rewrites71.9%
if -1.3000000000000001e107 < z < -1.0500000000000001e-201Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6473.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.1%
Applied rewrites73.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-/.f6479.2%
Applied rewrites79.2%
if -1.0500000000000001e-201 < z Initial program 60.6%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6465.8%
Applied rewrites65.8%
(FPCore (x y z t) :precision binary64 (if (<= z -6860092517126119/21778071482940061661655974875633165533184) (* 1 x) (- x (/ (* y (* z (+ 1 (* z (+ 1/2 (* z (+ 1/6 (* 1/24 z)))))))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((y * (z * (1.0 + (z * (0.5 + (z * (0.16666666666666666 + (0.041666666666666664 * z)))))))) / t);
}
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-25)) then
tmp = 1.0d0 * x
else
tmp = x - ((y * (z * (1.0d0 + (z * (0.5d0 + (z * (0.16666666666666666d0 + (0.041666666666666664d0 * z)))))))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((y * (z * (1.0 + (z * (0.5 + (z * (0.16666666666666666 + (0.041666666666666664 * z)))))))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.15e-25: tmp = 1.0 * x else: tmp = x - ((y * (z * (1.0 + (z * (0.5 + (z * (0.16666666666666666 + (0.041666666666666664 * z)))))))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.15e-25) tmp = Float64(1.0 * x); else tmp = Float64(x - Float64(Float64(y * Float64(z * Float64(1.0 + Float64(z * Float64(0.5 + Float64(z * Float64(0.16666666666666666 + Float64(0.041666666666666664 * z)))))))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.15e-25) tmp = 1.0 * x; else tmp = x - ((y * (z * (1.0 + (z * (0.5 + (z * (0.16666666666666666 + (0.041666666666666664 * z)))))))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6860092517126119/21778071482940061661655974875633165533184], N[(1 * x), $MachinePrecision], N[(x - N[(N[(y * N[(z * N[(1 + N[(z * N[(1/2 + N[(z * N[(1/6 + N[(1/24 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-6860092517126119}{21778071482940061661655974875633165533184}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(z \cdot \left(1 + z \cdot \left(\frac{1}{2} + z \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot z\right)\right)\right)\right)}{t}\\
\end{array}
if z < -3.1499999999999998e-25Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6471.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.6%
Applied rewrites71.6%
Taylor expanded in x around inf
Applied rewrites71.9%
if -3.1499999999999998e-25 < z Initial program 60.6%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6465.1%
Applied rewrites65.1%
(FPCore (x y z t) :precision binary64 (if (<= z -6860092517126119/21778071482940061661655974875633165533184) (* 1 x) (- x (/ (* y (* z (+ 1 (* z (+ 1/2 (* 1/6 z)))))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((y * (z * (1.0 + (z * (0.5 + (0.16666666666666666 * z)))))) / t);
}
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-25)) then
tmp = 1.0d0 * x
else
tmp = x - ((y * (z * (1.0d0 + (z * (0.5d0 + (0.16666666666666666d0 * z)))))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((y * (z * (1.0 + (z * (0.5 + (0.16666666666666666 * z)))))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.15e-25: tmp = 1.0 * x else: tmp = x - ((y * (z * (1.0 + (z * (0.5 + (0.16666666666666666 * z)))))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.15e-25) tmp = Float64(1.0 * x); else tmp = Float64(x - Float64(Float64(y * Float64(z * Float64(1.0 + Float64(z * Float64(0.5 + Float64(0.16666666666666666 * z)))))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.15e-25) tmp = 1.0 * x; else tmp = x - ((y * (z * (1.0 + (z * (0.5 + (0.16666666666666666 * z)))))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6860092517126119/21778071482940061661655974875633165533184], N[(1 * x), $MachinePrecision], N[(x - N[(N[(y * N[(z * N[(1 + N[(z * N[(1/2 + N[(1/6 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-6860092517126119}{21778071482940061661655974875633165533184}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(z \cdot \left(1 + z \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot z\right)\right)\right)}{t}\\
\end{array}
if z < -3.1499999999999998e-25Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6471.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.6%
Applied rewrites71.6%
Taylor expanded in x around inf
Applied rewrites71.9%
if -3.1499999999999998e-25 < z Initial program 60.6%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6466.6%
Applied rewrites66.6%
(FPCore (x y z t) :precision binary64 (if (<= z -6860092517126119/21778071482940061661655974875633165533184) (* 1 x) (- x (/ (* z (* y (+ 1 (* 1/2 z)))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((z * (y * (1.0 + (0.5 * z)))) / t);
}
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-25)) then
tmp = 1.0d0 * x
else
tmp = x - ((z * (y * (1.0d0 + (0.5d0 * z)))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((z * (y * (1.0 + (0.5 * z)))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.15e-25: tmp = 1.0 * x else: tmp = x - ((z * (y * (1.0 + (0.5 * z)))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.15e-25) tmp = Float64(1.0 * x); else tmp = Float64(x - Float64(Float64(z * Float64(y * Float64(1.0 + Float64(0.5 * z)))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.15e-25) tmp = 1.0 * x; else tmp = x - ((z * (y * (1.0 + (0.5 * z)))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6860092517126119/21778071482940061661655974875633165533184], N[(1 * x), $MachinePrecision], N[(x - N[(N[(z * N[(y * N[(1 + N[(1/2 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-6860092517126119}{21778071482940061661655974875633165533184}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot \left(y \cdot \left(1 + \frac{1}{2} \cdot z\right)\right)}{t}\\
\end{array}
if z < -3.1499999999999998e-25Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6471.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.6%
Applied rewrites71.6%
Taylor expanded in x around inf
Applied rewrites71.9%
if -3.1499999999999998e-25 < z Initial program 60.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6460.6%
Applied rewrites60.6%
Taylor expanded in y around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6468.9%
Applied rewrites68.9%
(FPCore (x y z t) :precision binary64 (if (<= z -6860092517126119/21778071482940061661655974875633165533184) (* 1 x) (- x (* (/ 1 t) (* z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((1.0 / t) * (z * y));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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-25)) then
tmp = 1.0d0 * x
else
tmp = x - ((1.0d0 / t) * (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((1.0 / t) * (z * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.15e-25: tmp = 1.0 * x else: tmp = x - ((1.0 / t) * (z * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.15e-25) tmp = Float64(1.0 * x); else tmp = Float64(x - Float64(Float64(1.0 / t) * Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.15e-25) tmp = 1.0 * x; else tmp = x - ((1.0 / t) * (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6860092517126119/21778071482940061661655974875633165533184], N[(1 * x), $MachinePrecision], N[(x - N[(N[(1 / t), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-6860092517126119}{21778071482940061661655974875633165533184}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{t} \cdot \left(z \cdot y\right)\\
\end{array}
if z < -3.1499999999999998e-25Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6471.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.6%
Applied rewrites71.6%
Taylor expanded in x around inf
Applied rewrites71.9%
if -3.1499999999999998e-25 < z Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6473.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.1%
Applied rewrites73.1%
(FPCore (x y z t) :precision binary64 (if (<= z -6860092517126119/21778071482940061661655974875633165533184) (* 1 x) (- x (/ (* y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((y * z) / t);
}
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-25)) then
tmp = 1.0d0 * x
else
tmp = x - ((y * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.15e-25: tmp = 1.0 * x else: tmp = x - ((y * z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.15e-25) tmp = Float64(1.0 * x); else tmp = Float64(x - Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.15e-25) tmp = 1.0 * x; else tmp = x - ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6860092517126119/21778071482940061661655974875633165533184], N[(1 * x), $MachinePrecision], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-6860092517126119}{21778071482940061661655974875633165533184}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\end{array}
if z < -3.1499999999999998e-25Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6471.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.6%
Applied rewrites71.6%
Taylor expanded in x around inf
Applied rewrites71.9%
if -3.1499999999999998e-25 < z Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
(FPCore (x y z t) :precision binary64 (if (<= z -6860092517126119/21778071482940061661655974875633165533184) (* 1 x) (- x (* (/ z t) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((z / t) * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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-25)) then
tmp = 1.0d0 * x
else
tmp = x - ((z / t) * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.15e-25) {
tmp = 1.0 * x;
} else {
tmp = x - ((z / t) * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.15e-25: tmp = 1.0 * x else: tmp = x - ((z / t) * y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.15e-25) tmp = Float64(1.0 * x); else tmp = Float64(x - Float64(Float64(z / t) * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.15e-25) tmp = 1.0 * x; else tmp = x - ((z / t) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6860092517126119/21778071482940061661655974875633165533184], N[(1 * x), $MachinePrecision], N[(x - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq \frac{-6860092517126119}{21778071482940061661655974875633165533184}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z}{t} \cdot y\\
\end{array}
if z < -3.1499999999999998e-25Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6471.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.6%
Applied rewrites71.6%
Taylor expanded in x around inf
Applied rewrites71.9%
if -3.1499999999999998e-25 < z Initial program 60.6%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-exp.f6475.8%
Applied rewrites75.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
lower-/.f6475.9%
Applied rewrites75.9%
Taylor expanded in z around 0
lower-/.f6473.7%
Applied rewrites73.7%
(FPCore (x y z t) :precision binary64 (* 1 x))
double code(double x, double y, double z, double t) {
return 1.0 * x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t) {
return 1.0 * x;
}
def code(x, y, z, t): return 1.0 * x
function code(x, y, z, t) return Float64(1.0 * x) end
function tmp = code(x, y, z, t) tmp = 1.0 * x; end
code[x_, y_, z_, t_] := N[(1 * x), $MachinePrecision]
1 \cdot x
Initial program 60.6%
Taylor expanded in z around 0
lower-*.f6473.1%
Applied rewrites73.1%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6471.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.6%
Applied rewrites71.6%
Taylor expanded in x around inf
Applied rewrites71.9%
herbie shell --seed 2025285 -o generate:evaluate
(FPCore (x y z t)
:name "System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2"
:precision binary64
(- x (/ (log (+ (- 1 y) (* y (exp z)))) t)))