
(FPCore (z0 z1) :precision binary64 (/ (- -0.053051646556513725 (/ (* -0.02210485264800276 z0) z1)) z1))
double code(double z0, double z1) {
return (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / 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 = ((-0.053051646556513725d0) - (((-0.02210485264800276d0) * z0) / z1)) / z1
end function
public static double code(double z0, double z1) {
return (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
}
def code(z0, z1): return (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1
function code(z0, z1) return Float64(Float64(-0.053051646556513725 - Float64(Float64(-0.02210485264800276 * z0) / z1)) / z1) end
function tmp = code(z0, z1) tmp = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1; end
code[z0_, z1_] := N[(N[(-0.053051646556513725 - N[(N[(-0.02210485264800276 * z0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]
\frac{-0.053051646556513725 - \frac{-0.02210485264800276 \cdot z0}{z1}}{z1}
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (z0 z1) :precision binary64 (/ (- -0.053051646556513725 (/ (* -0.02210485264800276 z0) z1)) z1))
double code(double z0, double z1) {
return (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / 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 = ((-0.053051646556513725d0) - (((-0.02210485264800276d0) * z0) / z1)) / z1
end function
public static double code(double z0, double z1) {
return (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
}
def code(z0, z1): return (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1
function code(z0, z1) return Float64(Float64(-0.053051646556513725 - Float64(Float64(-0.02210485264800276 * z0) / z1)) / z1) end
function tmp = code(z0, z1) tmp = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1; end
code[z0_, z1_] := N[(N[(-0.053051646556513725 - N[(N[(-0.02210485264800276 * z0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]
\frac{-0.053051646556513725 - \frac{-0.02210485264800276 \cdot z0}{z1}}{z1}
(FPCore (z0 z1) :precision binary64 (+ (/ -0.053051646556513725 z1) (* (/ z0 z1) (/ 0.02210485264800276 z1))))
double code(double z0, double z1) {
return (-0.053051646556513725 / z1) + ((z0 / z1) * (0.02210485264800276 / 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 = ((-0.053051646556513725d0) / z1) + ((z0 / z1) * (0.02210485264800276d0 / z1))
end function
public static double code(double z0, double z1) {
return (-0.053051646556513725 / z1) + ((z0 / z1) * (0.02210485264800276 / z1));
}
def code(z0, z1): return (-0.053051646556513725 / z1) + ((z0 / z1) * (0.02210485264800276 / z1))
function code(z0, z1) return Float64(Float64(-0.053051646556513725 / z1) + Float64(Float64(z0 / z1) * Float64(0.02210485264800276 / z1))) end
function tmp = code(z0, z1) tmp = (-0.053051646556513725 / z1) + ((z0 / z1) * (0.02210485264800276 / z1)); end
code[z0_, z1_] := N[(N[(-0.053051646556513725 / z1), $MachinePrecision] + N[(N[(z0 / z1), $MachinePrecision] * N[(0.02210485264800276 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{-0.053051646556513725}{z1} + \frac{z0}{z1} \cdot \frac{0.02210485264800276}{z1}
Initial program 99.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
associate-/l/N/A
sqr-neg-revN/A
lift-*.f64N/A
frac-timesN/A
distribute-neg-frac2N/A
fp-cancel-sub-sign-invN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
frac-2neg-revN/A
remove-double-negN/A
lower-/.f64N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6499.8%
Applied rewrites99.8%
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lift-/.f64N/A
frac-2negN/A
frac-timesN/A
lift-neg.f64N/A
remove-double-negN/A
*-commutativeN/A
times-fracN/A
metadata-evalN/A
frac-2negN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6499.8%
Applied rewrites99.8%
(FPCore (z0 z1) :precision binary64 (/ (- -0.053051646556513725 (* (/ -0.02210485264800276 z1) z0)) z1))
double code(double z0, double z1) {
return (-0.053051646556513725 - ((-0.02210485264800276 / z1) * z0)) / 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 = ((-0.053051646556513725d0) - (((-0.02210485264800276d0) / z1) * z0)) / z1
end function
public static double code(double z0, double z1) {
return (-0.053051646556513725 - ((-0.02210485264800276 / z1) * z0)) / z1;
}
def code(z0, z1): return (-0.053051646556513725 - ((-0.02210485264800276 / z1) * z0)) / z1
function code(z0, z1) return Float64(Float64(-0.053051646556513725 - Float64(Float64(-0.02210485264800276 / z1) * z0)) / z1) end
function tmp = code(z0, z1) tmp = (-0.053051646556513725 - ((-0.02210485264800276 / z1) * z0)) / z1; end
code[z0_, z1_] := N[(N[(-0.053051646556513725 - N[(N[(-0.02210485264800276 / z1), $MachinePrecision] * z0), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]
\frac{-0.053051646556513725 - \frac{-0.02210485264800276}{z1} \cdot z0}{z1}
Initial program 99.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8%
Applied rewrites99.8%
(FPCore (z0 z1)
:precision binary64
(if (<= z1 -2.05e+157)
(/ 1.0 (+ (* -18.84955632686615 z1) (* -7.853981773058572 z0)))
(if (<= z1 3.1e+164)
(/
(- (* z1 -0.053051646556513725) (* z0 -0.02210485264800276))
(* z1 z1))
(/ -0.053051646556513725 z1))))double code(double z0, double z1) {
double tmp;
if (z1 <= -2.05e+157) {
tmp = 1.0 / ((-18.84955632686615 * z1) + (-7.853981773058572 * z0));
} else if (z1 <= 3.1e+164) {
tmp = ((z1 * -0.053051646556513725) - (z0 * -0.02210485264800276)) / (z1 * z1);
} else {
tmp = -0.053051646556513725 / 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 (z1 <= (-2.05d+157)) then
tmp = 1.0d0 / (((-18.84955632686615d0) * z1) + ((-7.853981773058572d0) * z0))
else if (z1 <= 3.1d+164) then
tmp = ((z1 * (-0.053051646556513725d0)) - (z0 * (-0.02210485264800276d0))) / (z1 * z1)
else
tmp = (-0.053051646556513725d0) / z1
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if (z1 <= -2.05e+157) {
tmp = 1.0 / ((-18.84955632686615 * z1) + (-7.853981773058572 * z0));
} else if (z1 <= 3.1e+164) {
tmp = ((z1 * -0.053051646556513725) - (z0 * -0.02210485264800276)) / (z1 * z1);
} else {
tmp = -0.053051646556513725 / z1;
}
return tmp;
}
def code(z0, z1): tmp = 0 if z1 <= -2.05e+157: tmp = 1.0 / ((-18.84955632686615 * z1) + (-7.853981773058572 * z0)) elif z1 <= 3.1e+164: tmp = ((z1 * -0.053051646556513725) - (z0 * -0.02210485264800276)) / (z1 * z1) else: tmp = -0.053051646556513725 / z1 return tmp
function code(z0, z1) tmp = 0.0 if (z1 <= -2.05e+157) tmp = Float64(1.0 / Float64(Float64(-18.84955632686615 * z1) + Float64(-7.853981773058572 * z0))); elseif (z1 <= 3.1e+164) tmp = Float64(Float64(Float64(z1 * -0.053051646556513725) - Float64(z0 * -0.02210485264800276)) / Float64(z1 * z1)); else tmp = Float64(-0.053051646556513725 / z1); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if (z1 <= -2.05e+157) tmp = 1.0 / ((-18.84955632686615 * z1) + (-7.853981773058572 * z0)); elseif (z1 <= 3.1e+164) tmp = ((z1 * -0.053051646556513725) - (z0 * -0.02210485264800276)) / (z1 * z1); else tmp = -0.053051646556513725 / z1; end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[z1, -2.05e+157], N[(1.0 / N[(N[(-18.84955632686615 * z1), $MachinePrecision] + N[(-7.853981773058572 * z0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z1, 3.1e+164], N[(N[(N[(z1 * -0.053051646556513725), $MachinePrecision] - N[(z0 * -0.02210485264800276), $MachinePrecision]), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision], N[(-0.053051646556513725 / z1), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z1 \leq -2.05 \cdot 10^{+157}:\\
\;\;\;\;\frac{1}{-18.84955632686615 \cdot z1 + -7.853981773058572 \cdot z0}\\
\mathbf{elif}\;z1 \leq 3.1 \cdot 10^{+164}:\\
\;\;\;\;\frac{z1 \cdot -0.053051646556513725 - z0 \cdot -0.02210485264800276}{z1 \cdot z1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.053051646556513725}{z1}\\
\end{array}
if z1 < -2.0500000000000001e157Initial program 99.8%
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
mult-flipN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6469.9%
Applied rewrites69.9%
Taylor expanded in z0 around inf
lower-*.f6445.4%
Applied rewrites45.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6445.7%
Applied rewrites45.7%
Taylor expanded in z0 around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6450.2%
Applied rewrites50.2%
if -2.0500000000000001e157 < z1 < 3.1000000000000002e164Initial program 99.8%
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6470.3%
Applied rewrites70.3%
if 3.1000000000000002e164 < z1 Initial program 99.8%
Taylor expanded in z0 around 0
Applied rewrites51.4%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0
(/
(- -0.053051646556513725 (/ (* -0.02210485264800276 z0) z1))
z1)))
(if (<= t_0 -2e+86)
(/ (* (/ 0.02210485264800276 z1) z0) z1)
(if (<= t_0 2e+148)
(/ -0.053051646556513725 z1)
(/ (/ (* 0.02210485264800276 z0) z1) z1)))))double code(double z0, double z1) {
double t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
double tmp;
if (t_0 <= -2e+86) {
tmp = ((0.02210485264800276 / z1) * z0) / z1;
} else if (t_0 <= 2e+148) {
tmp = -0.053051646556513725 / z1;
} else {
tmp = ((0.02210485264800276 * z0) / 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 = ((-0.053051646556513725d0) - (((-0.02210485264800276d0) * z0) / z1)) / z1
if (t_0 <= (-2d+86)) then
tmp = ((0.02210485264800276d0 / z1) * z0) / z1
else if (t_0 <= 2d+148) then
tmp = (-0.053051646556513725d0) / z1
else
tmp = ((0.02210485264800276d0 * z0) / z1) / z1
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
double tmp;
if (t_0 <= -2e+86) {
tmp = ((0.02210485264800276 / z1) * z0) / z1;
} else if (t_0 <= 2e+148) {
tmp = -0.053051646556513725 / z1;
} else {
tmp = ((0.02210485264800276 * z0) / z1) / z1;
}
return tmp;
}
def code(z0, z1): t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1 tmp = 0 if t_0 <= -2e+86: tmp = ((0.02210485264800276 / z1) * z0) / z1 elif t_0 <= 2e+148: tmp = -0.053051646556513725 / z1 else: tmp = ((0.02210485264800276 * z0) / z1) / z1 return tmp
function code(z0, z1) t_0 = Float64(Float64(-0.053051646556513725 - Float64(Float64(-0.02210485264800276 * z0) / z1)) / z1) tmp = 0.0 if (t_0 <= -2e+86) tmp = Float64(Float64(Float64(0.02210485264800276 / z1) * z0) / z1); elseif (t_0 <= 2e+148) tmp = Float64(-0.053051646556513725 / z1); else tmp = Float64(Float64(Float64(0.02210485264800276 * z0) / z1) / z1); end return tmp end
function tmp_2 = code(z0, z1) t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1; tmp = 0.0; if (t_0 <= -2e+86) tmp = ((0.02210485264800276 / z1) * z0) / z1; elseif (t_0 <= 2e+148) tmp = -0.053051646556513725 / z1; else tmp = ((0.02210485264800276 * z0) / z1) / z1; end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(N[(-0.053051646556513725 - N[(N[(-0.02210485264800276 * z0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+86], N[(N[(N[(0.02210485264800276 / z1), $MachinePrecision] * z0), $MachinePrecision] / z1), $MachinePrecision], If[LessEqual[t$95$0, 2e+148], N[(-0.053051646556513725 / z1), $MachinePrecision], N[(N[(N[(0.02210485264800276 * z0), $MachinePrecision] / z1), $MachinePrecision] / z1), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{-0.053051646556513725 - \frac{-0.02210485264800276 \cdot z0}{z1}}{z1}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+86}:\\
\;\;\;\;\frac{\frac{0.02210485264800276}{z1} \cdot z0}{z1}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\frac{-0.053051646556513725}{z1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.02210485264800276 \cdot z0}{z1}}{z1}\\
\end{array}
if (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) < -2e86Initial program 99.8%
Taylor expanded in z0 around inf
lower-*.f64N/A
lower-/.f6451.1%
Applied rewrites51.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
metadata-evalN/A
lower-/.f6451.1%
Applied rewrites51.1%
if -2e86 < (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) < 2.0000000000000001e148Initial program 99.8%
Taylor expanded in z0 around 0
Applied rewrites51.4%
if 2.0000000000000001e148 < (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) Initial program 99.8%
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
mult-flipN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6469.9%
Applied rewrites69.9%
Taylor expanded in z0 around inf
lower-*.f6445.4%
Applied rewrites45.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6451.1%
Applied rewrites51.1%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0
(/
(- -0.053051646556513725 (/ (* -0.02210485264800276 z0) z1))
z1))
(t_1 (/ (* (/ 0.02210485264800276 z1) z0) z1)))
(if (<= t_0 -2e+86)
t_1
(if (<= t_0 2e+148) (/ -0.053051646556513725 z1) t_1))))double code(double z0, double z1) {
double t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
double t_1 = ((0.02210485264800276 / z1) * z0) / z1;
double tmp;
if (t_0 <= -2e+86) {
tmp = t_1;
} else if (t_0 <= 2e+148) {
tmp = -0.053051646556513725 / z1;
} 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, 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 = ((-0.053051646556513725d0) - (((-0.02210485264800276d0) * z0) / z1)) / z1
t_1 = ((0.02210485264800276d0 / z1) * z0) / z1
if (t_0 <= (-2d+86)) then
tmp = t_1
else if (t_0 <= 2d+148) then
tmp = (-0.053051646556513725d0) / z1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
double t_1 = ((0.02210485264800276 / z1) * z0) / z1;
double tmp;
if (t_0 <= -2e+86) {
tmp = t_1;
} else if (t_0 <= 2e+148) {
tmp = -0.053051646556513725 / z1;
} else {
tmp = t_1;
}
return tmp;
}
def code(z0, z1): t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1 t_1 = ((0.02210485264800276 / z1) * z0) / z1 tmp = 0 if t_0 <= -2e+86: tmp = t_1 elif t_0 <= 2e+148: tmp = -0.053051646556513725 / z1 else: tmp = t_1 return tmp
function code(z0, z1) t_0 = Float64(Float64(-0.053051646556513725 - Float64(Float64(-0.02210485264800276 * z0) / z1)) / z1) t_1 = Float64(Float64(Float64(0.02210485264800276 / z1) * z0) / z1) tmp = 0.0 if (t_0 <= -2e+86) tmp = t_1; elseif (t_0 <= 2e+148) tmp = Float64(-0.053051646556513725 / z1); else tmp = t_1; end return tmp end
function tmp_2 = code(z0, z1) t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1; t_1 = ((0.02210485264800276 / z1) * z0) / z1; tmp = 0.0; if (t_0 <= -2e+86) tmp = t_1; elseif (t_0 <= 2e+148) tmp = -0.053051646556513725 / z1; else tmp = t_1; end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(N[(-0.053051646556513725 - N[(N[(-0.02210485264800276 * z0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(0.02210485264800276 / z1), $MachinePrecision] * z0), $MachinePrecision] / z1), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+86], t$95$1, If[LessEqual[t$95$0, 2e+148], N[(-0.053051646556513725 / z1), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_0 := \frac{-0.053051646556513725 - \frac{-0.02210485264800276 \cdot z0}{z1}}{z1}\\
t_1 := \frac{\frac{0.02210485264800276}{z1} \cdot z0}{z1}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\frac{-0.053051646556513725}{z1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) < -2e86 or 2.0000000000000001e148 < (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) Initial program 99.8%
Taylor expanded in z0 around inf
lower-*.f64N/A
lower-/.f6451.1%
Applied rewrites51.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
metadata-evalN/A
lower-/.f6451.1%
Applied rewrites51.1%
if -2e86 < (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) < 2.0000000000000001e148Initial program 99.8%
Taylor expanded in z0 around 0
Applied rewrites51.4%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0
(/
(- -0.053051646556513725 (/ (* -0.02210485264800276 z0) z1))
z1))
(t_1 (/ (* 0.02210485264800276 (/ z0 z1)) z1)))
(if (<= t_0 -2e+86)
t_1
(if (<= t_0 2e+148) (/ -0.053051646556513725 z1) t_1))))double code(double z0, double z1) {
double t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
double t_1 = (0.02210485264800276 * (z0 / z1)) / z1;
double tmp;
if (t_0 <= -2e+86) {
tmp = t_1;
} else if (t_0 <= 2e+148) {
tmp = -0.053051646556513725 / z1;
} 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, 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 = ((-0.053051646556513725d0) - (((-0.02210485264800276d0) * z0) / z1)) / z1
t_1 = (0.02210485264800276d0 * (z0 / z1)) / z1
if (t_0 <= (-2d+86)) then
tmp = t_1
else if (t_0 <= 2d+148) then
tmp = (-0.053051646556513725d0) / z1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
double t_1 = (0.02210485264800276 * (z0 / z1)) / z1;
double tmp;
if (t_0 <= -2e+86) {
tmp = t_1;
} else if (t_0 <= 2e+148) {
tmp = -0.053051646556513725 / z1;
} else {
tmp = t_1;
}
return tmp;
}
def code(z0, z1): t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1 t_1 = (0.02210485264800276 * (z0 / z1)) / z1 tmp = 0 if t_0 <= -2e+86: tmp = t_1 elif t_0 <= 2e+148: tmp = -0.053051646556513725 / z1 else: tmp = t_1 return tmp
function code(z0, z1) t_0 = Float64(Float64(-0.053051646556513725 - Float64(Float64(-0.02210485264800276 * z0) / z1)) / z1) t_1 = Float64(Float64(0.02210485264800276 * Float64(z0 / z1)) / z1) tmp = 0.0 if (t_0 <= -2e+86) tmp = t_1; elseif (t_0 <= 2e+148) tmp = Float64(-0.053051646556513725 / z1); else tmp = t_1; end return tmp end
function tmp_2 = code(z0, z1) t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1; t_1 = (0.02210485264800276 * (z0 / z1)) / z1; tmp = 0.0; if (t_0 <= -2e+86) tmp = t_1; elseif (t_0 <= 2e+148) tmp = -0.053051646556513725 / z1; else tmp = t_1; end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(N[(-0.053051646556513725 - N[(N[(-0.02210485264800276 * z0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.02210485264800276 * N[(z0 / z1), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+86], t$95$1, If[LessEqual[t$95$0, 2e+148], N[(-0.053051646556513725 / z1), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_0 := \frac{-0.053051646556513725 - \frac{-0.02210485264800276 \cdot z0}{z1}}{z1}\\
t_1 := \frac{0.02210485264800276 \cdot \frac{z0}{z1}}{z1}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\frac{-0.053051646556513725}{z1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) < -2e86 or 2.0000000000000001e148 < (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) Initial program 99.8%
Taylor expanded in z0 around inf
lower-*.f64N/A
lower-/.f6451.1%
Applied rewrites51.1%
if -2e86 < (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) < 2.0000000000000001e148Initial program 99.8%
Taylor expanded in z0 around 0
Applied rewrites51.4%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0
(/
(- -0.053051646556513725 (/ (* -0.02210485264800276 z0) z1))
z1))
(t_1 (/ (* 0.02210485264800276 z0) (* z1 z1))))
(if (<= t_0 -2e+86)
t_1
(if (<= t_0 2e+148) (/ -0.053051646556513725 z1) t_1))))double code(double z0, double z1) {
double t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
double t_1 = (0.02210485264800276 * z0) / (z1 * z1);
double tmp;
if (t_0 <= -2e+86) {
tmp = t_1;
} else if (t_0 <= 2e+148) {
tmp = -0.053051646556513725 / z1;
} 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, 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 = ((-0.053051646556513725d0) - (((-0.02210485264800276d0) * z0) / z1)) / z1
t_1 = (0.02210485264800276d0 * z0) / (z1 * z1)
if (t_0 <= (-2d+86)) then
tmp = t_1
else if (t_0 <= 2d+148) then
tmp = (-0.053051646556513725d0) / z1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1;
double t_1 = (0.02210485264800276 * z0) / (z1 * z1);
double tmp;
if (t_0 <= -2e+86) {
tmp = t_1;
} else if (t_0 <= 2e+148) {
tmp = -0.053051646556513725 / z1;
} else {
tmp = t_1;
}
return tmp;
}
def code(z0, z1): t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1 t_1 = (0.02210485264800276 * z0) / (z1 * z1) tmp = 0 if t_0 <= -2e+86: tmp = t_1 elif t_0 <= 2e+148: tmp = -0.053051646556513725 / z1 else: tmp = t_1 return tmp
function code(z0, z1) t_0 = Float64(Float64(-0.053051646556513725 - Float64(Float64(-0.02210485264800276 * z0) / z1)) / z1) t_1 = Float64(Float64(0.02210485264800276 * z0) / Float64(z1 * z1)) tmp = 0.0 if (t_0 <= -2e+86) tmp = t_1; elseif (t_0 <= 2e+148) tmp = Float64(-0.053051646556513725 / z1); else tmp = t_1; end return tmp end
function tmp_2 = code(z0, z1) t_0 = (-0.053051646556513725 - ((-0.02210485264800276 * z0) / z1)) / z1; t_1 = (0.02210485264800276 * z0) / (z1 * z1); tmp = 0.0; if (t_0 <= -2e+86) tmp = t_1; elseif (t_0 <= 2e+148) tmp = -0.053051646556513725 / z1; else tmp = t_1; end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(N[(-0.053051646556513725 - N[(N[(-0.02210485264800276 * z0), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.02210485264800276 * z0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+86], t$95$1, If[LessEqual[t$95$0, 2e+148], N[(-0.053051646556513725 / z1), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_0 := \frac{-0.053051646556513725 - \frac{-0.02210485264800276 \cdot z0}{z1}}{z1}\\
t_1 := \frac{0.02210485264800276 \cdot z0}{z1 \cdot z1}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\frac{-0.053051646556513725}{z1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) < -2e86 or 2.0000000000000001e148 < (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) Initial program 99.8%
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
mult-flipN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6469.9%
Applied rewrites69.9%
Taylor expanded in z0 around inf
lower-*.f6445.4%
Applied rewrites45.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6445.7%
Applied rewrites45.7%
if -2e86 < (/.f64 (-.f64 #s(literal -2122065862260549/40000000000000000 binary64) (/.f64 (*.f64 #s(literal -552621316200069/25000000000000000 binary64) z0) z1)) z1) < 2.0000000000000001e148Initial program 99.8%
Taylor expanded in z0 around 0
Applied rewrites51.4%
(FPCore (z0 z1) :precision binary64 (/ -0.053051646556513725 z1))
double code(double z0, double z1) {
return -0.053051646556513725 / 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 = (-0.053051646556513725d0) / z1
end function
public static double code(double z0, double z1) {
return -0.053051646556513725 / z1;
}
def code(z0, z1): return -0.053051646556513725 / z1
function code(z0, z1) return Float64(-0.053051646556513725 / z1) end
function tmp = code(z0, z1) tmp = -0.053051646556513725 / z1; end
code[z0_, z1_] := N[(-0.053051646556513725 / z1), $MachinePrecision]
\frac{-0.053051646556513725}{z1}
Initial program 99.8%
Taylor expanded in z0 around 0
Applied rewrites51.4%
herbie shell --seed 2025250
(FPCore (z0 z1)
:name "(/ (- -2122065862260549/40000000000000000 (/ (* -552621316200069/25000000000000000 z0) z1)) z1)"
:precision binary64
(/ (- -0.053051646556513725 (/ (* -0.02210485264800276 z0) z1)) z1))