
(FPCore (z0 z1) :precision binary64 (- z0 (* (- z0 1.0) (exp (/ -2.0 z1)))))
double code(double z0, double z1) {
return z0 - ((z0 - 1.0) * exp((-2.0 / z1)));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
code = z0 - ((z0 - 1.0d0) * exp(((-2.0d0) / z1)))
end function
public static double code(double z0, double z1) {
return z0 - ((z0 - 1.0) * Math.exp((-2.0 / z1)));
}
def code(z0, z1): return z0 - ((z0 - 1.0) * math.exp((-2.0 / z1)))
function code(z0, z1) return Float64(z0 - Float64(Float64(z0 - 1.0) * exp(Float64(-2.0 / z1)))) end
function tmp = code(z0, z1) tmp = z0 - ((z0 - 1.0) * exp((-2.0 / z1))); end
code[z0_, z1_] := N[(z0 - N[(N[(z0 - 1.0), $MachinePrecision] * N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
z0 - \left(z0 - 1\right) \cdot e^{\frac{-2}{z1}}
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (z0 z1) :precision binary64 (- z0 (* (- z0 1.0) (exp (/ -2.0 z1)))))
double code(double z0, double z1) {
return z0 - ((z0 - 1.0) * exp((-2.0 / z1)));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
code = z0 - ((z0 - 1.0d0) * exp(((-2.0d0) / z1)))
end function
public static double code(double z0, double z1) {
return z0 - ((z0 - 1.0) * Math.exp((-2.0 / z1)));
}
def code(z0, z1): return z0 - ((z0 - 1.0) * math.exp((-2.0 / z1)))
function code(z0, z1) return Float64(z0 - Float64(Float64(z0 - 1.0) * exp(Float64(-2.0 / z1)))) end
function tmp = code(z0, z1) tmp = z0 - ((z0 - 1.0) * exp((-2.0 / z1))); end
code[z0_, z1_] := N[(z0 - N[(N[(z0 - 1.0), $MachinePrecision] * N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
z0 - \left(z0 - 1\right) \cdot e^{\frac{-2}{z1}}
(FPCore (z0 z1)
:precision binary64
(let* ((t_0
(+
1.0
(*
-1.0
(/
(-
(/ (* z0 (- 2.0 (* 1.3333333333333333 (/ 1.0 z1)))) z1)
(* 2.0 (- z0 1.0)))
z1)))))
(if (<= z1 -13500.0)
t_0
(if (<= z1 15000000.0)
(- z0 (* (- z0 1.0) (pow 7.38905609893065 (/ -1.0 z1))))
t_0))))double code(double z0, double z1) {
double t_0 = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1));
double tmp;
if (z1 <= -13500.0) {
tmp = t_0;
} else if (z1 <= 15000000.0) {
tmp = z0 - ((z0 - 1.0) * pow(7.38905609893065, (-1.0 / z1)));
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + ((-1.0d0) * ((((z0 * (2.0d0 - (1.3333333333333333d0 * (1.0d0 / z1)))) / z1) - (2.0d0 * (z0 - 1.0d0))) / z1))
if (z1 <= (-13500.0d0)) then
tmp = t_0
else if (z1 <= 15000000.0d0) then
tmp = z0 - ((z0 - 1.0d0) * (7.38905609893065d0 ** ((-1.0d0) / z1)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1));
double tmp;
if (z1 <= -13500.0) {
tmp = t_0;
} else if (z1 <= 15000000.0) {
tmp = z0 - ((z0 - 1.0) * Math.pow(7.38905609893065, (-1.0 / z1)));
} else {
tmp = t_0;
}
return tmp;
}
def code(z0, z1): t_0 = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1)) tmp = 0 if z1 <= -13500.0: tmp = t_0 elif z1 <= 15000000.0: tmp = z0 - ((z0 - 1.0) * math.pow(7.38905609893065, (-1.0 / z1))) else: tmp = t_0 return tmp
function code(z0, z1) t_0 = Float64(1.0 + Float64(-1.0 * Float64(Float64(Float64(Float64(z0 * Float64(2.0 - Float64(1.3333333333333333 * Float64(1.0 / z1)))) / z1) - Float64(2.0 * Float64(z0 - 1.0))) / z1))) tmp = 0.0 if (z1 <= -13500.0) tmp = t_0; elseif (z1 <= 15000000.0) tmp = Float64(z0 - Float64(Float64(z0 - 1.0) * (7.38905609893065 ^ Float64(-1.0 / z1)))); else tmp = t_0; end return tmp end
function tmp_2 = code(z0, z1) t_0 = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1)); tmp = 0.0; if (z1 <= -13500.0) tmp = t_0; elseif (z1 <= 15000000.0) tmp = z0 - ((z0 - 1.0) * (7.38905609893065 ^ (-1.0 / z1))); else tmp = t_0; end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(1.0 + N[(-1.0 * N[(N[(N[(N[(z0 * N[(2.0 - N[(1.3333333333333333 * N[(1.0 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision] - N[(2.0 * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z1, -13500.0], t$95$0, If[LessEqual[z1, 15000000.0], N[(z0 - N[(N[(z0 - 1.0), $MachinePrecision] * N[Power[7.38905609893065, N[(-1.0 / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := 1 + -1 \cdot \frac{\frac{z0 \cdot \left(2 - 1.3333333333333333 \cdot \frac{1}{z1}\right)}{z1} - 2 \cdot \left(z0 - 1\right)}{z1}\\
\mathbf{if}\;z1 \leq -13500:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z1 \leq 15000000:\\
\;\;\;\;z0 - \left(z0 - 1\right) \cdot {7.38905609893065}^{\left(\frac{-1}{z1}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z1 < -13500 or 1.5e7 < z1 Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
Taylor expanded in z0 around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6465.2%
Applied rewrites65.2%
if -13500 < z1 < 1.5e7Initial program 76.8%
lift-exp.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
metadata-evalN/A
frac-2negN/A
remove-double-negN/A
lower-/.f64N/A
metadata-eval76.8%
Applied rewrites76.8%
Evaluated real constant76.8%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0
(+
1.0
(*
-1.0
(/
(-
(/ (* z0 (- 2.0 (* 1.3333333333333333 (/ 1.0 z1)))) z1)
(* 2.0 (- z0 1.0)))
z1)))))
(if (<= z1 -13500.0)
t_0
(if (<= z1 15000000.0)
(- z0 (* (- z0 1.0) (exp (/ -2.0 z1))))
t_0))))double code(double z0, double z1) {
double t_0 = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1));
double tmp;
if (z1 <= -13500.0) {
tmp = t_0;
} else if (z1 <= 15000000.0) {
tmp = z0 - ((z0 - 1.0) * exp((-2.0 / z1)));
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + ((-1.0d0) * ((((z0 * (2.0d0 - (1.3333333333333333d0 * (1.0d0 / z1)))) / z1) - (2.0d0 * (z0 - 1.0d0))) / z1))
if (z1 <= (-13500.0d0)) then
tmp = t_0
else if (z1 <= 15000000.0d0) then
tmp = z0 - ((z0 - 1.0d0) * exp(((-2.0d0) / z1)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1));
double tmp;
if (z1 <= -13500.0) {
tmp = t_0;
} else if (z1 <= 15000000.0) {
tmp = z0 - ((z0 - 1.0) * Math.exp((-2.0 / z1)));
} else {
tmp = t_0;
}
return tmp;
}
def code(z0, z1): t_0 = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1)) tmp = 0 if z1 <= -13500.0: tmp = t_0 elif z1 <= 15000000.0: tmp = z0 - ((z0 - 1.0) * math.exp((-2.0 / z1))) else: tmp = t_0 return tmp
function code(z0, z1) t_0 = Float64(1.0 + Float64(-1.0 * Float64(Float64(Float64(Float64(z0 * Float64(2.0 - Float64(1.3333333333333333 * Float64(1.0 / z1)))) / z1) - Float64(2.0 * Float64(z0 - 1.0))) / z1))) tmp = 0.0 if (z1 <= -13500.0) tmp = t_0; elseif (z1 <= 15000000.0) tmp = Float64(z0 - Float64(Float64(z0 - 1.0) * exp(Float64(-2.0 / z1)))); else tmp = t_0; end return tmp end
function tmp_2 = code(z0, z1) t_0 = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1)); tmp = 0.0; if (z1 <= -13500.0) tmp = t_0; elseif (z1 <= 15000000.0) tmp = z0 - ((z0 - 1.0) * exp((-2.0 / z1))); else tmp = t_0; end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(1.0 + N[(-1.0 * N[(N[(N[(N[(z0 * N[(2.0 - N[(1.3333333333333333 * N[(1.0 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision] - N[(2.0 * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z1, -13500.0], t$95$0, If[LessEqual[z1, 15000000.0], N[(z0 - N[(N[(z0 - 1.0), $MachinePrecision] * N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := 1 + -1 \cdot \frac{\frac{z0 \cdot \left(2 - 1.3333333333333333 \cdot \frac{1}{z1}\right)}{z1} - 2 \cdot \left(z0 - 1\right)}{z1}\\
\mathbf{if}\;z1 \leq -13500:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z1 \leq 15000000:\\
\;\;\;\;z0 - \left(z0 - 1\right) \cdot e^{\frac{-2}{z1}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z1 < -13500 or 1.5e7 < z1 Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
Taylor expanded in z0 around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6465.2%
Applied rewrites65.2%
if -13500 < z1 < 1.5e7Initial program 76.8%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0 (* z0 (- 1.0 (exp (/ -2.0 z1)))))
(t_1 (* 2.0 (- z0 1.0))))
(if (<= (/ -2.0 z1) -0.02)
t_0
(if (<= (/ -2.0 z1) 0.0002)
(+
1.0
(*
-1.0
(/
(-
(*
-1.0
(/ (- (* 1.3333333333333333 (/ (- z0 1.0) z1)) t_1) z1))
t_1)
z1)))
(if (<= (/ -2.0 z1) 2e+62)
t_0
(-
z0
(*
(- z0 1.0)
(-
(- (* (+ z1 z1) (/ z1 (* (* (* z1 z1) z1) z1))) (/ 2.0 z1))
-1.0))))))))double code(double z0, double z1) {
double t_0 = z0 * (1.0 - exp((-2.0 / z1)));
double t_1 = 2.0 * (z0 - 1.0);
double tmp;
if ((-2.0 / z1) <= -0.02) {
tmp = t_0;
} else if ((-2.0 / z1) <= 0.0002) {
tmp = 1.0 + (-1.0 * (((-1.0 * (((1.3333333333333333 * ((z0 - 1.0) / z1)) - t_1) / z1)) - t_1) / z1));
} else if ((-2.0 / z1) <= 2e+62) {
tmp = t_0;
} else {
tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z0 * (1.0d0 - exp(((-2.0d0) / z1)))
t_1 = 2.0d0 * (z0 - 1.0d0)
if (((-2.0d0) / z1) <= (-0.02d0)) then
tmp = t_0
else if (((-2.0d0) / z1) <= 0.0002d0) then
tmp = 1.0d0 + ((-1.0d0) * ((((-1.0d0) * (((1.3333333333333333d0 * ((z0 - 1.0d0) / z1)) - t_1) / z1)) - t_1) / z1))
else if (((-2.0d0) / z1) <= 2d+62) then
tmp = t_0
else
tmp = z0 - ((z0 - 1.0d0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0d0 / z1)) - (-1.0d0)))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = z0 * (1.0 - Math.exp((-2.0 / z1)));
double t_1 = 2.0 * (z0 - 1.0);
double tmp;
if ((-2.0 / z1) <= -0.02) {
tmp = t_0;
} else if ((-2.0 / z1) <= 0.0002) {
tmp = 1.0 + (-1.0 * (((-1.0 * (((1.3333333333333333 * ((z0 - 1.0) / z1)) - t_1) / z1)) - t_1) / z1));
} else if ((-2.0 / z1) <= 2e+62) {
tmp = t_0;
} else {
tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0));
}
return tmp;
}
def code(z0, z1): t_0 = z0 * (1.0 - math.exp((-2.0 / z1))) t_1 = 2.0 * (z0 - 1.0) tmp = 0 if (-2.0 / z1) <= -0.02: tmp = t_0 elif (-2.0 / z1) <= 0.0002: tmp = 1.0 + (-1.0 * (((-1.0 * (((1.3333333333333333 * ((z0 - 1.0) / z1)) - t_1) / z1)) - t_1) / z1)) elif (-2.0 / z1) <= 2e+62: tmp = t_0 else: tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0)) return tmp
function code(z0, z1) t_0 = Float64(z0 * Float64(1.0 - exp(Float64(-2.0 / z1)))) t_1 = Float64(2.0 * Float64(z0 - 1.0)) tmp = 0.0 if (Float64(-2.0 / z1) <= -0.02) tmp = t_0; elseif (Float64(-2.0 / z1) <= 0.0002) tmp = Float64(1.0 + Float64(-1.0 * Float64(Float64(Float64(-1.0 * Float64(Float64(Float64(1.3333333333333333 * Float64(Float64(z0 - 1.0) / z1)) - t_1) / z1)) - t_1) / z1))); elseif (Float64(-2.0 / z1) <= 2e+62) tmp = t_0; else tmp = Float64(z0 - Float64(Float64(z0 - 1.0) * Float64(Float64(Float64(Float64(z1 + z1) * Float64(z1 / Float64(Float64(Float64(z1 * z1) * z1) * z1))) - Float64(2.0 / z1)) - -1.0))); end return tmp end
function tmp_2 = code(z0, z1) t_0 = z0 * (1.0 - exp((-2.0 / z1))); t_1 = 2.0 * (z0 - 1.0); tmp = 0.0; if ((-2.0 / z1) <= -0.02) tmp = t_0; elseif ((-2.0 / z1) <= 0.0002) tmp = 1.0 + (-1.0 * (((-1.0 * (((1.3333333333333333 * ((z0 - 1.0) / z1)) - t_1) / z1)) - t_1) / z1)); elseif ((-2.0 / z1) <= 2e+62) tmp = t_0; else tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0)); end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(z0 * N[(1.0 - N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -0.02], t$95$0, If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 0.0002], N[(1.0 + N[(-1.0 * N[(N[(N[(-1.0 * N[(N[(N[(1.3333333333333333 * N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 2e+62], t$95$0, N[(z0 - N[(N[(z0 - 1.0), $MachinePrecision] * N[(N[(N[(N[(z1 + z1), $MachinePrecision] * N[(z1 / N[(N[(N[(z1 * z1), $MachinePrecision] * z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / z1), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := z0 \cdot \left(1 - e^{\frac{-2}{z1}}\right)\\
t_1 := 2 \cdot \left(z0 - 1\right)\\
\mathbf{if}\;\frac{-2}{z1} \leq -0.02:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\frac{-2}{z1} \leq 0.0002:\\
\;\;\;\;1 + -1 \cdot \frac{-1 \cdot \frac{1.3333333333333333 \cdot \frac{z0 - 1}{z1} - t\_1}{z1} - t\_1}{z1}\\
\mathbf{elif}\;\frac{-2}{z1} \leq 2 \cdot 10^{+62}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;z0 - \left(z0 - 1\right) \cdot \left(\left(\left(z1 + z1\right) \cdot \frac{z1}{\left(\left(z1 \cdot z1\right) \cdot z1\right) \cdot z1} - \frac{2}{z1}\right) - -1\right)\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -0.02 or 2.0000000000000001e-4 < (/.f64 #s(literal -2 binary64) z1) < 2.0000000000000001e62Initial program 76.8%
Taylor expanded in z0 around inf
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
lower-/.f6444.5%
Applied rewrites44.5%
if -0.02 < (/.f64 #s(literal -2 binary64) z1) < 2.0000000000000001e-4Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
if 2.0000000000000001e62 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6443.7%
Applied rewrites43.7%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6443.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6443.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6443.7%
Applied rewrites43.7%
Applied rewrites17.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-upN/A
pow-divN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites47.7%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0 (* 1.3333333333333333 (/ (- z0 1.0) z1)))
(t_1 (* 2.0 (- z0 1.0))))
(if (<= (/ -2.0 z1) -20.0)
(- z0 (* -1.0 1.0))
(if (<= (/ -2.0 z1) 0.0002)
(+ 1.0 (* -1.0 (/ (- (* -1.0 (/ (- t_0 t_1) z1)) t_1) z1)))
(if (<= (/ -2.0 z1) 1e+88)
(exp (/ -2.0 z1))
(+ 1.0 (/ (* t_0 1.0) (* z1 z1))))))))double code(double z0, double z1) {
double t_0 = 1.3333333333333333 * ((z0 - 1.0) / z1);
double t_1 = 2.0 * (z0 - 1.0);
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 0.0002) {
tmp = 1.0 + (-1.0 * (((-1.0 * ((t_0 - t_1) / z1)) - t_1) / z1));
} else if ((-2.0 / z1) <= 1e+88) {
tmp = exp((-2.0 / z1));
} else {
tmp = 1.0 + ((t_0 * 1.0) / (z1 * z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.3333333333333333d0 * ((z0 - 1.0d0) / z1)
t_1 = 2.0d0 * (z0 - 1.0d0)
if (((-2.0d0) / z1) <= (-20.0d0)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (((-2.0d0) / z1) <= 0.0002d0) then
tmp = 1.0d0 + ((-1.0d0) * ((((-1.0d0) * ((t_0 - t_1) / z1)) - t_1) / z1))
else if (((-2.0d0) / z1) <= 1d+88) then
tmp = exp(((-2.0d0) / z1))
else
tmp = 1.0d0 + ((t_0 * 1.0d0) / (z1 * z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = 1.3333333333333333 * ((z0 - 1.0) / z1);
double t_1 = 2.0 * (z0 - 1.0);
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 0.0002) {
tmp = 1.0 + (-1.0 * (((-1.0 * ((t_0 - t_1) / z1)) - t_1) / z1));
} else if ((-2.0 / z1) <= 1e+88) {
tmp = Math.exp((-2.0 / z1));
} else {
tmp = 1.0 + ((t_0 * 1.0) / (z1 * z1));
}
return tmp;
}
def code(z0, z1): t_0 = 1.3333333333333333 * ((z0 - 1.0) / z1) t_1 = 2.0 * (z0 - 1.0) tmp = 0 if (-2.0 / z1) <= -20.0: tmp = z0 - (-1.0 * 1.0) elif (-2.0 / z1) <= 0.0002: tmp = 1.0 + (-1.0 * (((-1.0 * ((t_0 - t_1) / z1)) - t_1) / z1)) elif (-2.0 / z1) <= 1e+88: tmp = math.exp((-2.0 / z1)) else: tmp = 1.0 + ((t_0 * 1.0) / (z1 * z1)) return tmp
function code(z0, z1) t_0 = Float64(1.3333333333333333 * Float64(Float64(z0 - 1.0) / z1)) t_1 = Float64(2.0 * Float64(z0 - 1.0)) tmp = 0.0 if (Float64(-2.0 / z1) <= -20.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (Float64(-2.0 / z1) <= 0.0002) tmp = Float64(1.0 + Float64(-1.0 * Float64(Float64(Float64(-1.0 * Float64(Float64(t_0 - t_1) / z1)) - t_1) / z1))); elseif (Float64(-2.0 / z1) <= 1e+88) tmp = exp(Float64(-2.0 / z1)); else tmp = Float64(1.0 + Float64(Float64(t_0 * 1.0) / Float64(z1 * z1))); end return tmp end
function tmp_2 = code(z0, z1) t_0 = 1.3333333333333333 * ((z0 - 1.0) / z1); t_1 = 2.0 * (z0 - 1.0); tmp = 0.0; if ((-2.0 / z1) <= -20.0) tmp = z0 - (-1.0 * 1.0); elseif ((-2.0 / z1) <= 0.0002) tmp = 1.0 + (-1.0 * (((-1.0 * ((t_0 - t_1) / z1)) - t_1) / z1)); elseif ((-2.0 / z1) <= 1e+88) tmp = exp((-2.0 / z1)); else tmp = 1.0 + ((t_0 * 1.0) / (z1 * z1)); end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(1.3333333333333333 * N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -20.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 0.0002], N[(1.0 + N[(-1.0 * N[(N[(N[(-1.0 * N[(N[(t$95$0 - t$95$1), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 1e+88], N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision], N[(1.0 + N[(N[(t$95$0 * 1.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := 1.3333333333333333 \cdot \frac{z0 - 1}{z1}\\
t_1 := 2 \cdot \left(z0 - 1\right)\\
\mathbf{if}\;\frac{-2}{z1} \leq -20:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 0.0002:\\
\;\;\;\;1 + -1 \cdot \frac{-1 \cdot \frac{t\_0 - t\_1}{z1} - t\_1}{z1}\\
\mathbf{elif}\;\frac{-2}{z1} \leq 10^{+88}:\\
\;\;\;\;e^{\frac{-2}{z1}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{t\_0 \cdot 1}{z1 \cdot z1}\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -20Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -20 < (/.f64 #s(literal -2 binary64) z1) < 2.0000000000000001e-4Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
if 2.0000000000000001e-4 < (/.f64 #s(literal -2 binary64) z1) < 9.9999999999999996e87Initial program 76.8%
Taylor expanded in z0 around 0
lower-exp.f64N/A
lower-/.f6458.1%
Applied rewrites58.1%
if 9.9999999999999996e87 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z0 around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6457.9%
Applied rewrites57.9%
(FPCore (z0 z1)
:precision binary64
(if (<= (/ -2.0 z1) -20.0)
(- z0 (* -1.0 1.0))
(if (<= (/ -2.0 z1) 2e+58)
(+
1.0
(*
-1.0
(/
(-
(/ (* z0 (- 2.0 (* 1.3333333333333333 (/ 1.0 z1)))) z1)
(* 2.0 (- z0 1.0)))
z1)))
(-
z0
(*
(- z0 1.0)
(-
(- (* (+ z1 z1) (/ z1 (* (* (* z1 z1) z1) z1))) (/ 2.0 z1))
-1.0))))))double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 2e+58) {
tmp = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1));
} else {
tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (((-2.0d0) / z1) <= (-20.0d0)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (((-2.0d0) / z1) <= 2d+58) then
tmp = 1.0d0 + ((-1.0d0) * ((((z0 * (2.0d0 - (1.3333333333333333d0 * (1.0d0 / z1)))) / z1) - (2.0d0 * (z0 - 1.0d0))) / z1))
else
tmp = z0 - ((z0 - 1.0d0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0d0 / z1)) - (-1.0d0)))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 2e+58) {
tmp = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1));
} else {
tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0));
}
return tmp;
}
def code(z0, z1): tmp = 0 if (-2.0 / z1) <= -20.0: tmp = z0 - (-1.0 * 1.0) elif (-2.0 / z1) <= 2e+58: tmp = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1)) else: tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0)) return tmp
function code(z0, z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -20.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (Float64(-2.0 / z1) <= 2e+58) tmp = Float64(1.0 + Float64(-1.0 * Float64(Float64(Float64(Float64(z0 * Float64(2.0 - Float64(1.3333333333333333 * Float64(1.0 / z1)))) / z1) - Float64(2.0 * Float64(z0 - 1.0))) / z1))); else tmp = Float64(z0 - Float64(Float64(z0 - 1.0) * Float64(Float64(Float64(Float64(z1 + z1) * Float64(z1 / Float64(Float64(Float64(z1 * z1) * z1) * z1))) - Float64(2.0 / z1)) - -1.0))); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if ((-2.0 / z1) <= -20.0) tmp = z0 - (-1.0 * 1.0); elseif ((-2.0 / z1) <= 2e+58) tmp = 1.0 + (-1.0 * ((((z0 * (2.0 - (1.3333333333333333 * (1.0 / z1)))) / z1) - (2.0 * (z0 - 1.0))) / z1)); else tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0)); end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -20.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 2e+58], N[(1.0 + N[(-1.0 * N[(N[(N[(N[(z0 * N[(2.0 - N[(1.3333333333333333 * N[(1.0 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision] - N[(2.0 * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z0 - N[(N[(z0 - 1.0), $MachinePrecision] * N[(N[(N[(N[(z1 + z1), $MachinePrecision] * N[(z1 / N[(N[(N[(z1 * z1), $MachinePrecision] * z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / z1), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\frac{-2}{z1} \leq -20:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 2 \cdot 10^{+58}:\\
\;\;\;\;1 + -1 \cdot \frac{\frac{z0 \cdot \left(2 - 1.3333333333333333 \cdot \frac{1}{z1}\right)}{z1} - 2 \cdot \left(z0 - 1\right)}{z1}\\
\mathbf{else}:\\
\;\;\;\;z0 - \left(z0 - 1\right) \cdot \left(\left(\left(z1 + z1\right) \cdot \frac{z1}{\left(\left(z1 \cdot z1\right) \cdot z1\right) \cdot z1} - \frac{2}{z1}\right) - -1\right)\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -20Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -20 < (/.f64 #s(literal -2 binary64) z1) < 1.9999999999999999e58Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
Taylor expanded in z0 around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6465.2%
Applied rewrites65.2%
if 1.9999999999999999e58 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6443.7%
Applied rewrites43.7%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6443.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6443.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6443.7%
Applied rewrites43.7%
Applied rewrites17.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-upN/A
pow-divN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites47.7%
(FPCore (z0 z1)
:precision binary64
(if (<= (/ -2.0 z1) -40000.0)
(- z0 (* -1.0 1.0))
(if (<= (/ -2.0 z1) 2e+58)
(+
1.0
(/
(*
z0
(+
2.0
(* -1.0 (/ (- 2.0 (* 1.3333333333333333 (/ 1.0 z1))) z1))))
z1))
(-
z0
(*
(- z0 1.0)
(-
(- (* (+ z1 z1) (/ z1 (* (* (* z1 z1) z1) z1))) (/ 2.0 z1))
-1.0))))))double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -40000.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 2e+58) {
tmp = 1.0 + ((z0 * (2.0 + (-1.0 * ((2.0 - (1.3333333333333333 * (1.0 / z1))) / z1)))) / z1);
} else {
tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (((-2.0d0) / z1) <= (-40000.0d0)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (((-2.0d0) / z1) <= 2d+58) then
tmp = 1.0d0 + ((z0 * (2.0d0 + ((-1.0d0) * ((2.0d0 - (1.3333333333333333d0 * (1.0d0 / z1))) / z1)))) / z1)
else
tmp = z0 - ((z0 - 1.0d0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0d0 / z1)) - (-1.0d0)))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -40000.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 2e+58) {
tmp = 1.0 + ((z0 * (2.0 + (-1.0 * ((2.0 - (1.3333333333333333 * (1.0 / z1))) / z1)))) / z1);
} else {
tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0));
}
return tmp;
}
def code(z0, z1): tmp = 0 if (-2.0 / z1) <= -40000.0: tmp = z0 - (-1.0 * 1.0) elif (-2.0 / z1) <= 2e+58: tmp = 1.0 + ((z0 * (2.0 + (-1.0 * ((2.0 - (1.3333333333333333 * (1.0 / z1))) / z1)))) / z1) else: tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0)) return tmp
function code(z0, z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -40000.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (Float64(-2.0 / z1) <= 2e+58) tmp = Float64(1.0 + Float64(Float64(z0 * Float64(2.0 + Float64(-1.0 * Float64(Float64(2.0 - Float64(1.3333333333333333 * Float64(1.0 / z1))) / z1)))) / z1)); else tmp = Float64(z0 - Float64(Float64(z0 - 1.0) * Float64(Float64(Float64(Float64(z1 + z1) * Float64(z1 / Float64(Float64(Float64(z1 * z1) * z1) * z1))) - Float64(2.0 / z1)) - -1.0))); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if ((-2.0 / z1) <= -40000.0) tmp = z0 - (-1.0 * 1.0); elseif ((-2.0 / z1) <= 2e+58) tmp = 1.0 + ((z0 * (2.0 + (-1.0 * ((2.0 - (1.3333333333333333 * (1.0 / z1))) / z1)))) / z1); else tmp = z0 - ((z0 - 1.0) * ((((z1 + z1) * (z1 / (((z1 * z1) * z1) * z1))) - (2.0 / z1)) - -1.0)); end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -40000.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 2e+58], N[(1.0 + N[(N[(z0 * N[(2.0 + N[(-1.0 * N[(N[(2.0 - N[(1.3333333333333333 * N[(1.0 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision], N[(z0 - N[(N[(z0 - 1.0), $MachinePrecision] * N[(N[(N[(N[(z1 + z1), $MachinePrecision] * N[(z1 / N[(N[(N[(z1 * z1), $MachinePrecision] * z1), $MachinePrecision] * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / z1), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\frac{-2}{z1} \leq -40000:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 2 \cdot 10^{+58}:\\
\;\;\;\;1 + \frac{z0 \cdot \left(2 + -1 \cdot \frac{2 - 1.3333333333333333 \cdot \frac{1}{z1}}{z1}\right)}{z1}\\
\mathbf{else}:\\
\;\;\;\;z0 - \left(z0 - 1\right) \cdot \left(\left(\left(z1 + z1\right) \cdot \frac{z1}{\left(\left(z1 \cdot z1\right) \cdot z1\right) \cdot z1} - \frac{2}{z1}\right) - -1\right)\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -4e4Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -4e4 < (/.f64 #s(literal -2 binary64) z1) < 1.9999999999999999e58Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
Taylor expanded in z0 around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6465.2%
Applied rewrites65.2%
if 1.9999999999999999e58 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6443.7%
Applied rewrites43.7%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6443.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6443.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6443.7%
Applied rewrites43.7%
Applied rewrites17.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-upN/A
pow-divN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites47.7%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0 (* 2.0 (- z0 1.0))))
(if (<= (exp (/ -2.0 z1)) 4e-15)
(- z0 (* -1.0 1.0))
(+
1.0
(*
-1.0
(/
(-
(*
-1.0
(/ (- (* 1.3333333333333333 (/ (- z0 1.0) z1)) t_0) z1))
t_0)
z1))))))double code(double z0, double z1) {
double t_0 = 2.0 * (z0 - 1.0);
double tmp;
if (exp((-2.0 / z1)) <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0 + (-1.0 * (((-1.0 * (((1.3333333333333333 * ((z0 - 1.0) / z1)) - t_0) / z1)) - t_0) / z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 * (z0 - 1.0d0)
if (exp(((-2.0d0) / z1)) <= 4d-15) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else
tmp = 1.0d0 + ((-1.0d0) * ((((-1.0d0) * (((1.3333333333333333d0 * ((z0 - 1.0d0) / z1)) - t_0) / z1)) - t_0) / z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = 2.0 * (z0 - 1.0);
double tmp;
if (Math.exp((-2.0 / z1)) <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0 + (-1.0 * (((-1.0 * (((1.3333333333333333 * ((z0 - 1.0) / z1)) - t_0) / z1)) - t_0) / z1));
}
return tmp;
}
def code(z0, z1): t_0 = 2.0 * (z0 - 1.0) tmp = 0 if math.exp((-2.0 / z1)) <= 4e-15: tmp = z0 - (-1.0 * 1.0) else: tmp = 1.0 + (-1.0 * (((-1.0 * (((1.3333333333333333 * ((z0 - 1.0) / z1)) - t_0) / z1)) - t_0) / z1)) return tmp
function code(z0, z1) t_0 = Float64(2.0 * Float64(z0 - 1.0)) tmp = 0.0 if (exp(Float64(-2.0 / z1)) <= 4e-15) tmp = Float64(z0 - Float64(-1.0 * 1.0)); else tmp = Float64(1.0 + Float64(-1.0 * Float64(Float64(Float64(-1.0 * Float64(Float64(Float64(1.3333333333333333 * Float64(Float64(z0 - 1.0) / z1)) - t_0) / z1)) - t_0) / z1))); end return tmp end
function tmp_2 = code(z0, z1) t_0 = 2.0 * (z0 - 1.0); tmp = 0.0; if (exp((-2.0 / z1)) <= 4e-15) tmp = z0 - (-1.0 * 1.0); else tmp = 1.0 + (-1.0 * (((-1.0 * (((1.3333333333333333 * ((z0 - 1.0) / z1)) - t_0) / z1)) - t_0) / z1)); end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(2.0 * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision], 4e-15], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 * N[(N[(N[(-1.0 * N[(N[(N[(1.3333333333333333 * N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := 2 \cdot \left(z0 - 1\right)\\
\mathbf{if}\;e^{\frac{-2}{z1}} \leq 4 \cdot 10^{-15}:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 + -1 \cdot \frac{-1 \cdot \frac{1.3333333333333333 \cdot \frac{z0 - 1}{z1} - t\_0}{z1} - t\_0}{z1}\\
\end{array}
if (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 4.0000000000000003e-15Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if 4.0000000000000003e-15 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
(FPCore (z0 z1)
:precision binary64
(if (<= (/ -2.0 z1) -40000.0)
(- z0 (* -1.0 1.0))
(if (<= (/ -2.0 z1) 2e+58)
(+
1.0
(/
(*
z0
(+
2.0
(* -1.0 (/ (- 2.0 (* 1.3333333333333333 (/ 1.0 z1))) z1))))
z1))
(*
(- 1.0 (/ (* (- 1.0 (/ (- 2.0 (/ 2.0 z1)) z1)) (- z0 1.0)) z0))
z0))))double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -40000.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 2e+58) {
tmp = 1.0 + ((z0 * (2.0 + (-1.0 * ((2.0 - (1.3333333333333333 * (1.0 / z1))) / z1)))) / z1);
} else {
tmp = (1.0 - (((1.0 - ((2.0 - (2.0 / z1)) / z1)) * (z0 - 1.0)) / z0)) * z0;
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (((-2.0d0) / z1) <= (-40000.0d0)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (((-2.0d0) / z1) <= 2d+58) then
tmp = 1.0d0 + ((z0 * (2.0d0 + ((-1.0d0) * ((2.0d0 - (1.3333333333333333d0 * (1.0d0 / z1))) / z1)))) / z1)
else
tmp = (1.0d0 - (((1.0d0 - ((2.0d0 - (2.0d0 / z1)) / z1)) * (z0 - 1.0d0)) / z0)) * z0
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -40000.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 2e+58) {
tmp = 1.0 + ((z0 * (2.0 + (-1.0 * ((2.0 - (1.3333333333333333 * (1.0 / z1))) / z1)))) / z1);
} else {
tmp = (1.0 - (((1.0 - ((2.0 - (2.0 / z1)) / z1)) * (z0 - 1.0)) / z0)) * z0;
}
return tmp;
}
def code(z0, z1): tmp = 0 if (-2.0 / z1) <= -40000.0: tmp = z0 - (-1.0 * 1.0) elif (-2.0 / z1) <= 2e+58: tmp = 1.0 + ((z0 * (2.0 + (-1.0 * ((2.0 - (1.3333333333333333 * (1.0 / z1))) / z1)))) / z1) else: tmp = (1.0 - (((1.0 - ((2.0 - (2.0 / z1)) / z1)) * (z0 - 1.0)) / z0)) * z0 return tmp
function code(z0, z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -40000.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (Float64(-2.0 / z1) <= 2e+58) tmp = Float64(1.0 + Float64(Float64(z0 * Float64(2.0 + Float64(-1.0 * Float64(Float64(2.0 - Float64(1.3333333333333333 * Float64(1.0 / z1))) / z1)))) / z1)); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(1.0 - Float64(Float64(2.0 - Float64(2.0 / z1)) / z1)) * Float64(z0 - 1.0)) / z0)) * z0); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if ((-2.0 / z1) <= -40000.0) tmp = z0 - (-1.0 * 1.0); elseif ((-2.0 / z1) <= 2e+58) tmp = 1.0 + ((z0 * (2.0 + (-1.0 * ((2.0 - (1.3333333333333333 * (1.0 / z1))) / z1)))) / z1); else tmp = (1.0 - (((1.0 - ((2.0 - (2.0 / z1)) / z1)) * (z0 - 1.0)) / z0)) * z0; end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -40000.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 2e+58], N[(1.0 + N[(N[(z0 * N[(2.0 + N[(-1.0 * N[(N[(2.0 - N[(1.3333333333333333 * N[(1.0 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(N[(1.0 - N[(N[(2.0 - N[(2.0 / z1), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision] / z0), $MachinePrecision]), $MachinePrecision] * z0), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\frac{-2}{z1} \leq -40000:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 2 \cdot 10^{+58}:\\
\;\;\;\;1 + \frac{z0 \cdot \left(2 + -1 \cdot \frac{2 - 1.3333333333333333 \cdot \frac{1}{z1}}{z1}\right)}{z1}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\left(1 - \frac{2 - \frac{2}{z1}}{z1}\right) \cdot \left(z0 - 1\right)}{z0}\right) \cdot z0\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -4e4Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -4e4 < (/.f64 #s(literal -2 binary64) z1) < 1.9999999999999999e58Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
Taylor expanded in z0 around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6465.2%
Applied rewrites65.2%
if 1.9999999999999999e58 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6443.7%
Applied rewrites43.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.6%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0 (exp (/ -2.0 z1))) (t_1 (/ (- z0 1.0) z1)))
(if (<= t_0 4e-15)
(- z0 (* -1.0 1.0))
(if (<= t_0 1.0001)
(+ 1.0 (- (/ (* (- 1.0 z0) 2.0) (* z1 z1)) (* t_1 -2.0)))
(+
1.0
(/
(* (- (* -2.0 z1) (- -2.0 (* t_1 1.3333333333333333))) 1.0)
(* z1 z1)))))))double code(double z0, double z1) {
double t_0 = exp((-2.0 / z1));
double t_1 = (z0 - 1.0) / z1;
double tmp;
if (t_0 <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else if (t_0 <= 1.0001) {
tmp = 1.0 + ((((1.0 - z0) * 2.0) / (z1 * z1)) - (t_1 * -2.0));
} else {
tmp = 1.0 + ((((-2.0 * z1) - (-2.0 - (t_1 * 1.3333333333333333))) * 1.0) / (z1 * z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(((-2.0d0) / z1))
t_1 = (z0 - 1.0d0) / z1
if (t_0 <= 4d-15) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (t_0 <= 1.0001d0) then
tmp = 1.0d0 + ((((1.0d0 - z0) * 2.0d0) / (z1 * z1)) - (t_1 * (-2.0d0)))
else
tmp = 1.0d0 + (((((-2.0d0) * z1) - ((-2.0d0) - (t_1 * 1.3333333333333333d0))) * 1.0d0) / (z1 * z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = Math.exp((-2.0 / z1));
double t_1 = (z0 - 1.0) / z1;
double tmp;
if (t_0 <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else if (t_0 <= 1.0001) {
tmp = 1.0 + ((((1.0 - z0) * 2.0) / (z1 * z1)) - (t_1 * -2.0));
} else {
tmp = 1.0 + ((((-2.0 * z1) - (-2.0 - (t_1 * 1.3333333333333333))) * 1.0) / (z1 * z1));
}
return tmp;
}
def code(z0, z1): t_0 = math.exp((-2.0 / z1)) t_1 = (z0 - 1.0) / z1 tmp = 0 if t_0 <= 4e-15: tmp = z0 - (-1.0 * 1.0) elif t_0 <= 1.0001: tmp = 1.0 + ((((1.0 - z0) * 2.0) / (z1 * z1)) - (t_1 * -2.0)) else: tmp = 1.0 + ((((-2.0 * z1) - (-2.0 - (t_1 * 1.3333333333333333))) * 1.0) / (z1 * z1)) return tmp
function code(z0, z1) t_0 = exp(Float64(-2.0 / z1)) t_1 = Float64(Float64(z0 - 1.0) / z1) tmp = 0.0 if (t_0 <= 4e-15) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (t_0 <= 1.0001) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(1.0 - z0) * 2.0) / Float64(z1 * z1)) - Float64(t_1 * -2.0))); else tmp = Float64(1.0 + Float64(Float64(Float64(Float64(-2.0 * z1) - Float64(-2.0 - Float64(t_1 * 1.3333333333333333))) * 1.0) / Float64(z1 * z1))); end return tmp end
function tmp_2 = code(z0, z1) t_0 = exp((-2.0 / z1)); t_1 = (z0 - 1.0) / z1; tmp = 0.0; if (t_0 <= 4e-15) tmp = z0 - (-1.0 * 1.0); elseif (t_0 <= 1.0001) tmp = 1.0 + ((((1.0 - z0) * 2.0) / (z1 * z1)) - (t_1 * -2.0)); else tmp = 1.0 + ((((-2.0 * z1) - (-2.0 - (t_1 * 1.3333333333333333))) * 1.0) / (z1 * z1)); end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-15], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0001], N[(1.0 + N[(N[(N[(N[(1.0 - z0), $MachinePrecision] * 2.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(N[(-2.0 * z1), $MachinePrecision] - N[(-2.0 - N[(t$95$1 * 1.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := e^{\frac{-2}{z1}}\\
t_1 := \frac{z0 - 1}{z1}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-15}:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;t\_0 \leq 1.0001:\\
\;\;\;\;1 + \left(\frac{\left(1 - z0\right) \cdot 2}{z1 \cdot z1} - t\_1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\left(-2 \cdot z1 - \left(-2 - t\_1 \cdot 1.3333333333333333\right)\right) \cdot 1}{z1 \cdot z1}\\
\end{array}
if (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 4.0000000000000003e-15Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if 4.0000000000000003e-15 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 1.0001Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
div-subN/A
metadata-evalN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lower--.f64N/A
Applied rewrites66.8%
if 1.0001 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z0 around 0
Applied rewrites58.2%
Taylor expanded in z0 around 0
Applied rewrites58.3%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0 (exp (/ -2.0 z1))) (t_1 (/ (- z0 1.0) z1)))
(if (<= t_0 4e-15)
(- z0 (* -1.0 1.0))
(if (<= t_0 2.0)
(+ 1.0 (- (/ (* (- 1.0 z0) 2.0) (* z1 z1)) (* t_1 -2.0)))
(+ 1.0 (/ (* (* 1.3333333333333333 t_1) 1.0) (* z1 z1)))))))double code(double z0, double z1) {
double t_0 = exp((-2.0 / z1));
double t_1 = (z0 - 1.0) / z1;
double tmp;
if (t_0 <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else if (t_0 <= 2.0) {
tmp = 1.0 + ((((1.0 - z0) * 2.0) / (z1 * z1)) - (t_1 * -2.0));
} else {
tmp = 1.0 + (((1.3333333333333333 * t_1) * 1.0) / (z1 * z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(((-2.0d0) / z1))
t_1 = (z0 - 1.0d0) / z1
if (t_0 <= 4d-15) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (t_0 <= 2.0d0) then
tmp = 1.0d0 + ((((1.0d0 - z0) * 2.0d0) / (z1 * z1)) - (t_1 * (-2.0d0)))
else
tmp = 1.0d0 + (((1.3333333333333333d0 * t_1) * 1.0d0) / (z1 * z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = Math.exp((-2.0 / z1));
double t_1 = (z0 - 1.0) / z1;
double tmp;
if (t_0 <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else if (t_0 <= 2.0) {
tmp = 1.0 + ((((1.0 - z0) * 2.0) / (z1 * z1)) - (t_1 * -2.0));
} else {
tmp = 1.0 + (((1.3333333333333333 * t_1) * 1.0) / (z1 * z1));
}
return tmp;
}
def code(z0, z1): t_0 = math.exp((-2.0 / z1)) t_1 = (z0 - 1.0) / z1 tmp = 0 if t_0 <= 4e-15: tmp = z0 - (-1.0 * 1.0) elif t_0 <= 2.0: tmp = 1.0 + ((((1.0 - z0) * 2.0) / (z1 * z1)) - (t_1 * -2.0)) else: tmp = 1.0 + (((1.3333333333333333 * t_1) * 1.0) / (z1 * z1)) return tmp
function code(z0, z1) t_0 = exp(Float64(-2.0 / z1)) t_1 = Float64(Float64(z0 - 1.0) / z1) tmp = 0.0 if (t_0 <= 4e-15) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (t_0 <= 2.0) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(1.0 - z0) * 2.0) / Float64(z1 * z1)) - Float64(t_1 * -2.0))); else tmp = Float64(1.0 + Float64(Float64(Float64(1.3333333333333333 * t_1) * 1.0) / Float64(z1 * z1))); end return tmp end
function tmp_2 = code(z0, z1) t_0 = exp((-2.0 / z1)); t_1 = (z0 - 1.0) / z1; tmp = 0.0; if (t_0 <= 4e-15) tmp = z0 - (-1.0 * 1.0); elseif (t_0 <= 2.0) tmp = 1.0 + ((((1.0 - z0) * 2.0) / (z1 * z1)) - (t_1 * -2.0)); else tmp = 1.0 + (((1.3333333333333333 * t_1) * 1.0) / (z1 * z1)); end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-15], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2.0], N[(1.0 + N[(N[(N[(N[(1.0 - z0), $MachinePrecision] * 2.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(1.3333333333333333 * t$95$1), $MachinePrecision] * 1.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := e^{\frac{-2}{z1}}\\
t_1 := \frac{z0 - 1}{z1}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-15}:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;1 + \left(\frac{\left(1 - z0\right) \cdot 2}{z1 \cdot z1} - t\_1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\left(1.3333333333333333 \cdot t\_1\right) \cdot 1}{z1 \cdot z1}\\
\end{array}
if (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 4.0000000000000003e-15Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if 4.0000000000000003e-15 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 2Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
div-subN/A
metadata-evalN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lower--.f64N/A
Applied rewrites66.8%
if 2 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z0 around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6457.9%
Applied rewrites57.9%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0 (exp (/ -2.0 z1))) (t_1 (/ (- z0 1.0) z1)))
(if (<= t_0 4e-15)
(- z0 (* -1.0 1.0))
(if (<= t_0 2.0)
(- (/ (* -2.0 (- t_1 (- z0 1.0))) z1) -1.0)
(+ 1.0 (/ (* (* 1.3333333333333333 t_1) 1.0) (* z1 z1)))))))double code(double z0, double z1) {
double t_0 = exp((-2.0 / z1));
double t_1 = (z0 - 1.0) / z1;
double tmp;
if (t_0 <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else if (t_0 <= 2.0) {
tmp = ((-2.0 * (t_1 - (z0 - 1.0))) / z1) - -1.0;
} else {
tmp = 1.0 + (((1.3333333333333333 * t_1) * 1.0) / (z1 * z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(((-2.0d0) / z1))
t_1 = (z0 - 1.0d0) / z1
if (t_0 <= 4d-15) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (t_0 <= 2.0d0) then
tmp = (((-2.0d0) * (t_1 - (z0 - 1.0d0))) / z1) - (-1.0d0)
else
tmp = 1.0d0 + (((1.3333333333333333d0 * t_1) * 1.0d0) / (z1 * z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = Math.exp((-2.0 / z1));
double t_1 = (z0 - 1.0) / z1;
double tmp;
if (t_0 <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else if (t_0 <= 2.0) {
tmp = ((-2.0 * (t_1 - (z0 - 1.0))) / z1) - -1.0;
} else {
tmp = 1.0 + (((1.3333333333333333 * t_1) * 1.0) / (z1 * z1));
}
return tmp;
}
def code(z0, z1): t_0 = math.exp((-2.0 / z1)) t_1 = (z0 - 1.0) / z1 tmp = 0 if t_0 <= 4e-15: tmp = z0 - (-1.0 * 1.0) elif t_0 <= 2.0: tmp = ((-2.0 * (t_1 - (z0 - 1.0))) / z1) - -1.0 else: tmp = 1.0 + (((1.3333333333333333 * t_1) * 1.0) / (z1 * z1)) return tmp
function code(z0, z1) t_0 = exp(Float64(-2.0 / z1)) t_1 = Float64(Float64(z0 - 1.0) / z1) tmp = 0.0 if (t_0 <= 4e-15) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (t_0 <= 2.0) tmp = Float64(Float64(Float64(-2.0 * Float64(t_1 - Float64(z0 - 1.0))) / z1) - -1.0); else tmp = Float64(1.0 + Float64(Float64(Float64(1.3333333333333333 * t_1) * 1.0) / Float64(z1 * z1))); end return tmp end
function tmp_2 = code(z0, z1) t_0 = exp((-2.0 / z1)); t_1 = (z0 - 1.0) / z1; tmp = 0.0; if (t_0 <= 4e-15) tmp = z0 - (-1.0 * 1.0); elseif (t_0 <= 2.0) tmp = ((-2.0 * (t_1 - (z0 - 1.0))) / z1) - -1.0; else tmp = 1.0 + (((1.3333333333333333 * t_1) * 1.0) / (z1 * z1)); end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-15], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2.0], N[(N[(N[(-2.0 * N[(t$95$1 - N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision] - -1.0), $MachinePrecision], N[(1.0 + N[(N[(N[(1.3333333333333333 * t$95$1), $MachinePrecision] * 1.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := e^{\frac{-2}{z1}}\\
t_1 := \frac{z0 - 1}{z1}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-15}:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;\frac{-2 \cdot \left(t\_1 - \left(z0 - 1\right)\right)}{z1} - -1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\left(1.3333333333333333 \cdot t\_1\right) \cdot 1}{z1 \cdot z1}\\
\end{array}
if (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 4.0000000000000003e-15Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if 4.0000000000000003e-15 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 2Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
lift--.f64N/A
*-commutativeN/A
*-commutativeN/A
sinh-+-cosh-revN/A
sinh-+-cosh-revN/A
metadata-evalN/A
associate-*r/N/A
pow-expN/A
lift--.f6466.8%
lift-+.f64N/A
Applied rewrites66.8%
if 2 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z0 around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6457.9%
Applied rewrites57.9%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0 (/ (- z0 1.0) z1)))
(if (<= (/ -2.0 z1) -20.0)
(- z0 (* -1.0 1.0))
(if (<= (/ -2.0 z1) 0.0002)
(+ 1.0 (* 2.0 t_0))
(if (<= (/ -2.0 z1) 4e+96)
(- z0 (* (/ (- (* z0 z0) (* 1.0 1.0)) (+ z0 1.0)) 1.0))
(if (<= (/ -2.0 z1) 1e+150)
(+ 1.0 (/ (* (/ -1.3333333333333333 z1) 1.0) (* z1 z1)))
(+ 1.0 (/ (+ (* -2.0 t_0) -2.0) z1))))))))double code(double z0, double z1) {
double t_0 = (z0 - 1.0) / z1;
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 0.0002) {
tmp = 1.0 + (2.0 * t_0);
} else if ((-2.0 / z1) <= 4e+96) {
tmp = z0 - ((((z0 * z0) - (1.0 * 1.0)) / (z0 + 1.0)) * 1.0);
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((-2.0 * t_0) + -2.0) / z1);
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: tmp
t_0 = (z0 - 1.0d0) / z1
if (((-2.0d0) / z1) <= (-20.0d0)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (((-2.0d0) / z1) <= 0.0002d0) then
tmp = 1.0d0 + (2.0d0 * t_0)
else if (((-2.0d0) / z1) <= 4d+96) then
tmp = z0 - ((((z0 * z0) - (1.0d0 * 1.0d0)) / (z0 + 1.0d0)) * 1.0d0)
else if (((-2.0d0) / z1) <= 1d+150) then
tmp = 1.0d0 + ((((-1.3333333333333333d0) / z1) * 1.0d0) / (z1 * z1))
else
tmp = 1.0d0 + ((((-2.0d0) * t_0) + (-2.0d0)) / z1)
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = (z0 - 1.0) / z1;
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 0.0002) {
tmp = 1.0 + (2.0 * t_0);
} else if ((-2.0 / z1) <= 4e+96) {
tmp = z0 - ((((z0 * z0) - (1.0 * 1.0)) / (z0 + 1.0)) * 1.0);
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((-2.0 * t_0) + -2.0) / z1);
}
return tmp;
}
def code(z0, z1): t_0 = (z0 - 1.0) / z1 tmp = 0 if (-2.0 / z1) <= -20.0: tmp = z0 - (-1.0 * 1.0) elif (-2.0 / z1) <= 0.0002: tmp = 1.0 + (2.0 * t_0) elif (-2.0 / z1) <= 4e+96: tmp = z0 - ((((z0 * z0) - (1.0 * 1.0)) / (z0 + 1.0)) * 1.0) elif (-2.0 / z1) <= 1e+150: tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)) else: tmp = 1.0 + (((-2.0 * t_0) + -2.0) / z1) return tmp
function code(z0, z1) t_0 = Float64(Float64(z0 - 1.0) / z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -20.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (Float64(-2.0 / z1) <= 0.0002) tmp = Float64(1.0 + Float64(2.0 * t_0)); elseif (Float64(-2.0 / z1) <= 4e+96) tmp = Float64(z0 - Float64(Float64(Float64(Float64(z0 * z0) - Float64(1.0 * 1.0)) / Float64(z0 + 1.0)) * 1.0)); elseif (Float64(-2.0 / z1) <= 1e+150) tmp = Float64(1.0 + Float64(Float64(Float64(-1.3333333333333333 / z1) * 1.0) / Float64(z1 * z1))); else tmp = Float64(1.0 + Float64(Float64(Float64(-2.0 * t_0) + -2.0) / z1)); end return tmp end
function tmp_2 = code(z0, z1) t_0 = (z0 - 1.0) / z1; tmp = 0.0; if ((-2.0 / z1) <= -20.0) tmp = z0 - (-1.0 * 1.0); elseif ((-2.0 / z1) <= 0.0002) tmp = 1.0 + (2.0 * t_0); elseif ((-2.0 / z1) <= 4e+96) tmp = z0 - ((((z0 * z0) - (1.0 * 1.0)) / (z0 + 1.0)) * 1.0); elseif ((-2.0 / z1) <= 1e+150) tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)); else tmp = 1.0 + (((-2.0 * t_0) + -2.0) / z1); end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]}, If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -20.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 0.0002], N[(1.0 + N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 4e+96], N[(z0 - N[(N[(N[(N[(z0 * z0), $MachinePrecision] - N[(1.0 * 1.0), $MachinePrecision]), $MachinePrecision] / N[(z0 + 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 1e+150], N[(1.0 + N[(N[(N[(-1.3333333333333333 / z1), $MachinePrecision] * 1.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(-2.0 * t$95$0), $MachinePrecision] + -2.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{z0 - 1}{z1}\\
\mathbf{if}\;\frac{-2}{z1} \leq -20:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 0.0002:\\
\;\;\;\;1 + 2 \cdot t\_0\\
\mathbf{elif}\;\frac{-2}{z1} \leq 4 \cdot 10^{+96}:\\
\;\;\;\;z0 - \frac{z0 \cdot z0 - 1 \cdot 1}{z0 + 1} \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 10^{+150}:\\
\;\;\;\;1 + \frac{\frac{-1.3333333333333333}{z1} \cdot 1}{z1 \cdot z1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-2 \cdot t\_0 + -2}{z1}\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -20Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -20 < (/.f64 #s(literal -2 binary64) z1) < 2.0000000000000001e-4Initial program 76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
if 2.0000000000000001e-4 < (/.f64 #s(literal -2 binary64) z1) < 4.0000000000000002e96Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
lift--.f64N/A
flip--N/A
lower-unsound-/.f64N/A
lower-unsound--.f64N/A
lower-unsound-*.f64N/A
lower-unsound-*.f64N/A
lower-unsound-+.f6433.7%
Applied rewrites33.7%
if 4.0000000000000002e96 < (/.f64 #s(literal -2 binary64) z1) < 9.9999999999999998e149Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z0 around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
Taylor expanded in z1 around 0
lower-/.f6451.0%
Applied rewrites51.0%
if 9.9999999999999998e149 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in z0 around 0
Applied rewrites54.2%
(FPCore (z0 z1)
:precision binary64
(if (<= (/ -2.0 z1) -20.0)
(- z0 (* -1.0 1.0))
(if (<= (/ -2.0 z1) 0.0002)
(+ 1.0 (* 2.0 (/ (- z0 1.0) z1)))
(if (<= (/ -2.0 z1) 4e+96)
(- z0 (* (/ (- (* z0 z0) (* 1.0 1.0)) (+ z0 1.0)) 1.0))
(if (<= (/ -2.0 z1) 1e+150)
(+ 1.0 (/ (* (/ -1.3333333333333333 z1) 1.0) (* z1 z1)))
(+ 1.0 (/ (* (+ z1 z1) (- z0 1.0)) (* z1 z1))))))))double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 0.0002) {
tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1));
} else if ((-2.0 / z1) <= 4e+96) {
tmp = z0 - ((((z0 * z0) - (1.0 * 1.0)) / (z0 + 1.0)) * 1.0);
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (((-2.0d0) / z1) <= (-20.0d0)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (((-2.0d0) / z1) <= 0.0002d0) then
tmp = 1.0d0 + (2.0d0 * ((z0 - 1.0d0) / z1))
else if (((-2.0d0) / z1) <= 4d+96) then
tmp = z0 - ((((z0 * z0) - (1.0d0 * 1.0d0)) / (z0 + 1.0d0)) * 1.0d0)
else if (((-2.0d0) / z1) <= 1d+150) then
tmp = 1.0d0 + ((((-1.3333333333333333d0) / z1) * 1.0d0) / (z1 * z1))
else
tmp = 1.0d0 + (((z1 + z1) * (z0 - 1.0d0)) / (z1 * z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 0.0002) {
tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1));
} else if ((-2.0 / z1) <= 4e+96) {
tmp = z0 - ((((z0 * z0) - (1.0 * 1.0)) / (z0 + 1.0)) * 1.0);
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1));
}
return tmp;
}
def code(z0, z1): tmp = 0 if (-2.0 / z1) <= -20.0: tmp = z0 - (-1.0 * 1.0) elif (-2.0 / z1) <= 0.0002: tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1)) elif (-2.0 / z1) <= 4e+96: tmp = z0 - ((((z0 * z0) - (1.0 * 1.0)) / (z0 + 1.0)) * 1.0) elif (-2.0 / z1) <= 1e+150: tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)) else: tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1)) return tmp
function code(z0, z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -20.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (Float64(-2.0 / z1) <= 0.0002) tmp = Float64(1.0 + Float64(2.0 * Float64(Float64(z0 - 1.0) / z1))); elseif (Float64(-2.0 / z1) <= 4e+96) tmp = Float64(z0 - Float64(Float64(Float64(Float64(z0 * z0) - Float64(1.0 * 1.0)) / Float64(z0 + 1.0)) * 1.0)); elseif (Float64(-2.0 / z1) <= 1e+150) tmp = Float64(1.0 + Float64(Float64(Float64(-1.3333333333333333 / z1) * 1.0) / Float64(z1 * z1))); else tmp = Float64(1.0 + Float64(Float64(Float64(z1 + z1) * Float64(z0 - 1.0)) / Float64(z1 * z1))); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if ((-2.0 / z1) <= -20.0) tmp = z0 - (-1.0 * 1.0); elseif ((-2.0 / z1) <= 0.0002) tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1)); elseif ((-2.0 / z1) <= 4e+96) tmp = z0 - ((((z0 * z0) - (1.0 * 1.0)) / (z0 + 1.0)) * 1.0); elseif ((-2.0 / z1) <= 1e+150) tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)); else tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1)); end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -20.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 0.0002], N[(1.0 + N[(2.0 * N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 4e+96], N[(z0 - N[(N[(N[(N[(z0 * z0), $MachinePrecision] - N[(1.0 * 1.0), $MachinePrecision]), $MachinePrecision] / N[(z0 + 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 1e+150], N[(1.0 + N[(N[(N[(-1.3333333333333333 / z1), $MachinePrecision] * 1.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(z1 + z1), $MachinePrecision] * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;\frac{-2}{z1} \leq -20:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 0.0002:\\
\;\;\;\;1 + 2 \cdot \frac{z0 - 1}{z1}\\
\mathbf{elif}\;\frac{-2}{z1} \leq 4 \cdot 10^{+96}:\\
\;\;\;\;z0 - \frac{z0 \cdot z0 - 1 \cdot 1}{z0 + 1} \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 10^{+150}:\\
\;\;\;\;1 + \frac{\frac{-1.3333333333333333}{z1} \cdot 1}{z1 \cdot z1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\left(z1 + z1\right) \cdot \left(z0 - 1\right)}{z1 \cdot z1}\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -20Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -20 < (/.f64 #s(literal -2 binary64) z1) < 2.0000000000000001e-4Initial program 76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
if 2.0000000000000001e-4 < (/.f64 #s(literal -2 binary64) z1) < 4.0000000000000002e96Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
lift--.f64N/A
flip--N/A
lower-unsound-/.f64N/A
lower-unsound--.f64N/A
lower-unsound-*.f64N/A
lower-unsound-*.f64N/A
lower-unsound-+.f6433.7%
Applied rewrites33.7%
if 4.0000000000000002e96 < (/.f64 #s(literal -2 binary64) z1) < 9.9999999999999998e149Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z0 around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
Taylor expanded in z1 around 0
lower-/.f6451.0%
Applied rewrites51.0%
if 9.9999999999999998e149 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
lift-exp.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
metadata-evalN/A
frac-2negN/A
remove-double-negN/A
lower-/.f64N/A
metadata-eval76.8%
Applied rewrites76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
lift-*.f64N/A
count-2-revN/A
lift-/.f64N/A
lift-/.f64N/A
common-denominatorN/A
count-2-revN/A
associate-*l*N/A
lift--.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0 (/ (- z0 1.0) z1)))
(if (<= (/ -2.0 z1) -20.0)
(- z0 (* -1.0 1.0))
(if (<= (/ -2.0 z1) 4e+96)
(- (/ (* -2.0 (- t_0 (- z0 1.0))) z1) -1.0)
(if (<= (/ -2.0 z1) 1e+150)
(+ 1.0 (/ (* (/ -1.3333333333333333 z1) 1.0) (* z1 z1)))
(+ 1.0 (/ (+ (* -2.0 t_0) -2.0) z1)))))))double code(double z0, double z1) {
double t_0 = (z0 - 1.0) / z1;
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 4e+96) {
tmp = ((-2.0 * (t_0 - (z0 - 1.0))) / z1) - -1.0;
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((-2.0 * t_0) + -2.0) / z1);
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: tmp
t_0 = (z0 - 1.0d0) / z1
if (((-2.0d0) / z1) <= (-20.0d0)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (((-2.0d0) / z1) <= 4d+96) then
tmp = (((-2.0d0) * (t_0 - (z0 - 1.0d0))) / z1) - (-1.0d0)
else if (((-2.0d0) / z1) <= 1d+150) then
tmp = 1.0d0 + ((((-1.3333333333333333d0) / z1) * 1.0d0) / (z1 * z1))
else
tmp = 1.0d0 + ((((-2.0d0) * t_0) + (-2.0d0)) / z1)
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = (z0 - 1.0) / z1;
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 4e+96) {
tmp = ((-2.0 * (t_0 - (z0 - 1.0))) / z1) - -1.0;
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((-2.0 * t_0) + -2.0) / z1);
}
return tmp;
}
def code(z0, z1): t_0 = (z0 - 1.0) / z1 tmp = 0 if (-2.0 / z1) <= -20.0: tmp = z0 - (-1.0 * 1.0) elif (-2.0 / z1) <= 4e+96: tmp = ((-2.0 * (t_0 - (z0 - 1.0))) / z1) - -1.0 elif (-2.0 / z1) <= 1e+150: tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)) else: tmp = 1.0 + (((-2.0 * t_0) + -2.0) / z1) return tmp
function code(z0, z1) t_0 = Float64(Float64(z0 - 1.0) / z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -20.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (Float64(-2.0 / z1) <= 4e+96) tmp = Float64(Float64(Float64(-2.0 * Float64(t_0 - Float64(z0 - 1.0))) / z1) - -1.0); elseif (Float64(-2.0 / z1) <= 1e+150) tmp = Float64(1.0 + Float64(Float64(Float64(-1.3333333333333333 / z1) * 1.0) / Float64(z1 * z1))); else tmp = Float64(1.0 + Float64(Float64(Float64(-2.0 * t_0) + -2.0) / z1)); end return tmp end
function tmp_2 = code(z0, z1) t_0 = (z0 - 1.0) / z1; tmp = 0.0; if ((-2.0 / z1) <= -20.0) tmp = z0 - (-1.0 * 1.0); elseif ((-2.0 / z1) <= 4e+96) tmp = ((-2.0 * (t_0 - (z0 - 1.0))) / z1) - -1.0; elseif ((-2.0 / z1) <= 1e+150) tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)); else tmp = 1.0 + (((-2.0 * t_0) + -2.0) / z1); end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]}, If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -20.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 4e+96], N[(N[(N[(-2.0 * N[(t$95$0 - N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision] - -1.0), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 1e+150], N[(1.0 + N[(N[(N[(-1.3333333333333333 / z1), $MachinePrecision] * 1.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(-2.0 * t$95$0), $MachinePrecision] + -2.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{z0 - 1}{z1}\\
\mathbf{if}\;\frac{-2}{z1} \leq -20:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 4 \cdot 10^{+96}:\\
\;\;\;\;\frac{-2 \cdot \left(t\_0 - \left(z0 - 1\right)\right)}{z1} - -1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 10^{+150}:\\
\;\;\;\;1 + \frac{\frac{-1.3333333333333333}{z1} \cdot 1}{z1 \cdot z1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-2 \cdot t\_0 + -2}{z1}\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -20Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -20 < (/.f64 #s(literal -2 binary64) z1) < 4.0000000000000002e96Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
lift--.f64N/A
*-commutativeN/A
*-commutativeN/A
sinh-+-cosh-revN/A
sinh-+-cosh-revN/A
metadata-evalN/A
associate-*r/N/A
pow-expN/A
lift--.f6466.8%
lift-+.f64N/A
Applied rewrites66.8%
if 4.0000000000000002e96 < (/.f64 #s(literal -2 binary64) z1) < 9.9999999999999998e149Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z0 around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
Taylor expanded in z1 around 0
lower-/.f6451.0%
Applied rewrites51.0%
if 9.9999999999999998e149 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in z0 around 0
Applied rewrites54.2%
(FPCore (z0 z1)
:precision binary64
(if (<= (/ -2.0 z1) -40000.0)
(- z0 (* -1.0 1.0))
(if (<= (/ -2.0 z1) 4e+96)
(+ 1.0 (/ (* z0 (- 2.0 (* 2.0 (/ 1.0 z1)))) z1))
(if (<= (/ -2.0 z1) 1e+150)
(+ 1.0 (/ (* (/ -1.3333333333333333 z1) 1.0) (* z1 z1)))
(+ 1.0 (/ (+ (* -2.0 (/ (- z0 1.0) z1)) -2.0) z1))))))double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -40000.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 4e+96) {
tmp = 1.0 + ((z0 * (2.0 - (2.0 * (1.0 / z1)))) / z1);
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((-2.0 * ((z0 - 1.0) / z1)) + -2.0) / z1);
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (((-2.0d0) / z1) <= (-40000.0d0)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (((-2.0d0) / z1) <= 4d+96) then
tmp = 1.0d0 + ((z0 * (2.0d0 - (2.0d0 * (1.0d0 / z1)))) / z1)
else if (((-2.0d0) / z1) <= 1d+150) then
tmp = 1.0d0 + ((((-1.3333333333333333d0) / z1) * 1.0d0) / (z1 * z1))
else
tmp = 1.0d0 + ((((-2.0d0) * ((z0 - 1.0d0) / z1)) + (-2.0d0)) / z1)
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -40000.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 4e+96) {
tmp = 1.0 + ((z0 * (2.0 - (2.0 * (1.0 / z1)))) / z1);
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((-2.0 * ((z0 - 1.0) / z1)) + -2.0) / z1);
}
return tmp;
}
def code(z0, z1): tmp = 0 if (-2.0 / z1) <= -40000.0: tmp = z0 - (-1.0 * 1.0) elif (-2.0 / z1) <= 4e+96: tmp = 1.0 + ((z0 * (2.0 - (2.0 * (1.0 / z1)))) / z1) elif (-2.0 / z1) <= 1e+150: tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)) else: tmp = 1.0 + (((-2.0 * ((z0 - 1.0) / z1)) + -2.0) / z1) return tmp
function code(z0, z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -40000.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (Float64(-2.0 / z1) <= 4e+96) tmp = Float64(1.0 + Float64(Float64(z0 * Float64(2.0 - Float64(2.0 * Float64(1.0 / z1)))) / z1)); elseif (Float64(-2.0 / z1) <= 1e+150) tmp = Float64(1.0 + Float64(Float64(Float64(-1.3333333333333333 / z1) * 1.0) / Float64(z1 * z1))); else tmp = Float64(1.0 + Float64(Float64(Float64(-2.0 * Float64(Float64(z0 - 1.0) / z1)) + -2.0) / z1)); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if ((-2.0 / z1) <= -40000.0) tmp = z0 - (-1.0 * 1.0); elseif ((-2.0 / z1) <= 4e+96) tmp = 1.0 + ((z0 * (2.0 - (2.0 * (1.0 / z1)))) / z1); elseif ((-2.0 / z1) <= 1e+150) tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)); else tmp = 1.0 + (((-2.0 * ((z0 - 1.0) / z1)) + -2.0) / z1); end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -40000.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 4e+96], N[(1.0 + N[(N[(z0 * N[(2.0 - N[(2.0 * N[(1.0 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 1e+150], N[(1.0 + N[(N[(N[(-1.3333333333333333 / z1), $MachinePrecision] * 1.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(-2.0 * N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;\frac{-2}{z1} \leq -40000:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 4 \cdot 10^{+96}:\\
\;\;\;\;1 + \frac{z0 \cdot \left(2 - 2 \cdot \frac{1}{z1}\right)}{z1}\\
\mathbf{elif}\;\frac{-2}{z1} \leq 10^{+150}:\\
\;\;\;\;1 + \frac{\frac{-1.3333333333333333}{z1} \cdot 1}{z1 \cdot z1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-2 \cdot \frac{z0 - 1}{z1} + -2}{z1}\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -4e4Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -4e4 < (/.f64 #s(literal -2 binary64) z1) < 4.0000000000000002e96Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in z0 around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6461.5%
Applied rewrites61.5%
if 4.0000000000000002e96 < (/.f64 #s(literal -2 binary64) z1) < 9.9999999999999998e149Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z0 around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
Taylor expanded in z1 around 0
lower-/.f6451.0%
Applied rewrites51.0%
if 9.9999999999999998e149 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in z0 around 0
Applied rewrites54.2%
(FPCore (z0 z1)
:precision binary64
(if (<= (/ -2.0 z1) -20.0)
(- z0 (* -1.0 1.0))
(if (<= (/ -2.0 z1) 1e+65)
(+ 1.0 (* 2.0 (/ (- z0 1.0) z1)))
(if (<= (/ -2.0 z1) 1e+150)
(+ 1.0 (/ (* (/ -1.3333333333333333 z1) 1.0) (* z1 z1)))
(+ 1.0 (/ (* (+ z1 z1) (- z0 1.0)) (* z1 z1)))))))double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 1e+65) {
tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1));
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (((-2.0d0) / z1) <= (-20.0d0)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (((-2.0d0) / z1) <= 1d+65) then
tmp = 1.0d0 + (2.0d0 * ((z0 - 1.0d0) / z1))
else if (((-2.0d0) / z1) <= 1d+150) then
tmp = 1.0d0 + ((((-1.3333333333333333d0) / z1) * 1.0d0) / (z1 * z1))
else
tmp = 1.0d0 + (((z1 + z1) * (z0 - 1.0d0)) / (z1 * z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -20.0) {
tmp = z0 - (-1.0 * 1.0);
} else if ((-2.0 / z1) <= 1e+65) {
tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1));
} else if ((-2.0 / z1) <= 1e+150) {
tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1));
} else {
tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1));
}
return tmp;
}
def code(z0, z1): tmp = 0 if (-2.0 / z1) <= -20.0: tmp = z0 - (-1.0 * 1.0) elif (-2.0 / z1) <= 1e+65: tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1)) elif (-2.0 / z1) <= 1e+150: tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)) else: tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1)) return tmp
function code(z0, z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -20.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (Float64(-2.0 / z1) <= 1e+65) tmp = Float64(1.0 + Float64(2.0 * Float64(Float64(z0 - 1.0) / z1))); elseif (Float64(-2.0 / z1) <= 1e+150) tmp = Float64(1.0 + Float64(Float64(Float64(-1.3333333333333333 / z1) * 1.0) / Float64(z1 * z1))); else tmp = Float64(1.0 + Float64(Float64(Float64(z1 + z1) * Float64(z0 - 1.0)) / Float64(z1 * z1))); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if ((-2.0 / z1) <= -20.0) tmp = z0 - (-1.0 * 1.0); elseif ((-2.0 / z1) <= 1e+65) tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1)); elseif ((-2.0 / z1) <= 1e+150) tmp = 1.0 + (((-1.3333333333333333 / z1) * 1.0) / (z1 * z1)); else tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1)); end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -20.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 1e+65], N[(1.0 + N[(2.0 * N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-2.0 / z1), $MachinePrecision], 1e+150], N[(1.0 + N[(N[(N[(-1.3333333333333333 / z1), $MachinePrecision] * 1.0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(z1 + z1), $MachinePrecision] * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;\frac{-2}{z1} \leq -20:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;\frac{-2}{z1} \leq 10^{+65}:\\
\;\;\;\;1 + 2 \cdot \frac{z0 - 1}{z1}\\
\mathbf{elif}\;\frac{-2}{z1} \leq 10^{+150}:\\
\;\;\;\;1 + \frac{\frac{-1.3333333333333333}{z1} \cdot 1}{z1 \cdot z1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\left(z1 + z1\right) \cdot \left(z0 - 1\right)}{z1 \cdot z1}\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -20Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -20 < (/.f64 #s(literal -2 binary64) z1) < 9.9999999999999999e64Initial program 76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
if 9.9999999999999999e64 < (/.f64 #s(literal -2 binary64) z1) < 9.9999999999999998e149Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z0 around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
Taylor expanded in z1 around 0
lower-/.f6451.0%
Applied rewrites51.0%
if 9.9999999999999998e149 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
lift-exp.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
metadata-evalN/A
frac-2negN/A
remove-double-negN/A
lower-/.f64N/A
metadata-eval76.8%
Applied rewrites76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
lift-*.f64N/A
count-2-revN/A
lift-/.f64N/A
lift-/.f64N/A
common-denominatorN/A
count-2-revN/A
associate-*l*N/A
lift--.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0 (exp (/ -2.0 z1))))
(if (<= t_0 0.0)
(- z0 (* -1.0 1.0))
(if (<= t_0 1.0)
(+ 1.0 (* 2.0 (/ z0 z1)))
(+ 1.0 (/ (* (+ z1 z1) (- z0 1.0)) (* z1 z1)))))))double code(double z0, double z1) {
double t_0 = exp((-2.0 / z1));
double tmp;
if (t_0 <= 0.0) {
tmp = z0 - (-1.0 * 1.0);
} else if (t_0 <= 1.0) {
tmp = 1.0 + (2.0 * (z0 / z1));
} else {
tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: tmp
t_0 = exp(((-2.0d0) / z1))
if (t_0 <= 0.0d0) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else if (t_0 <= 1.0d0) then
tmp = 1.0d0 + (2.0d0 * (z0 / z1))
else
tmp = 1.0d0 + (((z1 + z1) * (z0 - 1.0d0)) / (z1 * z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = Math.exp((-2.0 / z1));
double tmp;
if (t_0 <= 0.0) {
tmp = z0 - (-1.0 * 1.0);
} else if (t_0 <= 1.0) {
tmp = 1.0 + (2.0 * (z0 / z1));
} else {
tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1));
}
return tmp;
}
def code(z0, z1): t_0 = math.exp((-2.0 / z1)) tmp = 0 if t_0 <= 0.0: tmp = z0 - (-1.0 * 1.0) elif t_0 <= 1.0: tmp = 1.0 + (2.0 * (z0 / z1)) else: tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1)) return tmp
function code(z0, z1) t_0 = exp(Float64(-2.0 / z1)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); elseif (t_0 <= 1.0) tmp = Float64(1.0 + Float64(2.0 * Float64(z0 / z1))); else tmp = Float64(1.0 + Float64(Float64(Float64(z1 + z1) * Float64(z0 - 1.0)) / Float64(z1 * z1))); end return tmp end
function tmp_2 = code(z0, z1) t_0 = exp((-2.0 / z1)); tmp = 0.0; if (t_0 <= 0.0) tmp = z0 - (-1.0 * 1.0); elseif (t_0 <= 1.0) tmp = 1.0 + (2.0 * (z0 / z1)); else tmp = 1.0 + (((z1 + z1) * (z0 - 1.0)) / (z1 * z1)); end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[(1.0 + N[(2.0 * N[(z0 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(z1 + z1), $MachinePrecision] * N[(z0 - 1.0), $MachinePrecision]), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := e^{\frac{-2}{z1}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;1 + 2 \cdot \frac{z0}{z1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\left(z1 + z1\right) \cdot \left(z0 - 1\right)}{z1 \cdot z1}\\
\end{array}
if (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 0.0Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if 0.0 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 1Initial program 76.8%
lift-exp.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
metadata-evalN/A
frac-2negN/A
remove-double-negN/A
lower-/.f64N/A
metadata-eval76.8%
Applied rewrites76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
Taylor expanded in z0 around inf
lower-/.f6458.0%
Applied rewrites58.0%
if 1 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) Initial program 76.8%
lift-exp.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
metadata-evalN/A
frac-2negN/A
remove-double-negN/A
lower-/.f64N/A
metadata-eval76.8%
Applied rewrites76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
lift-*.f64N/A
count-2-revN/A
lift-/.f64N/A
lift-/.f64N/A
common-denominatorN/A
count-2-revN/A
associate-*l*N/A
lift--.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
(FPCore (z0 z1) :precision binary64 (if (<= (exp (/ -2.0 z1)) 4e-15) (- z0 (* -1.0 1.0)) (+ 1.0 (* 2.0 (/ (- z0 1.0) z1)))))
double code(double z0, double z1) {
double tmp;
if (exp((-2.0 / z1)) <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (exp(((-2.0d0) / z1)) <= 4d-15) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else
tmp = 1.0d0 + (2.0d0 * ((z0 - 1.0d0) / z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if (Math.exp((-2.0 / z1)) <= 4e-15) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1));
}
return tmp;
}
def code(z0, z1): tmp = 0 if math.exp((-2.0 / z1)) <= 4e-15: tmp = z0 - (-1.0 * 1.0) else: tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1)) return tmp
function code(z0, z1) tmp = 0.0 if (exp(Float64(-2.0 / z1)) <= 4e-15) tmp = Float64(z0 - Float64(-1.0 * 1.0)); else tmp = Float64(1.0 + Float64(2.0 * Float64(Float64(z0 - 1.0) / z1))); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if (exp((-2.0 / z1)) <= 4e-15) tmp = z0 - (-1.0 * 1.0); else tmp = 1.0 + (2.0 * ((z0 - 1.0) / z1)); end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision], 4e-15], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(2.0 * N[(N[(z0 - 1.0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;e^{\frac{-2}{z1}} \leq 4 \cdot 10^{-15}:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 + 2 \cdot \frac{z0 - 1}{z1}\\
\end{array}
if (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 4.0000000000000003e-15Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if 4.0000000000000003e-15 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) Initial program 76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
(FPCore (z0 z1) :precision binary64 (if (<= (exp (/ -2.0 z1)) 0.0) (- z0 (* -1.0 1.0)) (+ 1.0 (* 2.0 (/ z0 z1)))))
double code(double z0, double z1) {
double tmp;
if (exp((-2.0 / z1)) <= 0.0) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0 + (2.0 * (z0 / z1));
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (exp(((-2.0d0) / z1)) <= 0.0d0) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else
tmp = 1.0d0 + (2.0d0 * (z0 / z1))
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if (Math.exp((-2.0 / z1)) <= 0.0) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0 + (2.0 * (z0 / z1));
}
return tmp;
}
def code(z0, z1): tmp = 0 if math.exp((-2.0 / z1)) <= 0.0: tmp = z0 - (-1.0 * 1.0) else: tmp = 1.0 + (2.0 * (z0 / z1)) return tmp
function code(z0, z1) tmp = 0.0 if (exp(Float64(-2.0 / z1)) <= 0.0) tmp = Float64(z0 - Float64(-1.0 * 1.0)); else tmp = Float64(1.0 + Float64(2.0 * Float64(z0 / z1))); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if (exp((-2.0 / z1)) <= 0.0) tmp = z0 - (-1.0 * 1.0); else tmp = 1.0 + (2.0 * (z0 / z1)); end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[Exp[N[(-2.0 / z1), $MachinePrecision]], $MachinePrecision], 0.0], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(2.0 * N[(z0 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;e^{\frac{-2}{z1}} \leq 0:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 + 2 \cdot \frac{z0}{z1}\\
\end{array}
if (exp.f64 (/.f64 #s(literal -2 binary64) z1)) < 0.0Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if 0.0 < (exp.f64 (/.f64 #s(literal -2 binary64) z1)) Initial program 76.8%
lift-exp.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
metadata-evalN/A
frac-2negN/A
remove-double-negN/A
lower-/.f64N/A
metadata-eval76.8%
Applied rewrites76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
Taylor expanded in z0 around inf
lower-/.f6458.0%
Applied rewrites58.0%
(FPCore (z0 z1) :precision binary64 (if (<= (/ -2.0 z1) -3.5e-75) (- z0 (* -1.0 1.0)) (+ 1.0 (/ -2.0 z1))))
double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -3.5e-75) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0 + (-2.0 / z1);
}
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(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (((-2.0d0) / z1) <= (-3.5d-75)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else
tmp = 1.0d0 + ((-2.0d0) / z1)
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -3.5e-75) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0 + (-2.0 / z1);
}
return tmp;
}
def code(z0, z1): tmp = 0 if (-2.0 / z1) <= -3.5e-75: tmp = z0 - (-1.0 * 1.0) else: tmp = 1.0 + (-2.0 / z1) return tmp
function code(z0, z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -3.5e-75) tmp = Float64(z0 - Float64(-1.0 * 1.0)); else tmp = Float64(1.0 + Float64(-2.0 / z1)); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if ((-2.0 / z1) <= -3.5e-75) tmp = z0 - (-1.0 * 1.0); else tmp = 1.0 + (-2.0 / z1); end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -3.5e-75], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-2.0 / z1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\frac{-2}{z1} \leq -3.5 \cdot 10^{-75}:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-2}{z1}\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -3.4999999999999999e-75Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -3.4999999999999999e-75 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
lift-exp.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
metadata-evalN/A
frac-2negN/A
remove-double-negN/A
lower-/.f64N/A
metadata-eval76.8%
Applied rewrites76.8%
Taylor expanded in z1 around inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5%
Applied rewrites58.5%
Taylor expanded in z0 around 0
lower-/.f6439.5%
Applied rewrites39.5%
(FPCore (z0 z1) :precision binary64 (if (<= (/ -2.0 z1) -3.5e-75) (- z0 (* -1.0 1.0)) 1.0))
double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -3.5e-75) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (((-2.0d0) / z1) <= (-3.5d-75)) then
tmp = z0 - ((-1.0d0) * 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if ((-2.0 / z1) <= -3.5e-75) {
tmp = z0 - (-1.0 * 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(z0, z1): tmp = 0 if (-2.0 / z1) <= -3.5e-75: tmp = z0 - (-1.0 * 1.0) else: tmp = 1.0 return tmp
function code(z0, z1) tmp = 0.0 if (Float64(-2.0 / z1) <= -3.5e-75) tmp = Float64(z0 - Float64(-1.0 * 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if ((-2.0 / z1) <= -3.5e-75) tmp = z0 - (-1.0 * 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[N[(-2.0 / z1), $MachinePrecision], -3.5e-75], N[(z0 - N[(-1.0 * 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\mathbf{if}\;\frac{-2}{z1} \leq -3.5 \cdot 10^{-75}:\\
\;\;\;\;z0 - -1 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
if (/.f64 #s(literal -2 binary64) z1) < -3.4999999999999999e-75Initial program 76.8%
Taylor expanded in z1 around inf
Applied rewrites27.8%
Taylor expanded in z0 around 0
Applied rewrites37.4%
if -3.4999999999999999e-75 < (/.f64 #s(literal -2 binary64) z1) Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in z1 around inf
Applied rewrites39.0%
(FPCore (z0 z1) :precision binary64 1.0)
double code(double z0, double z1) {
return 1.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(z0, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
code = 1.0d0
end function
public static double code(double z0, double z1) {
return 1.0;
}
def code(z0, z1): return 1.0
function code(z0, z1) return 1.0 end
function tmp = code(z0, z1) tmp = 1.0; end
code[z0_, z1_] := 1.0
1
Initial program 76.8%
Taylor expanded in z1 around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites71.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
Applied rewrites57.8%
Taylor expanded in z1 around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in z1 around inf
Applied rewrites39.0%
herbie shell --seed 2025250
(FPCore (z0 z1)
:name "(- z0 (* (- z0 1) (exp (/ -2 z1))))"
:precision binary64
(- z0 (* (- z0 1.0) (exp (/ -2.0 z1)))))