
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\end{array}
(FPCore (a b c)
:precision binary64
(if (<= b -3.9e+124)
(* (- (* (/ c (* b b)) 0.5) (/ 0.6666666666666666 a)) b)
(if (<= b 1.85e-47)
(+ (/ (sqrt (fma b b (* (* a -3.0) c))) (* 3.0 a)) (/ (- b) (* 3.0 a)))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.9e+124) {
tmp = (((c / (b * b)) * 0.5) - (0.6666666666666666 / a)) * b;
} else if (b <= 1.85e-47) {
tmp = (sqrt(fma(b, b, ((a * -3.0) * c))) / (3.0 * a)) + (-b / (3.0 * a));
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -3.9e+124) tmp = Float64(Float64(Float64(Float64(c / Float64(b * b)) * 0.5) - Float64(0.6666666666666666 / a)) * b); elseif (b <= 1.85e-47) tmp = Float64(Float64(sqrt(fma(b, b, Float64(Float64(a * -3.0) * c))) / Float64(3.0 * a)) + Float64(Float64(-b) / Float64(3.0 * a))); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -3.9e+124], N[(N[(N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 1.85e-47], N[(N[(N[Sqrt[N[(b * b + N[(N[(a * -3.0), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision] + N[((-b) / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.9 \cdot 10^{+124}:\\
\;\;\;\;\left(\frac{c}{b \cdot b} \cdot 0.5 - \frac{0.6666666666666666}{a}\right) \cdot b\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-47}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot -3\right) \cdot c\right)}}{3 \cdot a} + \frac{-b}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.9e124Initial program 49.9%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6496.0
Applied rewrites96.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f6496.0
Applied rewrites96.0%
if -3.9e124 < b < 1.85e-47Initial program 80.1%
Applied rewrites80.1%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lower-+.f64N/A
Applied rewrites80.1%
if 1.85e-47 < b Initial program 16.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -3.9e+124)
(* (- (* (/ c (* b b)) 0.5) (/ 0.6666666666666666 a)) b)
(if (<= b 1.85e-47)
(/ (+ (sqrt (fma (* -3.0 a) c (* b b))) (- b)) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.9e+124) {
tmp = (((c / (b * b)) * 0.5) - (0.6666666666666666 / a)) * b;
} else if (b <= 1.85e-47) {
tmp = (sqrt(fma((-3.0 * a), c, (b * b))) + -b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -3.9e+124) tmp = Float64(Float64(Float64(Float64(c / Float64(b * b)) * 0.5) - Float64(0.6666666666666666 / a)) * b); elseif (b <= 1.85e-47) tmp = Float64(Float64(sqrt(fma(Float64(-3.0 * a), c, Float64(b * b))) + Float64(-b)) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -3.9e+124], N[(N[(N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 1.85e-47], N[(N[(N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-b)), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.9 \cdot 10^{+124}:\\
\;\;\;\;\left(\frac{c}{b \cdot b} \cdot 0.5 - \frac{0.6666666666666666}{a}\right) \cdot b\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-47}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} + \left(-b\right)}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.9e124Initial program 49.9%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6496.0
Applied rewrites96.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f6496.0
Applied rewrites96.0%
if -3.9e124 < b < 1.85e-47Initial program 80.1%
Applied rewrites80.1%
if 1.85e-47 < b Initial program 16.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-14)
(* (- (* (/ c (* b b)) 0.5) (/ 0.6666666666666666 a)) b)
(if (<= b 1.85e-47)
(/ (+ (sqrt (* (* a -3.0) c)) (- b)) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-14) {
tmp = (((c / (b * b)) * 0.5) - (0.6666666666666666 / a)) * b;
} else if (b <= 1.85e-47) {
tmp = (sqrt(((a * -3.0) * c)) + -b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-8.2d-14)) then
tmp = (((c / (b * b)) * 0.5d0) - (0.6666666666666666d0 / a)) * b
else if (b <= 1.85d-47) then
tmp = (sqrt(((a * (-3.0d0)) * c)) + -b) / (a * 3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-14) {
tmp = (((c / (b * b)) * 0.5) - (0.6666666666666666 / a)) * b;
} else if (b <= 1.85e-47) {
tmp = (Math.sqrt(((a * -3.0) * c)) + -b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e-14: tmp = (((c / (b * b)) * 0.5) - (0.6666666666666666 / a)) * b elif b <= 1.85e-47: tmp = (math.sqrt(((a * -3.0) * c)) + -b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-14) tmp = Float64(Float64(Float64(Float64(c / Float64(b * b)) * 0.5) - Float64(0.6666666666666666 / a)) * b); elseif (b <= 1.85e-47) tmp = Float64(Float64(sqrt(Float64(Float64(a * -3.0) * c)) + Float64(-b)) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -8.2e-14) tmp = (((c / (b * b)) * 0.5) - (0.6666666666666666 / a)) * b; elseif (b <= 1.85e-47) tmp = (sqrt(((a * -3.0) * c)) + -b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-14], N[(N[(N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 1.85e-47], N[(N[(N[Sqrt[N[(N[(a * -3.0), $MachinePrecision] * c), $MachinePrecision]], $MachinePrecision] + (-b)), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-14}:\\
\;\;\;\;\left(\frac{c}{b \cdot b} \cdot 0.5 - \frac{0.6666666666666666}{a}\right) \cdot b\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-47}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot -3\right) \cdot c} + \left(-b\right)}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.2000000000000004e-14Initial program 66.6%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6490.7
Applied rewrites90.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f6490.7
Applied rewrites90.7%
if -8.2000000000000004e-14 < b < 1.85e-47Initial program 75.5%
Applied rewrites75.5%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.0
Applied rewrites63.0%
if 1.85e-47 < b Initial program 16.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-14)
(fma 0.5 (/ c b) (* (/ b a) -0.6666666666666666))
(if (<= b 1.85e-47)
(/ (+ (sqrt (* (* a -3.0) c)) (- b)) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-14) {
tmp = fma(0.5, (c / b), ((b / a) * -0.6666666666666666));
} else if (b <= 1.85e-47) {
tmp = (sqrt(((a * -3.0) * c)) + -b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-14) tmp = fma(0.5, Float64(c / b), Float64(Float64(b / a) * -0.6666666666666666)); elseif (b <= 1.85e-47) tmp = Float64(Float64(sqrt(Float64(Float64(a * -3.0) * c)) + Float64(-b)) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-14], N[(0.5 * N[(c / b), $MachinePrecision] + N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e-47], N[(N[(N[Sqrt[N[(N[(a * -3.0), $MachinePrecision] * c), $MachinePrecision]], $MachinePrecision] + (-b)), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b}{a} \cdot -0.6666666666666666\right)\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-47}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot -3\right) \cdot c} + \left(-b\right)}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.2000000000000004e-14Initial program 66.6%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6490.7
Applied rewrites90.7%
Taylor expanded in a around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6490.8
Applied rewrites90.8%
if -8.2000000000000004e-14 < b < 1.85e-47Initial program 75.5%
Applied rewrites75.5%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.0
Applied rewrites63.0%
if 1.85e-47 < b Initial program 16.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-14)
(fma 0.5 (/ c b) (* (/ b a) -0.6666666666666666))
(if (<= b 1.85e-47)
(/ (+ (- b) (sqrt (* -3.0 (* c a)))) (* 3.0 a))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-14) {
tmp = fma(0.5, (c / b), ((b / a) * -0.6666666666666666));
} else if (b <= 1.85e-47) {
tmp = (-b + sqrt((-3.0 * (c * a)))) / (3.0 * a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-14) tmp = fma(0.5, Float64(c / b), Float64(Float64(b / a) * -0.6666666666666666)); elseif (b <= 1.85e-47) tmp = Float64(Float64(Float64(-b) + sqrt(Float64(-3.0 * Float64(c * a)))) / Float64(3.0 * a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-14], N[(0.5 * N[(c / b), $MachinePrecision] + N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e-47], N[(N[((-b) + N[Sqrt[N[(-3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b}{a} \cdot -0.6666666666666666\right)\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-47}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{-3 \cdot \left(c \cdot a\right)}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.2000000000000004e-14Initial program 66.6%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6490.7
Applied rewrites90.7%
Taylor expanded in a around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6490.8
Applied rewrites90.8%
if -8.2000000000000004e-14 < b < 1.85e-47Initial program 75.5%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6462.8
Applied rewrites62.8%
if 1.85e-47 < b Initial program 16.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -5.5e-14)
(fma 0.5 (/ c b) (* (/ b a) -0.6666666666666666))
(if (<= b 1.85e-47)
(/ (sqrt (* (* a -3.0) c)) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.5e-14) {
tmp = fma(0.5, (c / b), ((b / a) * -0.6666666666666666));
} else if (b <= 1.85e-47) {
tmp = sqrt(((a * -3.0) * c)) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -5.5e-14) tmp = fma(0.5, Float64(c / b), Float64(Float64(b / a) * -0.6666666666666666)); elseif (b <= 1.85e-47) tmp = Float64(sqrt(Float64(Float64(a * -3.0) * c)) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -5.5e-14], N[(0.5 * N[(c / b), $MachinePrecision] + N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e-47], N[(N[Sqrt[N[(N[(a * -3.0), $MachinePrecision] * c), $MachinePrecision]], $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b}{a} \cdot -0.6666666666666666\right)\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-47}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot -3\right) \cdot c}}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -5.49999999999999991e-14Initial program 66.6%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6490.7
Applied rewrites90.7%
Taylor expanded in a around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6490.8
Applied rewrites90.8%
if -5.49999999999999991e-14 < b < 1.85e-47Initial program 75.5%
Applied rewrites75.5%
Taylor expanded in a around inf
sqrt-unprodN/A
*-commutativeN/A
associate-*r*N/A
lower-sqrt.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.2
Applied rewrites61.2%
if 1.85e-47 < b Initial program 16.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -5.5e-14)
(/ (* -2.0 b) (* 3.0 a))
(if (<= b 1.85e-47)
(/ (sqrt (* (* a -3.0) c)) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.5e-14) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 1.85e-47) {
tmp = sqrt(((a * -3.0) * c)) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5.5d-14)) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
else if (b <= 1.85d-47) then
tmp = sqrt(((a * (-3.0d0)) * c)) / (a * 3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5.5e-14) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 1.85e-47) {
tmp = Math.sqrt(((a * -3.0) * c)) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.5e-14: tmp = (-2.0 * b) / (3.0 * a) elif b <= 1.85e-47: tmp = math.sqrt(((a * -3.0) * c)) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.5e-14) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); elseif (b <= 1.85e-47) tmp = Float64(sqrt(Float64(Float64(a * -3.0) * c)) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.5e-14) tmp = (-2.0 * b) / (3.0 * a); elseif (b <= 1.85e-47) tmp = sqrt(((a * -3.0) * c)) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.5e-14], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e-47], N[(N[Sqrt[N[(N[(a * -3.0), $MachinePrecision] * c), $MachinePrecision]], $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-47}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot -3\right) \cdot c}}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -5.49999999999999991e-14Initial program 66.6%
Taylor expanded in b around -inf
lower-*.f6490.3
Applied rewrites90.3%
if -5.49999999999999991e-14 < b < 1.85e-47Initial program 75.5%
Applied rewrites75.5%
Taylor expanded in a around inf
sqrt-unprodN/A
*-commutativeN/A
associate-*r*N/A
lower-sqrt.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.2
Applied rewrites61.2%
if 1.85e-47 < b Initial program 16.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -5.5e-14)
(/ (* -2.0 b) (* 3.0 a))
(if (<= b 1.85e-47)
(/ (sqrt (* -3.0 (* c a))) (* 3.0 a))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.5e-14) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 1.85e-47) {
tmp = sqrt((-3.0 * (c * a))) / (3.0 * a);
} else {
tmp = (c / b) * -0.5;
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5.5d-14)) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
else if (b <= 1.85d-47) then
tmp = sqrt(((-3.0d0) * (c * a))) / (3.0d0 * a)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5.5e-14) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 1.85e-47) {
tmp = Math.sqrt((-3.0 * (c * a))) / (3.0 * a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.5e-14: tmp = (-2.0 * b) / (3.0 * a) elif b <= 1.85e-47: tmp = math.sqrt((-3.0 * (c * a))) / (3.0 * a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.5e-14) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); elseif (b <= 1.85e-47) tmp = Float64(sqrt(Float64(-3.0 * Float64(c * a))) / Float64(3.0 * a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.5e-14) tmp = (-2.0 * b) / (3.0 * a); elseif (b <= 1.85e-47) tmp = sqrt((-3.0 * (c * a))) / (3.0 * a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.5e-14], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e-47], N[(N[Sqrt[N[(-3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-47}:\\
\;\;\;\;\frac{\sqrt{-3 \cdot \left(c \cdot a\right)}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -5.49999999999999991e-14Initial program 66.6%
Taylor expanded in b around -inf
lower-*.f6490.3
Applied rewrites90.3%
if -5.49999999999999991e-14 < b < 1.85e-47Initial program 75.5%
Taylor expanded in a around inf
sqrt-unprodN/A
*-commutativeN/A
lower-sqrt.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.1
Applied rewrites61.1%
if 1.85e-47 < b Initial program 16.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -4.5e-102)
(/ (* -2.0 b) (* 3.0 a))
(if (<= b 2.25e-259)
(* (sqrt (* (/ c a) -3.0)) 0.3333333333333333)
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e-102) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 2.25e-259) {
tmp = sqrt(((c / a) * -3.0)) * 0.3333333333333333;
} else {
tmp = (c / b) * -0.5;
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-4.5d-102)) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
else if (b <= 2.25d-259) then
tmp = sqrt(((c / a) * (-3.0d0))) * 0.3333333333333333d0
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e-102) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 2.25e-259) {
tmp = Math.sqrt(((c / a) * -3.0)) * 0.3333333333333333;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.5e-102: tmp = (-2.0 * b) / (3.0 * a) elif b <= 2.25e-259: tmp = math.sqrt(((c / a) * -3.0)) * 0.3333333333333333 else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.5e-102) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); elseif (b <= 2.25e-259) tmp = Float64(sqrt(Float64(Float64(c / a) * -3.0)) * 0.3333333333333333); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.5e-102) tmp = (-2.0 * b) / (3.0 * a); elseif (b <= 2.25e-259) tmp = sqrt(((c / a) * -3.0)) * 0.3333333333333333; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.5e-102], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.25e-259], N[(N[Sqrt[N[(N[(c / a), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{-259}:\\
\;\;\;\;\sqrt{\frac{c}{a} \cdot -3} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4.49999999999999999e-102Initial program 70.6%
Taylor expanded in b around -inf
lower-*.f6484.3
Applied rewrites84.3%
if -4.49999999999999999e-102 < b < 2.24999999999999987e-259Initial program 78.5%
Taylor expanded in a around inf
*-commutativeN/A
metadata-evalN/A
sqrt-unprodN/A
lower-*.f64N/A
sqrt-unprodN/A
metadata-evalN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f6433.9
Applied rewrites33.9%
if 2.24999999999999987e-259 < b Initial program 29.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6471.6
Applied rewrites71.6%
(FPCore (a b c)
:precision binary64
(if (<= b -4.5e-243)
(/ (* -2.0 b) (* 3.0 a))
(if (<= b 2.75e-219)
(* (sqrt (* (/ c a) -3.0)) -0.3333333333333333)
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e-243) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 2.75e-219) {
tmp = sqrt(((c / a) * -3.0)) * -0.3333333333333333;
} else {
tmp = (c / b) * -0.5;
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-4.5d-243)) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
else if (b <= 2.75d-219) then
tmp = sqrt(((c / a) * (-3.0d0))) * (-0.3333333333333333d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e-243) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 2.75e-219) {
tmp = Math.sqrt(((c / a) * -3.0)) * -0.3333333333333333;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.5e-243: tmp = (-2.0 * b) / (3.0 * a) elif b <= 2.75e-219: tmp = math.sqrt(((c / a) * -3.0)) * -0.3333333333333333 else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.5e-243) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); elseif (b <= 2.75e-219) tmp = Float64(sqrt(Float64(Float64(c / a) * -3.0)) * -0.3333333333333333); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.5e-243) tmp = (-2.0 * b) / (3.0 * a); elseif (b <= 2.75e-219) tmp = sqrt(((c / a) * -3.0)) * -0.3333333333333333; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.5e-243], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.75e-219], N[(N[Sqrt[N[(N[(c / a), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] * -0.3333333333333333), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{-243}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 2.75 \cdot 10^{-219}:\\
\;\;\;\;\sqrt{\frac{c}{a} \cdot -3} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4.50000000000000017e-243Initial program 72.6%
Taylor expanded in b around -inf
lower-*.f6472.4
Applied rewrites72.4%
if -4.50000000000000017e-243 < b < 2.75000000000000009e-219Initial program 75.9%
Taylor expanded in a around -inf
*-commutativeN/A
lower-*.f64N/A
sqrt-unprodN/A
metadata-evalN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f6439.5
Applied rewrites39.5%
if 2.75000000000000009e-219 < b Initial program 27.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6474.3
Applied rewrites74.3%
(FPCore (a b c) :precision binary64 (if (<= b 7.6e-290) (/ (* -2.0 b) (* 3.0 a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 7.6e-290) {
tmp = (-2.0 * b) / (3.0 * a);
} else {
tmp = (c / b) * -0.5;
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 7.6d-290) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 7.6e-290) {
tmp = (-2.0 * b) / (3.0 * a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 7.6e-290: tmp = (-2.0 * b) / (3.0 * a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 7.6e-290) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 7.6e-290) tmp = (-2.0 * b) / (3.0 * a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 7.6e-290], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.6 \cdot 10^{-290}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 7.5999999999999995e-290Initial program 72.7%
Taylor expanded in b around -inf
lower-*.f6466.6
Applied rewrites66.6%
if 7.5999999999999995e-290 < b Initial program 31.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6469.3
Applied rewrites69.3%
(FPCore (a b c) :precision binary64 (if (<= b 7.6e-290) (* (/ -0.6666666666666666 a) b) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 7.6e-290) {
tmp = (-0.6666666666666666 / a) * b;
} else {
tmp = (c / b) * -0.5;
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 7.6d-290) then
tmp = ((-0.6666666666666666d0) / a) * b
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 7.6e-290) {
tmp = (-0.6666666666666666 / a) * b;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 7.6e-290: tmp = (-0.6666666666666666 / a) * b else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 7.6e-290) tmp = Float64(Float64(-0.6666666666666666 / a) * b); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 7.6e-290) tmp = (-0.6666666666666666 / a) * b; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 7.6e-290], N[(N[(-0.6666666666666666 / a), $MachinePrecision] * b), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.6 \cdot 10^{-290}:\\
\;\;\;\;\frac{-0.6666666666666666}{a} \cdot b\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 7.5999999999999995e-290Initial program 72.7%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6465.6
Applied rewrites65.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f6465.6
Applied rewrites65.6%
Taylor expanded in a around 0
lower-/.f6466.6
Applied rewrites66.6%
if 7.5999999999999995e-290 < b Initial program 31.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6469.3
Applied rewrites69.3%
(FPCore (a b c) :precision binary64 (if (<= b 0.0014) (* (/ -0.6666666666666666 a) b) (* 0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 0.0014) {
tmp = (-0.6666666666666666 / a) * b;
} else {
tmp = 0.5 * (c / b);
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 0.0014d0) then
tmp = ((-0.6666666666666666d0) / a) * b
else
tmp = 0.5d0 * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 0.0014) {
tmp = (-0.6666666666666666 / a) * b;
} else {
tmp = 0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 0.0014: tmp = (-0.6666666666666666 / a) * b else: tmp = 0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 0.0014) tmp = Float64(Float64(-0.6666666666666666 / a) * b); else tmp = Float64(0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 0.0014) tmp = (-0.6666666666666666 / a) * b; else tmp = 0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 0.0014], N[(N[(-0.6666666666666666 / a), $MachinePrecision] * b), $MachinePrecision], N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.0014:\\
\;\;\;\;\frac{-0.6666666666666666}{a} \cdot b\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 0.00139999999999999999Initial program 69.6%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6449.4
Applied rewrites49.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f6449.4
Applied rewrites49.4%
Taylor expanded in a around 0
lower-/.f6450.5
Applied rewrites50.5%
if 0.00139999999999999999 < b Initial program 14.7%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f642.6
Applied rewrites2.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f6428.0
Applied rewrites28.0%
(FPCore (a b c) :precision binary64 (* 0.5 (/ c b)))
double code(double a, double b, double c) {
return 0.5 * (c / b);
}
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(a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = 0.5d0 * (c / b)
end function
public static double code(double a, double b, double c) {
return 0.5 * (c / b);
}
def code(a, b, c): return 0.5 * (c / b)
function code(a, b, c) return Float64(0.5 * Float64(c / b)) end
function tmp = code(a, b, c) tmp = 0.5 * (c / b); end
code[a_, b_, c_] := N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \frac{c}{b}
\end{array}
Initial program 52.9%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6435.1
Applied rewrites35.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f6410.7
Applied rewrites10.7%
herbie shell --seed 2025115
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))