
(FPCore (z0 z3 z4 z1 z2) :precision binary64 (/ (log (- 1.0 z0)) (- (/ z3 (* (- z4) z4)) (/ z1 (* z2 z2)))))
double code(double z0, double z3, double z4, double z1, double z2) {
return log((1.0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2)));
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
code = log((1.0d0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2)))
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
return Math.log((1.0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2)));
}
def code(z0, z3, z4, z1, z2): return math.log((1.0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2)))
function code(z0, z3, z4, z1, z2) return Float64(log(Float64(1.0 - z0)) / Float64(Float64(z3 / Float64(Float64(-z4) * z4)) - Float64(z1 / Float64(z2 * z2)))) end
function tmp = code(z0, z3, z4, z1, z2) tmp = log((1.0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2))); end
code[z0_, z3_, z4_, z1_, z2_] := N[(N[Log[N[(1.0 - z0), $MachinePrecision]], $MachinePrecision] / N[(N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision] - N[(z1 / N[(z2 * z2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\log \left(1 - z0\right)}{\frac{z3}{\left(-z4\right) \cdot z4} - \frac{z1}{z2 \cdot z2}}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (z0 z3 z4 z1 z2) :precision binary64 (/ (log (- 1.0 z0)) (- (/ z3 (* (- z4) z4)) (/ z1 (* z2 z2)))))
double code(double z0, double z3, double z4, double z1, double z2) {
return log((1.0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2)));
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
code = log((1.0d0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2)))
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
return Math.log((1.0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2)));
}
def code(z0, z3, z4, z1, z2): return math.log((1.0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2)))
function code(z0, z3, z4, z1, z2) return Float64(log(Float64(1.0 - z0)) / Float64(Float64(z3 / Float64(Float64(-z4) * z4)) - Float64(z1 / Float64(z2 * z2)))) end
function tmp = code(z0, z3, z4, z1, z2) tmp = log((1.0 - z0)) / ((z3 / (-z4 * z4)) - (z1 / (z2 * z2))); end
code[z0_, z3_, z4_, z1_, z2_] := N[(N[Log[N[(1.0 - z0), $MachinePrecision]], $MachinePrecision] / N[(N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision] - N[(z1 / N[(z2 * z2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\log \left(1 - z0\right)}{\frac{z3}{\left(-z4\right) \cdot z4} - \frac{z1}{z2 \cdot z2}}
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(let* ((t_0 (/ z3 (* (- z4) z4)))
(t_1 (/ (log (- 1.0 z0)) (- t_0 (/ z1 (* z2 z2))))))
(if (<= t_1 -2e-253)
t_1
(if (<= t_1 5e-283)
(/ (- z0) (- t_0 (/ 1.0 (/ z2 (/ z1 z2)))))
(if (<= t_1 2e+302)
t_1
(*
(/ (- z0) (/ (+ (* (/ z1 z2) z4) (* (/ z3 z4) z2)) (- z4)))
(/ 1.0 (/ 1.0 z2))))))))double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z3 / (-z4 * z4);
double t_1 = log((1.0 - z0)) / (t_0 - (z1 / (z2 * z2)));
double tmp;
if (t_1 <= -2e-253) {
tmp = t_1;
} else if (t_1 <= 5e-283) {
tmp = -z0 / (t_0 - (1.0 / (z2 / (z1 / z2))));
} else if (t_1 <= 2e+302) {
tmp = t_1;
} else {
tmp = (-z0 / ((((z1 / z2) * z4) + ((z3 / z4) * z2)) / -z4)) * (1.0 / (1.0 / z2));
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z3 / (-z4 * z4)
t_1 = log((1.0d0 - z0)) / (t_0 - (z1 / (z2 * z2)))
if (t_1 <= (-2d-253)) then
tmp = t_1
else if (t_1 <= 5d-283) then
tmp = -z0 / (t_0 - (1.0d0 / (z2 / (z1 / z2))))
else if (t_1 <= 2d+302) then
tmp = t_1
else
tmp = (-z0 / ((((z1 / z2) * z4) + ((z3 / z4) * z2)) / -z4)) * (1.0d0 / (1.0d0 / z2))
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z3 / (-z4 * z4);
double t_1 = Math.log((1.0 - z0)) / (t_0 - (z1 / (z2 * z2)));
double tmp;
if (t_1 <= -2e-253) {
tmp = t_1;
} else if (t_1 <= 5e-283) {
tmp = -z0 / (t_0 - (1.0 / (z2 / (z1 / z2))));
} else if (t_1 <= 2e+302) {
tmp = t_1;
} else {
tmp = (-z0 / ((((z1 / z2) * z4) + ((z3 / z4) * z2)) / -z4)) * (1.0 / (1.0 / z2));
}
return tmp;
}
def code(z0, z3, z4, z1, z2): t_0 = z3 / (-z4 * z4) t_1 = math.log((1.0 - z0)) / (t_0 - (z1 / (z2 * z2))) tmp = 0 if t_1 <= -2e-253: tmp = t_1 elif t_1 <= 5e-283: tmp = -z0 / (t_0 - (1.0 / (z2 / (z1 / z2)))) elif t_1 <= 2e+302: tmp = t_1 else: tmp = (-z0 / ((((z1 / z2) * z4) + ((z3 / z4) * z2)) / -z4)) * (1.0 / (1.0 / z2)) return tmp
function code(z0, z3, z4, z1, z2) t_0 = Float64(z3 / Float64(Float64(-z4) * z4)) t_1 = Float64(log(Float64(1.0 - z0)) / Float64(t_0 - Float64(z1 / Float64(z2 * z2)))) tmp = 0.0 if (t_1 <= -2e-253) tmp = t_1; elseif (t_1 <= 5e-283) tmp = Float64(Float64(-z0) / Float64(t_0 - Float64(1.0 / Float64(z2 / Float64(z1 / z2))))); elseif (t_1 <= 2e+302) tmp = t_1; else tmp = Float64(Float64(Float64(-z0) / Float64(Float64(Float64(Float64(z1 / z2) * z4) + Float64(Float64(z3 / z4) * z2)) / Float64(-z4))) * Float64(1.0 / Float64(1.0 / z2))); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) t_0 = z3 / (-z4 * z4); t_1 = log((1.0 - z0)) / (t_0 - (z1 / (z2 * z2))); tmp = 0.0; if (t_1 <= -2e-253) tmp = t_1; elseif (t_1 <= 5e-283) tmp = -z0 / (t_0 - (1.0 / (z2 / (z1 / z2)))); elseif (t_1 <= 2e+302) tmp = t_1; else tmp = (-z0 / ((((z1 / z2) * z4) + ((z3 / z4) * z2)) / -z4)) * (1.0 / (1.0 / z2)); end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := Block[{t$95$0 = N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[N[(1.0 - z0), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(z1 / N[(z2 * z2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-253], t$95$1, If[LessEqual[t$95$1, 5e-283], N[((-z0) / N[(t$95$0 - N[(1.0 / N[(z2 / N[(z1 / z2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+302], t$95$1, N[(N[((-z0) / N[(N[(N[(N[(z1 / z2), $MachinePrecision] * z4), $MachinePrecision] + N[(N[(z3 / z4), $MachinePrecision] * z2), $MachinePrecision]), $MachinePrecision] / (-z4)), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 / z2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{z3}{\left(-z4\right) \cdot z4}\\
t_1 := \frac{\log \left(1 - z0\right)}{t\_0 - \frac{z1}{z2 \cdot z2}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-283}:\\
\;\;\;\;\frac{-z0}{t\_0 - \frac{1}{\frac{z2}{\frac{z1}{z2}}}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-z0}{\frac{\frac{z1}{z2} \cdot z4 + \frac{z3}{z4} \cdot z2}{-z4}} \cdot \frac{1}{\frac{1}{z2}}\\
\end{array}
if (/.f64 (log.f64 (-.f64 #s(literal 1 binary64) z0)) (-.f64 (/.f64 z3 (*.f64 (neg.f64 z4) z4)) (/.f64 z1 (*.f64 z2 z2)))) < -2.0000000000000001e-253 or 5.0000000000000001e-283 < (/.f64 (log.f64 (-.f64 #s(literal 1 binary64) z0)) (-.f64 (/.f64 z3 (*.f64 (neg.f64 z4) z4)) (/.f64 z1 (*.f64 z2 z2)))) < 2.0000000000000002e302Initial program 65.6%
if -2.0000000000000001e-253 < (/.f64 (log.f64 (-.f64 #s(literal 1 binary64) z0)) (-.f64 (/.f64 z3 (*.f64 (neg.f64 z4) z4)) (/.f64 z1 (*.f64 z2 z2)))) < 5.0000000000000001e-283Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6471.9%
Applied rewrites71.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6474.7%
Applied rewrites74.7%
if 2.0000000000000002e302 < (/.f64 (log.f64 (-.f64 #s(literal 1 binary64) z0)) (-.f64 (/.f64 z3 (*.f64 (neg.f64 z4) z4)) (/.f64 z1 (*.f64 z2 z2)))) Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
Applied rewrites75.0%
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(if (<= z0 -7.8e-7)
(*
(*
(/ (- (log (- 1.0 z0))) (+ (* (/ z1 z2) z4) (* (/ z3 z4) z2)))
z4)
z2)
(/ (* -1.0 z0) (/ (- (* (/ z3 (* (- z4) z4)) z2) (/ z1 z2)) z2))))double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (z0 <= -7.8e-7) {
tmp = ((-log((1.0 - z0)) / (((z1 / z2) * z4) + ((z3 / z4) * z2))) * z4) * z2;
} else {
tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2);
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: tmp
if (z0 <= (-7.8d-7)) then
tmp = ((-log((1.0d0 - z0)) / (((z1 / z2) * z4) + ((z3 / z4) * z2))) * z4) * z2
else
tmp = ((-1.0d0) * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2)
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (z0 <= -7.8e-7) {
tmp = ((-Math.log((1.0 - z0)) / (((z1 / z2) * z4) + ((z3 / z4) * z2))) * z4) * z2;
} else {
tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2);
}
return tmp;
}
def code(z0, z3, z4, z1, z2): tmp = 0 if z0 <= -7.8e-7: tmp = ((-math.log((1.0 - z0)) / (((z1 / z2) * z4) + ((z3 / z4) * z2))) * z4) * z2 else: tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2) return tmp
function code(z0, z3, z4, z1, z2) tmp = 0.0 if (z0 <= -7.8e-7) tmp = Float64(Float64(Float64(Float64(-log(Float64(1.0 - z0))) / Float64(Float64(Float64(z1 / z2) * z4) + Float64(Float64(z3 / z4) * z2))) * z4) * z2); else tmp = Float64(Float64(-1.0 * z0) / Float64(Float64(Float64(Float64(z3 / Float64(Float64(-z4) * z4)) * z2) - Float64(z1 / z2)) / z2)); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) tmp = 0.0; if (z0 <= -7.8e-7) tmp = ((-log((1.0 - z0)) / (((z1 / z2) * z4) + ((z3 / z4) * z2))) * z4) * z2; else tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2); end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := If[LessEqual[z0, -7.8e-7], N[(N[(N[((-N[Log[N[(1.0 - z0), $MachinePrecision]], $MachinePrecision]) / N[(N[(N[(z1 / z2), $MachinePrecision] * z4), $MachinePrecision] + N[(N[(z3 / z4), $MachinePrecision] * z2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z4), $MachinePrecision] * z2), $MachinePrecision], N[(N[(-1.0 * z0), $MachinePrecision] / N[(N[(N[(N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision] * z2), $MachinePrecision] - N[(z1 / z2), $MachinePrecision]), $MachinePrecision] / z2), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z0 \leq -7.8 \cdot 10^{-7}:\\
\;\;\;\;\left(\frac{-\log \left(1 - z0\right)}{\frac{z1}{z2} \cdot z4 + \frac{z3}{z4} \cdot z2} \cdot z4\right) \cdot z2\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot z0}{\frac{\frac{z3}{\left(-z4\right) \cdot z4} \cdot z2 - \frac{z1}{z2}}{z2}}\\
\end{array}
if z0 < -7.8000000000000005e-7Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
lower-*.f64N/A
lower-neg.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
frac-2negN/A
sub-to-fractionN/A
div-flip-revN/A
lower-/.f64N/A
Applied rewrites50.2%
Applied rewrites70.8%
if -7.8000000000000005e-7 < z0 Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
(FPCore (z0 z3 z4 z1 z2) :precision binary64 (if (<= z0 -1.65e-6) (* (/ (- (log (- 1.0 z0))) (+ (* (/ z1 (* z2 z2)) z4) (/ z3 z4))) z4) (/ (* -1.0 z0) (/ (- (* (/ z3 (* (- z4) z4)) z2) (/ z1 z2)) z2))))
double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (z0 <= -1.65e-6) {
tmp = (-log((1.0 - z0)) / (((z1 / (z2 * z2)) * z4) + (z3 / z4))) * z4;
} else {
tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2);
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: tmp
if (z0 <= (-1.65d-6)) then
tmp = (-log((1.0d0 - z0)) / (((z1 / (z2 * z2)) * z4) + (z3 / z4))) * z4
else
tmp = ((-1.0d0) * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2)
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (z0 <= -1.65e-6) {
tmp = (-Math.log((1.0 - z0)) / (((z1 / (z2 * z2)) * z4) + (z3 / z4))) * z4;
} else {
tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2);
}
return tmp;
}
def code(z0, z3, z4, z1, z2): tmp = 0 if z0 <= -1.65e-6: tmp = (-math.log((1.0 - z0)) / (((z1 / (z2 * z2)) * z4) + (z3 / z4))) * z4 else: tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2) return tmp
function code(z0, z3, z4, z1, z2) tmp = 0.0 if (z0 <= -1.65e-6) tmp = Float64(Float64(Float64(-log(Float64(1.0 - z0))) / Float64(Float64(Float64(z1 / Float64(z2 * z2)) * z4) + Float64(z3 / z4))) * z4); else tmp = Float64(Float64(-1.0 * z0) / Float64(Float64(Float64(Float64(z3 / Float64(Float64(-z4) * z4)) * z2) - Float64(z1 / z2)) / z2)); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) tmp = 0.0; if (z0 <= -1.65e-6) tmp = (-log((1.0 - z0)) / (((z1 / (z2 * z2)) * z4) + (z3 / z4))) * z4; else tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2); end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := If[LessEqual[z0, -1.65e-6], N[(N[((-N[Log[N[(1.0 - z0), $MachinePrecision]], $MachinePrecision]) / N[(N[(N[(z1 / N[(z2 * z2), $MachinePrecision]), $MachinePrecision] * z4), $MachinePrecision] + N[(z3 / z4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z4), $MachinePrecision], N[(N[(-1.0 * z0), $MachinePrecision] / N[(N[(N[(N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision] * z2), $MachinePrecision] - N[(z1 / z2), $MachinePrecision]), $MachinePrecision] / z2), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z0 \leq -1.65 \cdot 10^{-6}:\\
\;\;\;\;\frac{-\log \left(1 - z0\right)}{\frac{z1}{z2 \cdot z2} \cdot z4 + \frac{z3}{z4}} \cdot z4\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot z0}{\frac{\frac{z3}{\left(-z4\right) \cdot z4} \cdot z2 - \frac{z1}{z2}}{z2}}\\
\end{array}
if z0 < -1.6500000000000001e-6Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
if -1.6500000000000001e-6 < z0 Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(let* ((t_0 (log (- 1.0 z0))))
(if (<= t_0 250.0)
(/ (* -1.0 z0) (/ (- (* (/ z3 (* (- z4) z4)) z2) (/ z1 z2)) z2))
(* (- (* t_0 (/ z4 z3))) z4))))double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = log((1.0 - z0));
double tmp;
if (t_0 <= 250.0) {
tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2);
} else {
tmp = -(t_0 * (z4 / z3)) * z4;
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: t_0
real(8) :: tmp
t_0 = log((1.0d0 - z0))
if (t_0 <= 250.0d0) then
tmp = ((-1.0d0) * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2)
else
tmp = -(t_0 * (z4 / z3)) * z4
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = Math.log((1.0 - z0));
double tmp;
if (t_0 <= 250.0) {
tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2);
} else {
tmp = -(t_0 * (z4 / z3)) * z4;
}
return tmp;
}
def code(z0, z3, z4, z1, z2): t_0 = math.log((1.0 - z0)) tmp = 0 if t_0 <= 250.0: tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2) else: tmp = -(t_0 * (z4 / z3)) * z4 return tmp
function code(z0, z3, z4, z1, z2) t_0 = log(Float64(1.0 - z0)) tmp = 0.0 if (t_0 <= 250.0) tmp = Float64(Float64(-1.0 * z0) / Float64(Float64(Float64(Float64(z3 / Float64(Float64(-z4) * z4)) * z2) - Float64(z1 / z2)) / z2)); else tmp = Float64(Float64(-Float64(t_0 * Float64(z4 / z3))) * z4); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) t_0 = log((1.0 - z0)); tmp = 0.0; if (t_0 <= 250.0) tmp = (-1.0 * z0) / ((((z3 / (-z4 * z4)) * z2) - (z1 / z2)) / z2); else tmp = -(t_0 * (z4 / z3)) * z4; end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := Block[{t$95$0 = N[Log[N[(1.0 - z0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 250.0], N[(N[(-1.0 * z0), $MachinePrecision] / N[(N[(N[(N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision] * z2), $MachinePrecision] - N[(z1 / z2), $MachinePrecision]), $MachinePrecision] / z2), $MachinePrecision]), $MachinePrecision], N[((-N[(t$95$0 * N[(z4 / z3), $MachinePrecision]), $MachinePrecision]) * z4), $MachinePrecision]]]
\begin{array}{l}
t_0 := \log \left(1 - z0\right)\\
\mathbf{if}\;t\_0 \leq 250:\\
\;\;\;\;\frac{-1 \cdot z0}{\frac{\frac{z3}{\left(-z4\right) \cdot z4} \cdot z2 - \frac{z1}{z2}}{z2}}\\
\mathbf{else}:\\
\;\;\;\;\left(-t\_0 \cdot \frac{z4}{z3}\right) \cdot z4\\
\end{array}
if (log.f64 (-.f64 #s(literal 1 binary64) z0)) < 250Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
if 250 < (log.f64 (-.f64 #s(literal 1 binary64) z0)) Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in z3 around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6459.7%
lift-/.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-/.f32N/A
lower-unsound-/.f32N/A
lower-*.f64N/A
lift--.f64N/A
lift-log.f64N/A
lower-unsound-/.f6456.6%
Applied rewrites56.6%
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(if (<= (fabs z2) 9e+208)
(/
(* -1.0 z0)
(/
(/
1.0
(/
(fabs z2)
(- (* (* (fabs z2) (/ z3 (* (- z4) z4))) (fabs z2)) z1)))
(fabs z2)))
(*
(*
-1.0
(/
(*
z0
(+
(* -1.0 z4)
(* z0 (+ (* -0.5 z4) (* -0.3333333333333333 (* z0 z4))))))
z3))
z4)))double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (fabs(z2) <= 9e+208) {
tmp = (-1.0 * z0) / ((1.0 / (fabs(z2) / (((fabs(z2) * (z3 / (-z4 * z4))) * fabs(z2)) - z1))) / fabs(z2));
} else {
tmp = (-1.0 * ((z0 * ((-1.0 * z4) + (z0 * ((-0.5 * z4) + (-0.3333333333333333 * (z0 * z4)))))) / z3)) * z4;
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: tmp
if (abs(z2) <= 9d+208) then
tmp = ((-1.0d0) * z0) / ((1.0d0 / (abs(z2) / (((abs(z2) * (z3 / (-z4 * z4))) * abs(z2)) - z1))) / abs(z2))
else
tmp = ((-1.0d0) * ((z0 * (((-1.0d0) * z4) + (z0 * (((-0.5d0) * z4) + ((-0.3333333333333333d0) * (z0 * z4)))))) / z3)) * z4
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (Math.abs(z2) <= 9e+208) {
tmp = (-1.0 * z0) / ((1.0 / (Math.abs(z2) / (((Math.abs(z2) * (z3 / (-z4 * z4))) * Math.abs(z2)) - z1))) / Math.abs(z2));
} else {
tmp = (-1.0 * ((z0 * ((-1.0 * z4) + (z0 * ((-0.5 * z4) + (-0.3333333333333333 * (z0 * z4)))))) / z3)) * z4;
}
return tmp;
}
def code(z0, z3, z4, z1, z2): tmp = 0 if math.fabs(z2) <= 9e+208: tmp = (-1.0 * z0) / ((1.0 / (math.fabs(z2) / (((math.fabs(z2) * (z3 / (-z4 * z4))) * math.fabs(z2)) - z1))) / math.fabs(z2)) else: tmp = (-1.0 * ((z0 * ((-1.0 * z4) + (z0 * ((-0.5 * z4) + (-0.3333333333333333 * (z0 * z4)))))) / z3)) * z4 return tmp
function code(z0, z3, z4, z1, z2) tmp = 0.0 if (abs(z2) <= 9e+208) tmp = Float64(Float64(-1.0 * z0) / Float64(Float64(1.0 / Float64(abs(z2) / Float64(Float64(Float64(abs(z2) * Float64(z3 / Float64(Float64(-z4) * z4))) * abs(z2)) - z1))) / abs(z2))); else tmp = Float64(Float64(-1.0 * Float64(Float64(z0 * Float64(Float64(-1.0 * z4) + Float64(z0 * Float64(Float64(-0.5 * z4) + Float64(-0.3333333333333333 * Float64(z0 * z4)))))) / z3)) * z4); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) tmp = 0.0; if (abs(z2) <= 9e+208) tmp = (-1.0 * z0) / ((1.0 / (abs(z2) / (((abs(z2) * (z3 / (-z4 * z4))) * abs(z2)) - z1))) / abs(z2)); else tmp = (-1.0 * ((z0 * ((-1.0 * z4) + (z0 * ((-0.5 * z4) + (-0.3333333333333333 * (z0 * z4)))))) / z3)) * z4; end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := If[LessEqual[N[Abs[z2], $MachinePrecision], 9e+208], N[(N[(-1.0 * z0), $MachinePrecision] / N[(N[(1.0 / N[(N[Abs[z2], $MachinePrecision] / N[(N[(N[(N[Abs[z2], $MachinePrecision] * N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[z2], $MachinePrecision]), $MachinePrecision] - z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * N[(N[(z0 * N[(N[(-1.0 * z4), $MachinePrecision] + N[(z0 * N[(N[(-0.5 * z4), $MachinePrecision] + N[(-0.3333333333333333 * N[(z0 * z4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z3), $MachinePrecision]), $MachinePrecision] * z4), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|z2\right| \leq 9 \cdot 10^{+208}:\\
\;\;\;\;\frac{-1 \cdot z0}{\frac{\frac{1}{\frac{\left|z2\right|}{\left(\left|z2\right| \cdot \frac{z3}{\left(-z4\right) \cdot z4}\right) \cdot \left|z2\right| - z1}}}{\left|z2\right|}}\\
\mathbf{else}:\\
\;\;\;\;\left(-1 \cdot \frac{z0 \cdot \left(-1 \cdot z4 + z0 \cdot \left(-0.5 \cdot z4 + -0.3333333333333333 \cdot \left(z0 \cdot z4\right)\right)\right)}{z3}\right) \cdot z4\\
\end{array}
if z2 < 9.0000000000000003e208Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-flipN/A
lower-unsound-/.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-unsound-/.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower--.f64N/A
Applied rewrites74.4%
if 9.0000000000000003e208 < z2 Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in z3 around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in z0 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6443.3%
Applied rewrites43.3%
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(let* ((t_0 (/ z3 (* (- z4) z4))))
(if (<= (fabs z2) 4e-118)
(*
(* (/ (- z0) (- (* (* (fabs z2) t_0) (fabs z2)) z1)) (fabs z2))
(fabs z2))
(if (<= (fabs z2) 3.6e+199)
(/ (- (- z0)) (- (/ z1 (* (fabs z2) (fabs z2))) t_0))
(* (* (/ z4 z3) z0) z4)))))double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z3 / (-z4 * z4);
double tmp;
if (fabs(z2) <= 4e-118) {
tmp = ((-z0 / (((fabs(z2) * t_0) * fabs(z2)) - z1)) * fabs(z2)) * fabs(z2);
} else if (fabs(z2) <= 3.6e+199) {
tmp = -(-z0) / ((z1 / (fabs(z2) * fabs(z2))) - t_0);
} else {
tmp = ((z4 / z3) * z0) * z4;
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: t_0
real(8) :: tmp
t_0 = z3 / (-z4 * z4)
if (abs(z2) <= 4d-118) then
tmp = ((-z0 / (((abs(z2) * t_0) * abs(z2)) - z1)) * abs(z2)) * abs(z2)
else if (abs(z2) <= 3.6d+199) then
tmp = -(-z0) / ((z1 / (abs(z2) * abs(z2))) - t_0)
else
tmp = ((z4 / z3) * z0) * z4
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z3 / (-z4 * z4);
double tmp;
if (Math.abs(z2) <= 4e-118) {
tmp = ((-z0 / (((Math.abs(z2) * t_0) * Math.abs(z2)) - z1)) * Math.abs(z2)) * Math.abs(z2);
} else if (Math.abs(z2) <= 3.6e+199) {
tmp = -(-z0) / ((z1 / (Math.abs(z2) * Math.abs(z2))) - t_0);
} else {
tmp = ((z4 / z3) * z0) * z4;
}
return tmp;
}
def code(z0, z3, z4, z1, z2): t_0 = z3 / (-z4 * z4) tmp = 0 if math.fabs(z2) <= 4e-118: tmp = ((-z0 / (((math.fabs(z2) * t_0) * math.fabs(z2)) - z1)) * math.fabs(z2)) * math.fabs(z2) elif math.fabs(z2) <= 3.6e+199: tmp = -(-z0) / ((z1 / (math.fabs(z2) * math.fabs(z2))) - t_0) else: tmp = ((z4 / z3) * z0) * z4 return tmp
function code(z0, z3, z4, z1, z2) t_0 = Float64(z3 / Float64(Float64(-z4) * z4)) tmp = 0.0 if (abs(z2) <= 4e-118) tmp = Float64(Float64(Float64(Float64(-z0) / Float64(Float64(Float64(abs(z2) * t_0) * abs(z2)) - z1)) * abs(z2)) * abs(z2)); elseif (abs(z2) <= 3.6e+199) tmp = Float64(Float64(-Float64(-z0)) / Float64(Float64(z1 / Float64(abs(z2) * abs(z2))) - t_0)); else tmp = Float64(Float64(Float64(z4 / z3) * z0) * z4); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) t_0 = z3 / (-z4 * z4); tmp = 0.0; if (abs(z2) <= 4e-118) tmp = ((-z0 / (((abs(z2) * t_0) * abs(z2)) - z1)) * abs(z2)) * abs(z2); elseif (abs(z2) <= 3.6e+199) tmp = -(-z0) / ((z1 / (abs(z2) * abs(z2))) - t_0); else tmp = ((z4 / z3) * z0) * z4; end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := Block[{t$95$0 = N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[z2], $MachinePrecision], 4e-118], N[(N[(N[((-z0) / N[(N[(N[(N[Abs[z2], $MachinePrecision] * t$95$0), $MachinePrecision] * N[Abs[z2], $MachinePrecision]), $MachinePrecision] - z1), $MachinePrecision]), $MachinePrecision] * N[Abs[z2], $MachinePrecision]), $MachinePrecision] * N[Abs[z2], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[z2], $MachinePrecision], 3.6e+199], N[((-(-z0)) / N[(N[(z1 / N[(N[Abs[z2], $MachinePrecision] * N[Abs[z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z4 / z3), $MachinePrecision] * z0), $MachinePrecision] * z4), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{z3}{\left(-z4\right) \cdot z4}\\
\mathbf{if}\;\left|z2\right| \leq 4 \cdot 10^{-118}:\\
\;\;\;\;\left(\frac{-z0}{\left(\left|z2\right| \cdot t\_0\right) \cdot \left|z2\right| - z1} \cdot \left|z2\right|\right) \cdot \left|z2\right|\\
\mathbf{elif}\;\left|z2\right| \leq 3.6 \cdot 10^{+199}:\\
\;\;\;\;\frac{-\left(-z0\right)}{\frac{z1}{\left|z2\right| \cdot \left|z2\right|} - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z4}{z3} \cdot z0\right) \cdot z4\\
\end{array}
if z2 < 3.9999999999999999e-118Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.1%
if 3.9999999999999999e-118 < z2 < 3.6e199Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-neg.f64N/A
lower-neg.f64N/A
lower-neg.f64N/A
Applied rewrites71.8%
if 3.6e199 < z2 Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in z3 around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in z0 around 0
lower-/.f64N/A
lower-*.f6446.6%
Applied rewrites46.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.0%
Applied rewrites47.0%
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(if (<= (fabs z2) 4.1e-118)
(/ (* -1.0 z0) (/ (* -1.0 (/ z1 (fabs z2))) (fabs z2)))
(if (<= (fabs z2) 9e+208)
(/
(- (- z0))
(- (/ z1 (* (fabs z2) (fabs z2))) (/ z3 (* (- z4) z4))))
(* (* (/ z4 z3) z0) z4))))double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (fabs(z2) <= 4.1e-118) {
tmp = (-1.0 * z0) / ((-1.0 * (z1 / fabs(z2))) / fabs(z2));
} else if (fabs(z2) <= 9e+208) {
tmp = -(-z0) / ((z1 / (fabs(z2) * fabs(z2))) - (z3 / (-z4 * z4)));
} else {
tmp = ((z4 / z3) * z0) * z4;
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: tmp
if (abs(z2) <= 4.1d-118) then
tmp = ((-1.0d0) * z0) / (((-1.0d0) * (z1 / abs(z2))) / abs(z2))
else if (abs(z2) <= 9d+208) then
tmp = -(-z0) / ((z1 / (abs(z2) * abs(z2))) - (z3 / (-z4 * z4)))
else
tmp = ((z4 / z3) * z0) * z4
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (Math.abs(z2) <= 4.1e-118) {
tmp = (-1.0 * z0) / ((-1.0 * (z1 / Math.abs(z2))) / Math.abs(z2));
} else if (Math.abs(z2) <= 9e+208) {
tmp = -(-z0) / ((z1 / (Math.abs(z2) * Math.abs(z2))) - (z3 / (-z4 * z4)));
} else {
tmp = ((z4 / z3) * z0) * z4;
}
return tmp;
}
def code(z0, z3, z4, z1, z2): tmp = 0 if math.fabs(z2) <= 4.1e-118: tmp = (-1.0 * z0) / ((-1.0 * (z1 / math.fabs(z2))) / math.fabs(z2)) elif math.fabs(z2) <= 9e+208: tmp = -(-z0) / ((z1 / (math.fabs(z2) * math.fabs(z2))) - (z3 / (-z4 * z4))) else: tmp = ((z4 / z3) * z0) * z4 return tmp
function code(z0, z3, z4, z1, z2) tmp = 0.0 if (abs(z2) <= 4.1e-118) tmp = Float64(Float64(-1.0 * z0) / Float64(Float64(-1.0 * Float64(z1 / abs(z2))) / abs(z2))); elseif (abs(z2) <= 9e+208) tmp = Float64(Float64(-Float64(-z0)) / Float64(Float64(z1 / Float64(abs(z2) * abs(z2))) - Float64(z3 / Float64(Float64(-z4) * z4)))); else tmp = Float64(Float64(Float64(z4 / z3) * z0) * z4); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) tmp = 0.0; if (abs(z2) <= 4.1e-118) tmp = (-1.0 * z0) / ((-1.0 * (z1 / abs(z2))) / abs(z2)); elseif (abs(z2) <= 9e+208) tmp = -(-z0) / ((z1 / (abs(z2) * abs(z2))) - (z3 / (-z4 * z4))); else tmp = ((z4 / z3) * z0) * z4; end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := If[LessEqual[N[Abs[z2], $MachinePrecision], 4.1e-118], N[(N[(-1.0 * z0), $MachinePrecision] / N[(N[(-1.0 * N[(z1 / N[Abs[z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[z2], $MachinePrecision], 9e+208], N[((-(-z0)) / N[(N[(z1 / N[(N[Abs[z2], $MachinePrecision] * N[Abs[z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z4 / z3), $MachinePrecision] * z0), $MachinePrecision] * z4), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\left|z2\right| \leq 4.1 \cdot 10^{-118}:\\
\;\;\;\;\frac{-1 \cdot z0}{\frac{-1 \cdot \frac{z1}{\left|z2\right|}}{\left|z2\right|}}\\
\mathbf{elif}\;\left|z2\right| \leq 9 \cdot 10^{+208}:\\
\;\;\;\;\frac{-\left(-z0\right)}{\frac{z1}{\left|z2\right| \cdot \left|z2\right|} - \frac{z3}{\left(-z4\right) \cdot z4}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z4}{z3} \cdot z0\right) \cdot z4\\
\end{array}
if z2 < 4.1000000000000003e-118Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
Taylor expanded in z3 around 0
lower-*.f64N/A
lower-/.f6447.7%
Applied rewrites47.7%
if 4.1000000000000003e-118 < z2 < 9.0000000000000003e208Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-neg.f64N/A
lower-neg.f64N/A
lower-neg.f64N/A
Applied rewrites71.8%
if 9.0000000000000003e208 < z2 Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in z3 around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in z0 around 0
lower-/.f64N/A
lower-*.f6446.6%
Applied rewrites46.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.0%
Applied rewrites47.0%
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(let* ((t_0 (/ z3 (* (- z4) z4))))
(if (<= (/ (log (- 1.0 z0)) (- t_0 (/ z1 (* z2 z2)))) 5e+16)
(/ (* -1.0 z0) (- t_0 (/ (/ z1 z2) z2)))
(* (* (/ z4 z3) z0) z4))))double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z3 / (-z4 * z4);
double tmp;
if ((log((1.0 - z0)) / (t_0 - (z1 / (z2 * z2)))) <= 5e+16) {
tmp = (-1.0 * z0) / (t_0 - ((z1 / z2) / z2));
} else {
tmp = ((z4 / z3) * z0) * z4;
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: t_0
real(8) :: tmp
t_0 = z3 / (-z4 * z4)
if ((log((1.0d0 - z0)) / (t_0 - (z1 / (z2 * z2)))) <= 5d+16) then
tmp = ((-1.0d0) * z0) / (t_0 - ((z1 / z2) / z2))
else
tmp = ((z4 / z3) * z0) * z4
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z3 / (-z4 * z4);
double tmp;
if ((Math.log((1.0 - z0)) / (t_0 - (z1 / (z2 * z2)))) <= 5e+16) {
tmp = (-1.0 * z0) / (t_0 - ((z1 / z2) / z2));
} else {
tmp = ((z4 / z3) * z0) * z4;
}
return tmp;
}
def code(z0, z3, z4, z1, z2): t_0 = z3 / (-z4 * z4) tmp = 0 if (math.log((1.0 - z0)) / (t_0 - (z1 / (z2 * z2)))) <= 5e+16: tmp = (-1.0 * z0) / (t_0 - ((z1 / z2) / z2)) else: tmp = ((z4 / z3) * z0) * z4 return tmp
function code(z0, z3, z4, z1, z2) t_0 = Float64(z3 / Float64(Float64(-z4) * z4)) tmp = 0.0 if (Float64(log(Float64(1.0 - z0)) / Float64(t_0 - Float64(z1 / Float64(z2 * z2)))) <= 5e+16) tmp = Float64(Float64(-1.0 * z0) / Float64(t_0 - Float64(Float64(z1 / z2) / z2))); else tmp = Float64(Float64(Float64(z4 / z3) * z0) * z4); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) t_0 = z3 / (-z4 * z4); tmp = 0.0; if ((log((1.0 - z0)) / (t_0 - (z1 / (z2 * z2)))) <= 5e+16) tmp = (-1.0 * z0) / (t_0 - ((z1 / z2) / z2)); else tmp = ((z4 / z3) * z0) * z4; end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := Block[{t$95$0 = N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Log[N[(1.0 - z0), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(z1 / N[(z2 * z2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+16], N[(N[(-1.0 * z0), $MachinePrecision] / N[(t$95$0 - N[(N[(z1 / z2), $MachinePrecision] / z2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z4 / z3), $MachinePrecision] * z0), $MachinePrecision] * z4), $MachinePrecision]]]
\begin{array}{l}
t_0 := \frac{z3}{\left(-z4\right) \cdot z4}\\
\mathbf{if}\;\frac{\log \left(1 - z0\right)}{t\_0 - \frac{z1}{z2 \cdot z2}} \leq 5 \cdot 10^{+16}:\\
\;\;\;\;\frac{-1 \cdot z0}{t\_0 - \frac{\frac{z1}{z2}}{z2}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z4}{z3} \cdot z0\right) \cdot z4\\
\end{array}
if (/.f64 (log.f64 (-.f64 #s(literal 1 binary64) z0)) (-.f64 (/.f64 z3 (*.f64 (neg.f64 z4) z4)) (/.f64 z1 (*.f64 z2 z2)))) < 5e16Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6474.9%
Applied rewrites74.9%
if 5e16 < (/.f64 (log.f64 (-.f64 #s(literal 1 binary64) z0)) (-.f64 (/.f64 z3 (*.f64 (neg.f64 z4) z4)) (/.f64 z1 (*.f64 z2 z2)))) Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in z3 around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in z0 around 0
lower-/.f64N/A
lower-*.f6446.6%
Applied rewrites46.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.0%
Applied rewrites47.0%
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(if (<= (fabs z2) 9.2e-119)
(/ (* -1.0 z0) (/ (* -1.0 (/ z1 (fabs z2))) (fabs z2)))
(if (<= (fabs z2) 3.6e+199)
(/ (- z0) (- (/ z3 (* (- z4) z4)) (/ z1 (* (fabs z2) (fabs z2)))))
(* (* (/ z4 z3) z0) z4))))double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (fabs(z2) <= 9.2e-119) {
tmp = (-1.0 * z0) / ((-1.0 * (z1 / fabs(z2))) / fabs(z2));
} else if (fabs(z2) <= 3.6e+199) {
tmp = -z0 / ((z3 / (-z4 * z4)) - (z1 / (fabs(z2) * fabs(z2))));
} else {
tmp = ((z4 / z3) * z0) * z4;
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: tmp
if (abs(z2) <= 9.2d-119) then
tmp = ((-1.0d0) * z0) / (((-1.0d0) * (z1 / abs(z2))) / abs(z2))
else if (abs(z2) <= 3.6d+199) then
tmp = -z0 / ((z3 / (-z4 * z4)) - (z1 / (abs(z2) * abs(z2))))
else
tmp = ((z4 / z3) * z0) * z4
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if (Math.abs(z2) <= 9.2e-119) {
tmp = (-1.0 * z0) / ((-1.0 * (z1 / Math.abs(z2))) / Math.abs(z2));
} else if (Math.abs(z2) <= 3.6e+199) {
tmp = -z0 / ((z3 / (-z4 * z4)) - (z1 / (Math.abs(z2) * Math.abs(z2))));
} else {
tmp = ((z4 / z3) * z0) * z4;
}
return tmp;
}
def code(z0, z3, z4, z1, z2): tmp = 0 if math.fabs(z2) <= 9.2e-119: tmp = (-1.0 * z0) / ((-1.0 * (z1 / math.fabs(z2))) / math.fabs(z2)) elif math.fabs(z2) <= 3.6e+199: tmp = -z0 / ((z3 / (-z4 * z4)) - (z1 / (math.fabs(z2) * math.fabs(z2)))) else: tmp = ((z4 / z3) * z0) * z4 return tmp
function code(z0, z3, z4, z1, z2) tmp = 0.0 if (abs(z2) <= 9.2e-119) tmp = Float64(Float64(-1.0 * z0) / Float64(Float64(-1.0 * Float64(z1 / abs(z2))) / abs(z2))); elseif (abs(z2) <= 3.6e+199) tmp = Float64(Float64(-z0) / Float64(Float64(z3 / Float64(Float64(-z4) * z4)) - Float64(z1 / Float64(abs(z2) * abs(z2))))); else tmp = Float64(Float64(Float64(z4 / z3) * z0) * z4); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) tmp = 0.0; if (abs(z2) <= 9.2e-119) tmp = (-1.0 * z0) / ((-1.0 * (z1 / abs(z2))) / abs(z2)); elseif (abs(z2) <= 3.6e+199) tmp = -z0 / ((z3 / (-z4 * z4)) - (z1 / (abs(z2) * abs(z2)))); else tmp = ((z4 / z3) * z0) * z4; end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := If[LessEqual[N[Abs[z2], $MachinePrecision], 9.2e-119], N[(N[(-1.0 * z0), $MachinePrecision] / N[(N[(-1.0 * N[(z1 / N[Abs[z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[z2], $MachinePrecision], 3.6e+199], N[((-z0) / N[(N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision] - N[(z1 / N[(N[Abs[z2], $MachinePrecision] * N[Abs[z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z4 / z3), $MachinePrecision] * z0), $MachinePrecision] * z4), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\left|z2\right| \leq 9.2 \cdot 10^{-119}:\\
\;\;\;\;\frac{-1 \cdot z0}{\frac{-1 \cdot \frac{z1}{\left|z2\right|}}{\left|z2\right|}}\\
\mathbf{elif}\;\left|z2\right| \leq 3.6 \cdot 10^{+199}:\\
\;\;\;\;\frac{-z0}{\frac{z3}{\left(-z4\right) \cdot z4} - \frac{z1}{\left|z2\right| \cdot \left|z2\right|}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z4}{z3} \cdot z0\right) \cdot z4\\
\end{array}
if z2 < 9.1999999999999997e-119Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
Taylor expanded in z3 around 0
lower-*.f64N/A
lower-/.f6447.7%
Applied rewrites47.7%
if 9.1999999999999997e-119 < z2 < 3.6e199Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6471.9%
Applied rewrites71.9%
if 3.6e199 < z2 Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in z3 around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in z0 around 0
lower-/.f64N/A
lower-*.f6446.6%
Applied rewrites46.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.0%
Applied rewrites47.0%
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(let* ((t_0 (/ z3 (* (- z4) z4))) (t_1 (/ z1 (* z2 z2))))
(if (<= (- t_0 t_1) 5e+171)
(/ (- z0) (- (/ (/ (- z3) z4) z4) t_1))
(* (* (/ (- z0) (- (* (* z2 t_0) z2) z1)) z2) z2))))double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z3 / (-z4 * z4);
double t_1 = z1 / (z2 * z2);
double tmp;
if ((t_0 - t_1) <= 5e+171) {
tmp = -z0 / (((-z3 / z4) / z4) - t_1);
} else {
tmp = ((-z0 / (((z2 * t_0) * z2) - z1)) * z2) * z2;
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z3 / (-z4 * z4)
t_1 = z1 / (z2 * z2)
if ((t_0 - t_1) <= 5d+171) then
tmp = -z0 / (((-z3 / z4) / z4) - t_1)
else
tmp = ((-z0 / (((z2 * t_0) * z2) - z1)) * z2) * z2
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z3 / (-z4 * z4);
double t_1 = z1 / (z2 * z2);
double tmp;
if ((t_0 - t_1) <= 5e+171) {
tmp = -z0 / (((-z3 / z4) / z4) - t_1);
} else {
tmp = ((-z0 / (((z2 * t_0) * z2) - z1)) * z2) * z2;
}
return tmp;
}
def code(z0, z3, z4, z1, z2): t_0 = z3 / (-z4 * z4) t_1 = z1 / (z2 * z2) tmp = 0 if (t_0 - t_1) <= 5e+171: tmp = -z0 / (((-z3 / z4) / z4) - t_1) else: tmp = ((-z0 / (((z2 * t_0) * z2) - z1)) * z2) * z2 return tmp
function code(z0, z3, z4, z1, z2) t_0 = Float64(z3 / Float64(Float64(-z4) * z4)) t_1 = Float64(z1 / Float64(z2 * z2)) tmp = 0.0 if (Float64(t_0 - t_1) <= 5e+171) tmp = Float64(Float64(-z0) / Float64(Float64(Float64(Float64(-z3) / z4) / z4) - t_1)); else tmp = Float64(Float64(Float64(Float64(-z0) / Float64(Float64(Float64(z2 * t_0) * z2) - z1)) * z2) * z2); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) t_0 = z3 / (-z4 * z4); t_1 = z1 / (z2 * z2); tmp = 0.0; if ((t_0 - t_1) <= 5e+171) tmp = -z0 / (((-z3 / z4) / z4) - t_1); else tmp = ((-z0 / (((z2 * t_0) * z2) - z1)) * z2) * z2; end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := Block[{t$95$0 = N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z1 / N[(z2 * z2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - t$95$1), $MachinePrecision], 5e+171], N[((-z0) / N[(N[(N[((-z3) / z4), $MachinePrecision] / z4), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[((-z0) / N[(N[(N[(z2 * t$95$0), $MachinePrecision] * z2), $MachinePrecision] - z1), $MachinePrecision]), $MachinePrecision] * z2), $MachinePrecision] * z2), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{z3}{\left(-z4\right) \cdot z4}\\
t_1 := \frac{z1}{z2 \cdot z2}\\
\mathbf{if}\;t\_0 - t\_1 \leq 5 \cdot 10^{+171}:\\
\;\;\;\;\frac{-z0}{\frac{\frac{-z3}{z4}}{z4} - t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{-z0}{\left(z2 \cdot t\_0\right) \cdot z2 - z1} \cdot z2\right) \cdot z2\\
\end{array}
if (-.f64 (/.f64 z3 (*.f64 (neg.f64 z4) z4)) (/.f64 z1 (*.f64 z2 z2))) < 5.0000000000000004e171Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6471.9%
Applied rewrites71.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-neg.f64N/A
distribute-neg-frac2N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6475.1%
Applied rewrites75.1%
if 5.0000000000000004e171 < (-.f64 (/.f64 z3 (*.f64 (neg.f64 z4) z4)) (/.f64 z1 (*.f64 z2 z2))) Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.1%
(FPCore (z0 z3 z4 z1 z2) :precision binary64 (if (<= (* z2 z2) 5e+297) (* (/ (* z2 z2) (- (* (* (/ z3 (* (- z4) z4)) z2) z2) z1)) (- z0)) (* (* (/ z4 z3) z0) z4)))
double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if ((z2 * z2) <= 5e+297) {
tmp = ((z2 * z2) / ((((z3 / (-z4 * z4)) * z2) * z2) - z1)) * -z0;
} else {
tmp = ((z4 / z3) * z0) * z4;
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: tmp
if ((z2 * z2) <= 5d+297) then
tmp = ((z2 * z2) / ((((z3 / (-z4 * z4)) * z2) * z2) - z1)) * -z0
else
tmp = ((z4 / z3) * z0) * z4
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double tmp;
if ((z2 * z2) <= 5e+297) {
tmp = ((z2 * z2) / ((((z3 / (-z4 * z4)) * z2) * z2) - z1)) * -z0;
} else {
tmp = ((z4 / z3) * z0) * z4;
}
return tmp;
}
def code(z0, z3, z4, z1, z2): tmp = 0 if (z2 * z2) <= 5e+297: tmp = ((z2 * z2) / ((((z3 / (-z4 * z4)) * z2) * z2) - z1)) * -z0 else: tmp = ((z4 / z3) * z0) * z4 return tmp
function code(z0, z3, z4, z1, z2) tmp = 0.0 if (Float64(z2 * z2) <= 5e+297) tmp = Float64(Float64(Float64(z2 * z2) / Float64(Float64(Float64(Float64(z3 / Float64(Float64(-z4) * z4)) * z2) * z2) - z1)) * Float64(-z0)); else tmp = Float64(Float64(Float64(z4 / z3) * z0) * z4); end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) tmp = 0.0; if ((z2 * z2) <= 5e+297) tmp = ((z2 * z2) / ((((z3 / (-z4 * z4)) * z2) * z2) - z1)) * -z0; else tmp = ((z4 / z3) * z0) * z4; end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := If[LessEqual[N[(z2 * z2), $MachinePrecision], 5e+297], N[(N[(N[(z2 * z2), $MachinePrecision] / N[(N[(N[(N[(z3 / N[((-z4) * z4), $MachinePrecision]), $MachinePrecision] * z2), $MachinePrecision] * z2), $MachinePrecision] - z1), $MachinePrecision]), $MachinePrecision] * (-z0)), $MachinePrecision], N[(N[(N[(z4 / z3), $MachinePrecision] * z0), $MachinePrecision] * z4), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z2 \cdot z2 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;\frac{z2 \cdot z2}{\left(\frac{z3}{\left(-z4\right) \cdot z4} \cdot z2\right) \cdot z2 - z1} \cdot \left(-z0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z4}{z3} \cdot z0\right) \cdot z4\\
\end{array}
if (*.f64 z2 z2) < 4.9999999999999998e297Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6471.9%
Applied rewrites71.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
lower-/.f6474.9%
Applied rewrites74.9%
Applied rewrites62.4%
if 4.9999999999999998e297 < (*.f64 z2 z2) Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in z3 around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in z0 around 0
lower-/.f64N/A
lower-*.f6446.6%
Applied rewrites46.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.0%
Applied rewrites47.0%
(FPCore (z0 z3 z4 z1 z2)
:precision binary64
(let* ((t_0 (/ z1 (* z2 z2)))
(t_1 (/ (* -1.0 z0) (/ (* -1.0 (/ z1 z2)) z2))))
(if (<= t_0 -1e+23)
t_1
(if (<= t_0 5e+32) (* (* (/ z4 z3) z0) z4) t_1))))double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z1 / (z2 * z2);
double t_1 = (-1.0 * z0) / ((-1.0 * (z1 / z2)) / z2);
double tmp;
if (t_0 <= -1e+23) {
tmp = t_1;
} else if (t_0 <= 5e+32) {
tmp = ((z4 / z3) * z0) * z4;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(z0, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z1 / (z2 * z2)
t_1 = ((-1.0d0) * z0) / (((-1.0d0) * (z1 / z2)) / z2)
if (t_0 <= (-1d+23)) then
tmp = t_1
else if (t_0 <= 5d+32) then
tmp = ((z4 / z3) * z0) * z4
else
tmp = t_1
end if
code = tmp
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
double t_0 = z1 / (z2 * z2);
double t_1 = (-1.0 * z0) / ((-1.0 * (z1 / z2)) / z2);
double tmp;
if (t_0 <= -1e+23) {
tmp = t_1;
} else if (t_0 <= 5e+32) {
tmp = ((z4 / z3) * z0) * z4;
} else {
tmp = t_1;
}
return tmp;
}
def code(z0, z3, z4, z1, z2): t_0 = z1 / (z2 * z2) t_1 = (-1.0 * z0) / ((-1.0 * (z1 / z2)) / z2) tmp = 0 if t_0 <= -1e+23: tmp = t_1 elif t_0 <= 5e+32: tmp = ((z4 / z3) * z0) * z4 else: tmp = t_1 return tmp
function code(z0, z3, z4, z1, z2) t_0 = Float64(z1 / Float64(z2 * z2)) t_1 = Float64(Float64(-1.0 * z0) / Float64(Float64(-1.0 * Float64(z1 / z2)) / z2)) tmp = 0.0 if (t_0 <= -1e+23) tmp = t_1; elseif (t_0 <= 5e+32) tmp = Float64(Float64(Float64(z4 / z3) * z0) * z4); else tmp = t_1; end return tmp end
function tmp_2 = code(z0, z3, z4, z1, z2) t_0 = z1 / (z2 * z2); t_1 = (-1.0 * z0) / ((-1.0 * (z1 / z2)) / z2); tmp = 0.0; if (t_0 <= -1e+23) tmp = t_1; elseif (t_0 <= 5e+32) tmp = ((z4 / z3) * z0) * z4; else tmp = t_1; end tmp_2 = tmp; end
code[z0_, z3_, z4_, z1_, z2_] := Block[{t$95$0 = N[(z1 / N[(z2 * z2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 * z0), $MachinePrecision] / N[(N[(-1.0 * N[(z1 / z2), $MachinePrecision]), $MachinePrecision] / z2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+23], t$95$1, If[LessEqual[t$95$0, 5e+32], N[(N[(N[(z4 / z3), $MachinePrecision] * z0), $MachinePrecision] * z4), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_0 := \frac{z1}{z2 \cdot z2}\\
t_1 := \frac{-1 \cdot z0}{\frac{-1 \cdot \frac{z1}{z2}}{z2}}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+32}:\\
\;\;\;\;\left(\frac{z4}{z3} \cdot z0\right) \cdot z4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 z1 (*.f64 z2 z2)) < -9.9999999999999992e22 or 4.9999999999999997e32 < (/.f64 z1 (*.f64 z2 z2)) Initial program 65.6%
Taylor expanded in z0 around 0
lower-*.f6471.9%
Applied rewrites71.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
Taylor expanded in z3 around 0
lower-*.f64N/A
lower-/.f6447.7%
Applied rewrites47.7%
if -9.9999999999999992e22 < (/.f64 z1 (*.f64 z2 z2)) < 4.9999999999999997e32Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in z3 around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in z0 around 0
lower-/.f64N/A
lower-*.f6446.6%
Applied rewrites46.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.0%
Applied rewrites47.0%
(FPCore (z0 z3 z4 z1 z2) :precision binary64 (* (* z4 (/ z0 z3)) z4))
double code(double z0, double z3, double z4, double z1, double z2) {
return (z4 * (z0 / z3)) * z4;
}
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, z3, z4, z1, z2)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z3
real(8), intent (in) :: z4
real(8), intent (in) :: z1
real(8), intent (in) :: z2
code = (z4 * (z0 / z3)) * z4
end function
public static double code(double z0, double z3, double z4, double z1, double z2) {
return (z4 * (z0 / z3)) * z4;
}
def code(z0, z3, z4, z1, z2): return (z4 * (z0 / z3)) * z4
function code(z0, z3, z4, z1, z2) return Float64(Float64(z4 * Float64(z0 / z3)) * z4) end
function tmp = code(z0, z3, z4, z1, z2) tmp = (z4 * (z0 / z3)) * z4; end
code[z0_, z3_, z4_, z1_, z2_] := N[(N[(z4 * N[(z0 / z3), $MachinePrecision]), $MachinePrecision] * z4), $MachinePrecision]
\left(z4 \cdot \frac{z0}{z3}\right) \cdot z4
Initial program 65.6%
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-to-fractionN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in z3 around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in z0 around 0
lower-/.f64N/A
lower-*.f6446.6%
Applied rewrites46.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6446.4%
Applied rewrites46.4%
herbie shell --seed 2025250
(FPCore (z0 z3 z4 z1 z2)
:name "(/ (log (- 1 z0)) (- (/ z3 (* (- z4) z4)) (/ z1 (* z2 z2))))"
:precision binary64
(/ (log (- 1.0 z0)) (- (/ z3 (* (- z4) z4)) (/ z1 (* z2 z2)))))