
(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 19 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
(let* ((t_0 (/ (- (fabs b) b) a))
(t_1 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(t_2 (sqrt (fma (* -3.0 a) c (* b b))))
(t_3 (/ c (fabs b))))
(if (<= t_1 -1e+210)
(fma
t_0
0.3333333333333333
(* (- (/ (* -0.375 (* c a)) (* (* b b) b)) (/ 0.5 (fabs b))) c))
(if (<= t_1 -5e-219)
(/ (/ (+ t_2 (- b)) 3.0) a)
(if (<= t_1 0.0)
(fma t_0 0.3333333333333333 (* t_3 -0.5))
(if (<= t_1 2e+263)
(+ (/ (- b) (* a 3.0)) (/ t_2 (* a 3.0)))
(fma t_3 -0.5 (* t_0 0.3333333333333333))))))))
double code(double a, double b, double c) {
double t_0 = (fabs(b) - b) / a;
double t_1 = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
double t_2 = sqrt(fma((-3.0 * a), c, (b * b)));
double t_3 = c / fabs(b);
double tmp;
if (t_1 <= -1e+210) {
tmp = fma(t_0, 0.3333333333333333, ((((-0.375 * (c * a)) / ((b * b) * b)) - (0.5 / fabs(b))) * c));
} else if (t_1 <= -5e-219) {
tmp = ((t_2 + -b) / 3.0) / a;
} else if (t_1 <= 0.0) {
tmp = fma(t_0, 0.3333333333333333, (t_3 * -0.5));
} else if (t_1 <= 2e+263) {
tmp = (-b / (a * 3.0)) + (t_2 / (a * 3.0));
} else {
tmp = fma(t_3, -0.5, (t_0 * 0.3333333333333333));
}
return tmp;
}
function code(a, b, c) t_0 = Float64(Float64(abs(b) - b) / a) t_1 = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) t_2 = sqrt(fma(Float64(-3.0 * a), c, Float64(b * b))) t_3 = Float64(c / abs(b)) tmp = 0.0 if (t_1 <= -1e+210) tmp = fma(t_0, 0.3333333333333333, Float64(Float64(Float64(Float64(-0.375 * Float64(c * a)) / Float64(Float64(b * b) * b)) - Float64(0.5 / abs(b))) * c)); elseif (t_1 <= -5e-219) tmp = Float64(Float64(Float64(t_2 + Float64(-b)) / 3.0) / a); elseif (t_1 <= 0.0) tmp = fma(t_0, 0.3333333333333333, Float64(t_3 * -0.5)); elseif (t_1 <= 2e+263) tmp = Float64(Float64(Float64(-b) / Float64(a * 3.0)) + Float64(t_2 / Float64(a * 3.0))); else tmp = fma(t_3, -0.5, Float64(t_0 * 0.3333333333333333)); end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(c / N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+210], N[(t$95$0 * 0.3333333333333333 + N[(N[(N[(N[(-0.375 * N[(c * a), $MachinePrecision]), $MachinePrecision] / N[(N[(b * b), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(0.5 / N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-219], N[(N[(N[(t$95$2 + (-b)), $MachinePrecision] / 3.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$0 * 0.3333333333333333 + N[(t$95$3 * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+263], N[(N[((-b) / N[(a * 3.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * -0.5 + N[(t$95$0 * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left|b\right| - b}{a}\\
t_1 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\
t_2 := \sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}\\
t_3 := \frac{c}{\left|b\right|}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+210}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 0.3333333333333333, \left(\frac{-0.375 \cdot \left(c \cdot a\right)}{\left(b \cdot b\right) \cdot b} - \frac{0.5}{\left|b\right|}\right) \cdot c\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-219}:\\
\;\;\;\;\frac{\frac{t\_2 + \left(-b\right)}{3}}{a}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 0.3333333333333333, t\_3 \cdot -0.5\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;\frac{-b}{a \cdot 3} + \frac{t\_2}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_3, -0.5, t\_0 \cdot 0.3333333333333333\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -9.99999999999999927e209Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in c around 0
Applied rewrites60.9%
Applied rewrites61.3%
if -9.99999999999999927e209 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -5.0000000000000002e-219Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites51.9%
if -5.0000000000000002e-219 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -0.0Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
lift-fma.f64N/A
lift-fabs.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-fabs.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-fabs.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-fabs.f6468.2
Applied rewrites68.2%
if -0.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < 2.00000000000000003e263Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
div-addN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites51.4%
if 2.00000000000000003e263 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (fma (* -3.0 a) c (* b b))))
(t_1 (/ c (fabs b)))
(t_2 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(t_3 (/ (- (fabs b) b) a))
(t_4 (fma t_1 -0.5 (* t_3 0.3333333333333333))))
(if (<= t_2 -1e+210)
t_4
(if (<= t_2 -5e-219)
(/ (/ (+ t_0 (- b)) 3.0) a)
(if (<= t_2 0.0)
(fma t_3 0.3333333333333333 (* t_1 -0.5))
(if (<= t_2 2e+263)
(+ (/ (- b) (* a 3.0)) (/ t_0 (* a 3.0)))
t_4))))))
double code(double a, double b, double c) {
double t_0 = sqrt(fma((-3.0 * a), c, (b * b)));
double t_1 = c / fabs(b);
double t_2 = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
double t_3 = (fabs(b) - b) / a;
double t_4 = fma(t_1, -0.5, (t_3 * 0.3333333333333333));
double tmp;
if (t_2 <= -1e+210) {
tmp = t_4;
} else if (t_2 <= -5e-219) {
tmp = ((t_0 + -b) / 3.0) / a;
} else if (t_2 <= 0.0) {
tmp = fma(t_3, 0.3333333333333333, (t_1 * -0.5));
} else if (t_2 <= 2e+263) {
tmp = (-b / (a * 3.0)) + (t_0 / (a * 3.0));
} else {
tmp = t_4;
}
return tmp;
}
function code(a, b, c) t_0 = sqrt(fma(Float64(-3.0 * a), c, Float64(b * b))) t_1 = Float64(c / abs(b)) t_2 = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) t_3 = Float64(Float64(abs(b) - b) / a) t_4 = fma(t_1, -0.5, Float64(t_3 * 0.3333333333333333)) tmp = 0.0 if (t_2 <= -1e+210) tmp = t_4; elseif (t_2 <= -5e-219) tmp = Float64(Float64(Float64(t_0 + Float64(-b)) / 3.0) / a); elseif (t_2 <= 0.0) tmp = fma(t_3, 0.3333333333333333, Float64(t_1 * -0.5)); elseif (t_2 <= 2e+263) tmp = Float64(Float64(Float64(-b) / Float64(a * 3.0)) + Float64(t_0 / Float64(a * 3.0))); else tmp = t_4; end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(c / N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * -0.5 + N[(t$95$3 * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+210], t$95$4, If[LessEqual[t$95$2, -5e-219], N[(N[(N[(t$95$0 + (-b)), $MachinePrecision] / 3.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(t$95$3 * 0.3333333333333333 + N[(t$95$1 * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+263], N[(N[((-b) / N[(a * 3.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}\\
t_1 := \frac{c}{\left|b\right|}\\
t_2 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\
t_3 := \frac{\left|b\right| - b}{a}\\
t_4 := \mathsf{fma}\left(t\_1, -0.5, t\_3 \cdot 0.3333333333333333\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+210}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-219}:\\
\;\;\;\;\frac{\frac{t\_0 + \left(-b\right)}{3}}{a}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(t\_3, 0.3333333333333333, t\_1 \cdot -0.5\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;\frac{-b}{a \cdot 3} + \frac{t\_0}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -9.99999999999999927e209 or 2.00000000000000003e263 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
if -9.99999999999999927e209 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -5.0000000000000002e-219Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites51.9%
if -5.0000000000000002e-219 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -0.0Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
lift-fma.f64N/A
lift-fabs.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-fabs.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-fabs.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-fabs.f6468.2
Applied rewrites68.2%
if -0.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < 2.00000000000000003e263Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
div-addN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites51.4%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (/ c (fabs b)))
(t_1 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(t_2 (/ (- (fabs b) b) a))
(t_3 (fma t_0 -0.5 (* t_2 0.3333333333333333)))
(t_4 (+ (sqrt (fma (* -3.0 a) c (* b b))) (- b))))
(if (<= t_1 -1e+210)
t_3
(if (<= t_1 -5e-219)
(/ (/ t_4 3.0) a)
(if (<= t_1 0.0)
(fma t_2 0.3333333333333333 (* t_0 -0.5))
(if (<= t_1 2e+263) (/ t_4 (* a 3.0)) t_3))))))
double code(double a, double b, double c) {
double t_0 = c / fabs(b);
double t_1 = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
double t_2 = (fabs(b) - b) / a;
double t_3 = fma(t_0, -0.5, (t_2 * 0.3333333333333333));
double t_4 = sqrt(fma((-3.0 * a), c, (b * b))) + -b;
double tmp;
if (t_1 <= -1e+210) {
tmp = t_3;
} else if (t_1 <= -5e-219) {
tmp = (t_4 / 3.0) / a;
} else if (t_1 <= 0.0) {
tmp = fma(t_2, 0.3333333333333333, (t_0 * -0.5));
} else if (t_1 <= 2e+263) {
tmp = t_4 / (a * 3.0);
} else {
tmp = t_3;
}
return tmp;
}
function code(a, b, c) t_0 = Float64(c / abs(b)) t_1 = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) t_2 = Float64(Float64(abs(b) - b) / a) t_3 = fma(t_0, -0.5, Float64(t_2 * 0.3333333333333333)) t_4 = Float64(sqrt(fma(Float64(-3.0 * a), c, Float64(b * b))) + Float64(-b)) tmp = 0.0 if (t_1 <= -1e+210) tmp = t_3; elseif (t_1 <= -5e-219) tmp = Float64(Float64(t_4 / 3.0) / a); elseif (t_1 <= 0.0) tmp = fma(t_2, 0.3333333333333333, Float64(t_0 * -0.5)); elseif (t_1 <= 2e+263) tmp = Float64(t_4 / Float64(a * 3.0)); else tmp = t_3; end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[(c / N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * -0.5 + N[(t$95$2 * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-b)), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+210], t$95$3, If[LessEqual[t$95$1, -5e-219], N[(N[(t$95$4 / 3.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$2 * 0.3333333333333333 + N[(t$95$0 * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+263], N[(t$95$4 / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c}{\left|b\right|}\\
t_1 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\
t_2 := \frac{\left|b\right| - b}{a}\\
t_3 := \mathsf{fma}\left(t\_0, -0.5, t\_2 \cdot 0.3333333333333333\right)\\
t_4 := \sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} + \left(-b\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+210}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-219}:\\
\;\;\;\;\frac{\frac{t\_4}{3}}{a}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(t\_2, 0.3333333333333333, t\_0 \cdot -0.5\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;\frac{t\_4}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -9.99999999999999927e209 or 2.00000000000000003e263 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
if -9.99999999999999927e209 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -5.0000000000000002e-219Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites51.9%
if -5.0000000000000002e-219 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -0.0Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
lift-fma.f64N/A
lift-fabs.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-fabs.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-fabs.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-fabs.f6468.2
Applied rewrites68.2%
if -0.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < 2.00000000000000003e263Initial program 51.9%
Applied rewrites51.9%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (/ c (fabs b)))
(t_1 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(t_2 (/ (- (fabs b) b) a))
(t_3 (fma t_0 -0.5 (* t_2 0.3333333333333333)))
(t_4 (/ (+ (sqrt (fma (* -3.0 a) c (* b b))) (- b)) (* a 3.0))))
(if (<= t_1 -5e+256)
t_3
(if (<= t_1 -5e-219)
t_4
(if (<= t_1 0.0)
(fma t_2 0.3333333333333333 (* t_0 -0.5))
(if (<= t_1 2e+263) t_4 t_3))))))
double code(double a, double b, double c) {
double t_0 = c / fabs(b);
double t_1 = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
double t_2 = (fabs(b) - b) / a;
double t_3 = fma(t_0, -0.5, (t_2 * 0.3333333333333333));
double t_4 = (sqrt(fma((-3.0 * a), c, (b * b))) + -b) / (a * 3.0);
double tmp;
if (t_1 <= -5e+256) {
tmp = t_3;
} else if (t_1 <= -5e-219) {
tmp = t_4;
} else if (t_1 <= 0.0) {
tmp = fma(t_2, 0.3333333333333333, (t_0 * -0.5));
} else if (t_1 <= 2e+263) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
function code(a, b, c) t_0 = Float64(c / abs(b)) t_1 = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) t_2 = Float64(Float64(abs(b) - b) / a) t_3 = fma(t_0, -0.5, Float64(t_2 * 0.3333333333333333)) t_4 = Float64(Float64(sqrt(fma(Float64(-3.0 * a), c, Float64(b * b))) + Float64(-b)) / Float64(a * 3.0)) tmp = 0.0 if (t_1 <= -5e+256) tmp = t_3; elseif (t_1 <= -5e-219) tmp = t_4; elseif (t_1 <= 0.0) tmp = fma(t_2, 0.3333333333333333, Float64(t_0 * -0.5)); elseif (t_1 <= 2e+263) tmp = t_4; else tmp = t_3; end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[(c / N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * -0.5 + N[(t$95$2 * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = 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]}, If[LessEqual[t$95$1, -5e+256], t$95$3, If[LessEqual[t$95$1, -5e-219], t$95$4, If[LessEqual[t$95$1, 0.0], N[(t$95$2 * 0.3333333333333333 + N[(t$95$0 * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+263], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c}{\left|b\right|}\\
t_1 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\
t_2 := \frac{\left|b\right| - b}{a}\\
t_3 := \mathsf{fma}\left(t\_0, -0.5, t\_2 \cdot 0.3333333333333333\right)\\
t_4 := \frac{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} + \left(-b\right)}{a \cdot 3}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+256}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-219}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(t\_2, 0.3333333333333333, t\_0 \cdot -0.5\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -5.00000000000000015e256 or 2.00000000000000003e263 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
if -5.00000000000000015e256 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -5.0000000000000002e-219 or -0.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < 2.00000000000000003e263Initial program 51.9%
Applied rewrites51.9%
if -5.0000000000000002e-219 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -0.0Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
lift-fma.f64N/A
lift-fabs.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-fabs.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-fabs.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-fabs.f6468.2
Applied rewrites68.2%
(FPCore (a b c)
:precision binary64
(if (<= b -5.7e-21)
(/ (* (- b) (fma (* a (/ c (* b b))) -0.5 0.6666666666666666)) a)
(if (<= b 4.5e-117)
(/ (+ (- b) (sqrt (* (* -3.0 a) c))) (* 3.0 a))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.7e-21) {
tmp = (-b * fma((a * (c / (b * b))), -0.5, 0.6666666666666666)) / a;
} else if (b <= 4.5e-117) {
tmp = (-b + sqrt(((-3.0 * a) * c))) / (3.0 * a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -5.7e-21) tmp = Float64(Float64(Float64(-b) * fma(Float64(a * Float64(c / Float64(b * b))), -0.5, 0.6666666666666666)) / a); elseif (b <= 4.5e-117) tmp = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(-3.0 * a) * c))) / Float64(3.0 * a)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -5.7e-21], N[(N[((-b) * N[(N[(a * N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5 + 0.6666666666666666), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 4.5e-117], N[(N[((-b) + N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.7 \cdot 10^{-21}:\\
\;\;\;\;\frac{\left(-b\right) \cdot \mathsf{fma}\left(a \cdot \frac{c}{b \cdot b}, -0.5, 0.6666666666666666\right)}{a}\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{\left(-3 \cdot a\right) \cdot c}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -5.6999999999999996e-21Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites51.9%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6434.2
Applied rewrites34.2%
if -5.6999999999999996e-21 < b < 4.49999999999999969e-117Initial program 51.9%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6433.7
Applied rewrites33.7%
if 4.49999999999999969e-117 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5.7e-21)
(/ (fma 0.5 (* (/ c b) a) (* -0.6666666666666666 b)) a)
(if (<= b 4.5e-117)
(/ (+ (- b) (sqrt (* (* -3.0 a) c))) (* 3.0 a))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.7e-21) {
tmp = fma(0.5, ((c / b) * a), (-0.6666666666666666 * b)) / a;
} else if (b <= 4.5e-117) {
tmp = (-b + sqrt(((-3.0 * a) * c))) / (3.0 * a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -5.7e-21) tmp = Float64(fma(0.5, Float64(Float64(c / b) * a), Float64(-0.6666666666666666 * b)) / a); elseif (b <= 4.5e-117) tmp = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(-3.0 * a) * c))) / Float64(3.0 * a)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -5.7e-21], N[(N[(0.5 * N[(N[(c / b), $MachinePrecision] * a), $MachinePrecision] + N[(-0.6666666666666666 * b), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 4.5e-117], N[(N[((-b) + N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.7 \cdot 10^{-21}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{c}{b} \cdot a, -0.6666666666666666 \cdot b\right)}{a}\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{\left(-3 \cdot a\right) \cdot c}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -5.6999999999999996e-21Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites51.9%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6434.2
Applied rewrites34.2%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f6434.9
Applied rewrites34.9%
if -5.6999999999999996e-21 < b < 4.49999999999999969e-117Initial program 51.9%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6433.7
Applied rewrites33.7%
if 4.49999999999999969e-117 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5.7e-21)
(/ (fma 0.5 (* (/ c b) a) (* -0.6666666666666666 b)) a)
(if (<= b 4.5e-117)
(/ (+ (- b) (sqrt (* -3.0 (* c a)))) (* 3.0 a))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.7e-21) {
tmp = fma(0.5, ((c / b) * a), (-0.6666666666666666 * b)) / a;
} else if (b <= 4.5e-117) {
tmp = (-b + sqrt((-3.0 * (c * a)))) / (3.0 * a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -5.7e-21) tmp = Float64(fma(0.5, Float64(Float64(c / b) * a), Float64(-0.6666666666666666 * b)) / a); elseif (b <= 4.5e-117) tmp = Float64(Float64(Float64(-b) + sqrt(Float64(-3.0 * Float64(c * a)))) / Float64(3.0 * a)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -5.7e-21], N[(N[(0.5 * N[(N[(c / b), $MachinePrecision] * a), $MachinePrecision] + N[(-0.6666666666666666 * b), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 4.5e-117], N[(N[((-b) + N[Sqrt[N[(-3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.7 \cdot 10^{-21}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{c}{b} \cdot a, -0.6666666666666666 \cdot b\right)}{a}\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{-3 \cdot \left(c \cdot a\right)}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -5.6999999999999996e-21Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites51.9%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6434.2
Applied rewrites34.2%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f6434.9
Applied rewrites34.9%
if -5.6999999999999996e-21 < b < 4.49999999999999969e-117Initial program 51.9%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
if 4.49999999999999969e-117 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5.7e-21)
(/ (fma 0.5 (* (/ c b) a) (* -0.6666666666666666 b)) a)
(if (<= b 4.5e-117)
(/ (sqrt (* (* -3.0 a) c)) (* 3.0 a))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.7e-21) {
tmp = fma(0.5, ((c / b) * a), (-0.6666666666666666 * b)) / a;
} else if (b <= 4.5e-117) {
tmp = sqrt(((-3.0 * a) * c)) / (3.0 * a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -5.7e-21) tmp = Float64(fma(0.5, Float64(Float64(c / b) * a), Float64(-0.6666666666666666 * b)) / a); elseif (b <= 4.5e-117) tmp = Float64(sqrt(Float64(Float64(-3.0 * a) * c)) / Float64(3.0 * a)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -5.7e-21], N[(N[(0.5 * N[(N[(c / b), $MachinePrecision] * a), $MachinePrecision] + N[(-0.6666666666666666 * b), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 4.5e-117], N[(N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c), $MachinePrecision]], $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.7 \cdot 10^{-21}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{c}{b} \cdot a, -0.6666666666666666 \cdot b\right)}{a}\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{\left(-3 \cdot a\right) \cdot c}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -5.6999999999999996e-21Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites51.9%
Taylor expanded in b around -inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6434.2
Applied rewrites34.2%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f6434.9
Applied rewrites34.9%
if -5.6999999999999996e-21 < b < 4.49999999999999969e-117Initial program 51.9%
Taylor expanded in b around 0
distribute-lft-neg-inN/A
metadata-evalN/A
lower-sqrt.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.8
Applied rewrites28.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6428.8
Applied rewrites28.8%
if 4.49999999999999969e-117 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5.7e-21)
(/ (* -2.0 b) (* 3.0 a))
(if (<= b 4.5e-117)
(/ (sqrt (* (* -3.0 a) c)) (* 3.0 a))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.7e-21) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 4.5e-117) {
tmp = sqrt(((-3.0 * a) * c)) / (3.0 * a);
} 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 <= (-5.7d-21)) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
else if (b <= 4.5d-117) then
tmp = sqrt((((-3.0d0) * a) * c)) / (3.0d0 * a)
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 <= -5.7e-21) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 4.5e-117) {
tmp = Math.sqrt(((-3.0 * a) * c)) / (3.0 * a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.7e-21: tmp = (-2.0 * b) / (3.0 * a) elif b <= 4.5e-117: tmp = math.sqrt(((-3.0 * a) * c)) / (3.0 * a) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.7e-21) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); elseif (b <= 4.5e-117) tmp = Float64(sqrt(Float64(Float64(-3.0 * a) * c)) / Float64(3.0 * a)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.7e-21) tmp = (-2.0 * b) / (3.0 * a); elseif (b <= 4.5e-117) tmp = sqrt(((-3.0 * a) * c)) / (3.0 * a); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.7e-21], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.5e-117], N[(N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c), $MachinePrecision]], $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.7 \cdot 10^{-21}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{\left(-3 \cdot a\right) \cdot c}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -5.6999999999999996e-21Initial program 51.9%
Taylor expanded in b around -inf
lower-*.f6435.1
Applied rewrites35.1%
if -5.6999999999999996e-21 < b < 4.49999999999999969e-117Initial program 51.9%
Taylor expanded in b around 0
distribute-lft-neg-inN/A
metadata-evalN/A
lower-sqrt.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.8
Applied rewrites28.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6428.8
Applied rewrites28.8%
if 4.49999999999999969e-117 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5.7e-21)
(/ (* -2.0 b) (* 3.0 a))
(if (<= b 4.5e-117)
(* (/ (sqrt (* -3.0 (* c a))) a) 0.3333333333333333)
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.7e-21) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 4.5e-117) {
tmp = (sqrt((-3.0 * (c * a))) / a) * 0.3333333333333333;
} 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 <= (-5.7d-21)) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
else if (b <= 4.5d-117) then
tmp = (sqrt(((-3.0d0) * (c * a))) / a) * 0.3333333333333333d0
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 <= -5.7e-21) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 4.5e-117) {
tmp = (Math.sqrt((-3.0 * (c * a))) / a) * 0.3333333333333333;
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.7e-21: tmp = (-2.0 * b) / (3.0 * a) elif b <= 4.5e-117: tmp = (math.sqrt((-3.0 * (c * a))) / a) * 0.3333333333333333 else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.7e-21) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); elseif (b <= 4.5e-117) tmp = Float64(Float64(sqrt(Float64(-3.0 * Float64(c * a))) / a) * 0.3333333333333333); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.7e-21) tmp = (-2.0 * b) / (3.0 * a); elseif (b <= 4.5e-117) tmp = (sqrt((-3.0 * (c * a))) / a) * 0.3333333333333333; else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.7e-21], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.5e-117], N[(N[(N[Sqrt[N[(-3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.7 \cdot 10^{-21}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{-3 \cdot \left(c \cdot a\right)}}{a} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -5.6999999999999996e-21Initial program 51.9%
Taylor expanded in b around -inf
lower-*.f6435.1
Applied rewrites35.1%
if -5.6999999999999996e-21 < b < 4.49999999999999969e-117Initial program 51.9%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-sqrt.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.8
Applied rewrites28.8%
if 4.49999999999999969e-117 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5.7e-21)
(/ (* -2.0 b) (* 3.0 a))
(if (<= b 6e-102)
(* (sqrt (* (/ c a) -3.0)) 0.3333333333333333)
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.7e-21) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 6e-102) {
tmp = sqrt(((c / a) * -3.0)) * 0.3333333333333333;
} 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 <= (-5.7d-21)) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
else if (b <= 6d-102) then
tmp = sqrt(((c / a) * (-3.0d0))) * 0.3333333333333333d0
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 <= -5.7e-21) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 6e-102) {
tmp = Math.sqrt(((c / a) * -3.0)) * 0.3333333333333333;
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.7e-21: tmp = (-2.0 * b) / (3.0 * a) elif b <= 6e-102: tmp = math.sqrt(((c / a) * -3.0)) * 0.3333333333333333 else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.7e-21) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); elseif (b <= 6e-102) tmp = Float64(sqrt(Float64(Float64(c / a) * -3.0)) * 0.3333333333333333); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.7e-21) tmp = (-2.0 * b) / (3.0 * a); elseif (b <= 6e-102) tmp = sqrt(((c / a) * -3.0)) * 0.3333333333333333; else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.7e-21], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-102], N[(N[Sqrt[N[(N[(c / a), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.7 \cdot 10^{-21}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-102}:\\
\;\;\;\;\sqrt{\frac{c}{a} \cdot -3} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -5.6999999999999996e-21Initial program 51.9%
Taylor expanded in b around -inf
lower-*.f6435.1
Applied rewrites35.1%
if -5.6999999999999996e-21 < b < 6e-102Initial program 51.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
rem-square-sqrtN/A
lower-sqrt.f64N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6417.3
Applied rewrites17.3%
if 6e-102 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c)
:precision binary64
(if (<= b -4.4e-163)
(/ (* -2.0 b) (* 3.0 a))
(if (<= b 2.4e-116)
(* -0.3333333333333333 (sqrt (* (/ c a) -3.0)))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e-163) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 2.4e-116) {
tmp = -0.3333333333333333 * sqrt(((c / a) * -3.0));
} 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 <= (-4.4d-163)) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
else if (b <= 2.4d-116) then
tmp = (-0.3333333333333333d0) * sqrt(((c / a) * (-3.0d0)))
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 <= -4.4e-163) {
tmp = (-2.0 * b) / (3.0 * a);
} else if (b <= 2.4e-116) {
tmp = -0.3333333333333333 * Math.sqrt(((c / a) * -3.0));
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.4e-163: tmp = (-2.0 * b) / (3.0 * a) elif b <= 2.4e-116: tmp = -0.3333333333333333 * math.sqrt(((c / a) * -3.0)) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.4e-163) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); elseif (b <= 2.4e-116) tmp = Float64(-0.3333333333333333 * sqrt(Float64(Float64(c / a) * -3.0))); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.4e-163) tmp = (-2.0 * b) / (3.0 * a); elseif (b <= 2.4e-116) tmp = -0.3333333333333333 * sqrt(((c / a) * -3.0)); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.4e-163], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.4e-116], N[(-0.3333333333333333 * N[Sqrt[N[(N[(c / a), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{-163}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-116}:\\
\;\;\;\;-0.3333333333333333 \cdot \sqrt{\frac{c}{a} \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -4.40000000000000022e-163Initial program 51.9%
Taylor expanded in b around -inf
lower-*.f6435.1
Applied rewrites35.1%
if -4.40000000000000022e-163 < b < 2.39999999999999993e-116Initial program 51.9%
Taylor expanded in a around -inf
lower-*.f64N/A
rem-square-sqrtN/A
lower-sqrt.f64N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6417.5
Applied rewrites17.5%
if 2.39999999999999993e-116 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c) :precision binary64 (if (<= b 8e-253) (/ (- (fabs b) b) (* 3.0 a)) (/ (* -0.5 c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 8e-253) {
tmp = (fabs(b) - b) / (3.0 * a);
} 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 <= 8d-253) then
tmp = (abs(b) - b) / (3.0d0 * a)
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 <= 8e-253) {
tmp = (Math.abs(b) - b) / (3.0 * a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 8e-253: tmp = (math.fabs(b) - b) / (3.0 * a) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 8e-253) tmp = Float64(Float64(abs(b) - b) / Float64(3.0 * a)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 8e-253) tmp = (abs(b) - b) / (3.0 * a); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 8e-253], N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8 \cdot 10^{-253}:\\
\;\;\;\;\frac{\left|b\right| - b}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < 8.0000000000000005e-253Initial program 51.9%
Taylor expanded in a around 0
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6444.1
Applied rewrites44.1%
if 8.0000000000000005e-253 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c) :precision binary64 (if (<= b 8e-253) (/ (* -2.0 b) (* 3.0 a)) (/ (* -0.5 c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 8e-253) {
tmp = (-2.0 * b) / (3.0 * a);
} 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 <= 8d-253) then
tmp = ((-2.0d0) * b) / (3.0d0 * a)
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 <= 8e-253) {
tmp = (-2.0 * b) / (3.0 * a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 8e-253: tmp = (-2.0 * b) / (3.0 * a) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 8e-253) tmp = Float64(Float64(-2.0 * b) / Float64(3.0 * a)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 8e-253) tmp = (-2.0 * b) / (3.0 * a); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 8e-253], N[(N[(-2.0 * b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8 \cdot 10^{-253}:\\
\;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < 8.0000000000000005e-253Initial program 51.9%
Taylor expanded in b around -inf
lower-*.f6435.1
Applied rewrites35.1%
if 8.0000000000000005e-253 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c) :precision binary64 (if (<= b 8e-253) (/ (* -0.6666666666666666 b) a) (/ (* -0.5 c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 8e-253) {
tmp = (-0.6666666666666666 * b) / a;
} 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 <= 8d-253) then
tmp = ((-0.6666666666666666d0) * b) / a
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 <= 8e-253) {
tmp = (-0.6666666666666666 * b) / a;
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 8e-253: tmp = (-0.6666666666666666 * b) / a else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 8e-253) tmp = Float64(Float64(-0.6666666666666666 * b) / a); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 8e-253) tmp = (-0.6666666666666666 * b) / a; else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 8e-253], N[(N[(-0.6666666666666666 * b), $MachinePrecision] / a), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8 \cdot 10^{-253}:\\
\;\;\;\;\frac{-0.6666666666666666 \cdot b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < 8.0000000000000005e-253Initial program 51.9%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites51.9%
Taylor expanded in b around -inf
lower-*.f6435.0
Applied rewrites35.0%
if 8.0000000000000005e-253 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c) :precision binary64 (if (<= b 8e-253) (* -0.6666666666666666 (/ b a)) (/ (* -0.5 c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 8e-253) {
tmp = -0.6666666666666666 * (b / a);
} 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 <= 8d-253) then
tmp = (-0.6666666666666666d0) * (b / a)
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 <= 8e-253) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 8e-253: tmp = -0.6666666666666666 * (b / a) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 8e-253) tmp = Float64(-0.6666666666666666 * Float64(b / a)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 8e-253) tmp = -0.6666666666666666 * (b / a); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 8e-253], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8 \cdot 10^{-253}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < 8.0000000000000005e-253Initial program 51.9%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
if 8.0000000000000005e-253 < b Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lift-neg.f64N/A
+-commutativeN/A
pow2N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
pow2N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (a b c) :precision binary64 (if (<= b 8e-253) (* -0.6666666666666666 (/ b a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 8e-253) {
tmp = -0.6666666666666666 * (b / 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 <= 8d-253) then
tmp = (-0.6666666666666666d0) * (b / 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 <= 8e-253) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 8e-253: tmp = -0.6666666666666666 * (b / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 8e-253) tmp = Float64(-0.6666666666666666 * Float64(b / 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 <= 8e-253) tmp = -0.6666666666666666 * (b / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 8e-253], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8 \cdot 10^{-253}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 8.0000000000000005e-253Initial program 51.9%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
if 8.0000000000000005e-253 < b Initial program 51.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
(FPCore (a b c) :precision binary64 (* -0.6666666666666666 (/ b a)))
double code(double a, double b, double c) {
return -0.6666666666666666 * (b / 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 = (-0.6666666666666666d0) * (b / a)
end function
public static double code(double a, double b, double c) {
return -0.6666666666666666 * (b / a);
}
def code(a, b, c): return -0.6666666666666666 * (b / a)
function code(a, b, c) return Float64(-0.6666666666666666 * Float64(b / a)) end
function tmp = code(a, b, c) tmp = -0.6666666666666666 * (b / a); end
code[a_, b_, c_] := N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.6666666666666666 \cdot \frac{b}{a}
\end{array}
Initial program 51.9%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
(FPCore (a b c) :precision binary64 (* -0.3333333333333333 (/ b a)))
double code(double a, double b, double c) {
return -0.3333333333333333 * (b / 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 = (-0.3333333333333333d0) * (b / a)
end function
public static double code(double a, double b, double c) {
return -0.3333333333333333 * (b / a);
}
def code(a, b, c): return -0.3333333333333333 * (b / a)
function code(a, b, c) return Float64(-0.3333333333333333 * Float64(b / a)) end
function tmp = code(a, b, c) tmp = -0.3333333333333333 * (b / a); end
code[a_, b_, c_] := N[(-0.3333333333333333 * N[(b / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.3333333333333333 \cdot \frac{b}{a}
\end{array}
Initial program 51.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f6468.2
Applied rewrites68.2%
Taylor expanded in b around inf
lower-*.f64N/A
lift-/.f6415.4
Applied rewrites15.4%
herbie shell --seed 2025143
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))