
(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);
}
real(8) function code(a, b, c)
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}
Sampling outcomes in binary64 precision:
Herbie found 11 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);
}
real(8) function code(a, b, c)
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 -1.35e+154)
(* b (- (* (/ (/ c b) b) (- 0.0 -0.5)) (/ 0.6666666666666666 a)))
(if (<= b 3.2e-75)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.35e+154) {
tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
} else if (b <= 3.2e-75) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1.35d+154)) then
tmp = b * ((((c / b) / b) * (0.0d0 - (-0.5d0))) - (0.6666666666666666d0 / a))
else if (b <= 3.2d-75) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (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 <= -1.35e+154) {
tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
} else if (b <= 3.2e-75) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.35e+154: tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a)) elif b <= 3.2e-75: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.35e+154) tmp = Float64(b * Float64(Float64(Float64(Float64(c / b) / b) * Float64(0.0 - -0.5)) - Float64(0.6666666666666666 / a))); elseif (b <= 3.2e-75) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(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 <= -1.35e+154) tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a)); elseif (b <= 3.2e-75) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.35e+154], N[(b * N[(N[(N[(N[(c / b), $MachinePrecision] / b), $MachinePrecision] * N[(0.0 - -0.5), $MachinePrecision]), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.2e-75], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{-75}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -1.35000000000000003e154Initial program 44.4%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6497.4%
Simplified97.4%
if -1.35000000000000003e154 < b < 3.19999999999999977e-75Initial program 85.6%
if 3.19999999999999977e-75 < b Initial program 17.5%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6483.4%
Simplified83.4%
Final simplification86.4%
(FPCore (a b c)
:precision binary64
(if (<= b -1e+154)
(* b (- (* (/ (/ c b) b) (- 0.0 -0.5)) (/ 0.6666666666666666 a)))
(if (<= b 7.2e-76)
(/ (- (sqrt (+ (* b b) (* a (* c -3.0)))) b) (* a 3.0))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e+154) {
tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
} else if (b <= 7.2e-76) {
tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1d+154)) then
tmp = b * ((((c / b) / b) * (0.0d0 - (-0.5d0))) - (0.6666666666666666d0 / a))
else if (b <= 7.2d-76) then
tmp = (sqrt(((b * b) + (a * (c * (-3.0d0))))) - b) / (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 <= -1e+154) {
tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
} else if (b <= 7.2e-76) {
tmp = (Math.sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e+154: tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a)) elif b <= 7.2e-76: tmp = (math.sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e+154) tmp = Float64(b * Float64(Float64(Float64(Float64(c / b) / b) * Float64(0.0 - -0.5)) - Float64(0.6666666666666666 / a))); elseif (b <= 7.2e-76) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -3.0)))) - b) / Float64(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 <= -1e+154) tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a)); elseif (b <= 7.2e-76) tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e+154], N[(b * N[(N[(N[(N[(c / b), $MachinePrecision] / b), $MachinePrecision] * N[(0.0 - -0.5), $MachinePrecision]), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.2e-76], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\
\;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\
\mathbf{elif}\;b \leq 7.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -1.00000000000000004e154Initial program 44.4%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6497.4%
Simplified97.4%
if -1.00000000000000004e154 < b < 7.2000000000000001e-76Initial program 85.6%
/-lowering-/.f64N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
*-lowering-*.f6485.6%
Simplified85.6%
if 7.2000000000000001e-76 < b Initial program 17.5%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6483.4%
Simplified83.4%
Final simplification86.4%
(FPCore (a b c)
:precision binary64
(if (<= b -1e+154)
(* b (- (* (/ (/ c b) b) (- 0.0 -0.5)) (/ 0.6666666666666666 a)))
(if (<= b 6e-75)
(* (- (sqrt (+ (* b b) (* a (* c -3.0)))) b) (/ 0.3333333333333333 a))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e+154) {
tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
} else if (b <= 6e-75) {
tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) * (0.3333333333333333 / a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1d+154)) then
tmp = b * ((((c / b) / b) * (0.0d0 - (-0.5d0))) - (0.6666666666666666d0 / a))
else if (b <= 6d-75) then
tmp = (sqrt(((b * b) + (a * (c * (-3.0d0))))) - b) * (0.3333333333333333d0 / 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 <= -1e+154) {
tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
} else if (b <= 6e-75) {
tmp = (Math.sqrt(((b * b) + (a * (c * -3.0)))) - b) * (0.3333333333333333 / a);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e+154: tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a)) elif b <= 6e-75: tmp = (math.sqrt(((b * b) + (a * (c * -3.0)))) - b) * (0.3333333333333333 / a) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e+154) tmp = Float64(b * Float64(Float64(Float64(Float64(c / b) / b) * Float64(0.0 - -0.5)) - Float64(0.6666666666666666 / a))); elseif (b <= 6e-75) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -3.0)))) - b) * Float64(0.3333333333333333 / 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 <= -1e+154) tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a)); elseif (b <= 6e-75) tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) * (0.3333333333333333 / a); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e+154], N[(b * N[(N[(N[(N[(c / b), $MachinePrecision] / b), $MachinePrecision] * N[(0.0 - -0.5), $MachinePrecision]), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-75], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * N[(0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\
\;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-75}:\\
\;\;\;\;\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -1.00000000000000004e154Initial program 44.4%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6497.4%
Simplified97.4%
if -1.00000000000000004e154 < b < 5.9999999999999997e-75Initial program 85.6%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
Applied egg-rr85.5%
if 5.9999999999999997e-75 < b Initial program 17.5%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6483.4%
Simplified83.4%
Final simplification86.4%
(FPCore (a b c)
:precision binary64
(if (<= b -7e-142)
(/ (- (* a (- (* (/ c b) 1.5) (/ b a))) b) (* a 3.0))
(if (<= b 6e-75)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7e-142) {
tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
} else if (b <= 6e-75) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-7d-142)) then
tmp = ((a * (((c / b) * 1.5d0) - (b / a))) - b) / (a * 3.0d0)
else if (b <= 6d-75) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (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 <= -7e-142) {
tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
} else if (b <= 6e-75) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7e-142: tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0) elif b <= 6e-75: tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -7e-142) tmp = Float64(Float64(Float64(a * Float64(Float64(Float64(c / b) * 1.5) - Float64(b / a))) - b) / Float64(a * 3.0)); elseif (b <= 6e-75) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(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 <= -7e-142) tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0); elseif (b <= 6e-75) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7e-142], N[(N[(N[(a * N[(N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-75], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{-142}:\\
\;\;\;\;\frac{a \cdot \left(\frac{c}{b} \cdot 1.5 - \frac{b}{a}\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-75}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -7.00000000000000029e-142Initial program 76.3%
/-lowering-/.f64N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
*-lowering-*.f6476.3%
Simplified76.3%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f6490.1%
Simplified90.1%
Taylor expanded in a around inf
*-lowering-*.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6492.4%
Simplified92.4%
if -7.00000000000000029e-142 < b < 5.9999999999999997e-75Initial program 76.2%
/-lowering-/.f64N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
*-lowering-*.f6476.1%
Simplified76.1%
Taylor expanded in b around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6474.7%
Simplified74.7%
if 5.9999999999999997e-75 < b Initial program 17.5%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6483.4%
Simplified83.4%
Final simplification84.5%
(FPCore (a b c)
:precision binary64
(if (<= b -7e-142)
(/ (- (* a (- (* (/ c b) 1.5) (/ b a))) b) (* a 3.0))
(if (<= b 5.2e-76)
(* (/ 0.3333333333333333 a) (- (sqrt (* c (* a -3.0))) b))
(/ (* -0.5 c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7e-142) {
tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
} else if (b <= 5.2e-76) {
tmp = (0.3333333333333333 / a) * (sqrt((c * (a * -3.0))) - b);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-7d-142)) then
tmp = ((a * (((c / b) * 1.5d0) - (b / a))) - b) / (a * 3.0d0)
else if (b <= 5.2d-76) then
tmp = (0.3333333333333333d0 / a) * (sqrt((c * (a * (-3.0d0)))) - 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 <= -7e-142) {
tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
} else if (b <= 5.2e-76) {
tmp = (0.3333333333333333 / a) * (Math.sqrt((c * (a * -3.0))) - b);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7e-142: tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0) elif b <= 5.2e-76: tmp = (0.3333333333333333 / a) * (math.sqrt((c * (a * -3.0))) - b) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -7e-142) tmp = Float64(Float64(Float64(a * Float64(Float64(Float64(c / b) * 1.5) - Float64(b / a))) - b) / Float64(a * 3.0)); elseif (b <= 5.2e-76) tmp = Float64(Float64(0.3333333333333333 / a) * Float64(sqrt(Float64(c * Float64(a * -3.0))) - b)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -7e-142) tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0); elseif (b <= 5.2e-76) tmp = (0.3333333333333333 / a) * (sqrt((c * (a * -3.0))) - b); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7e-142], N[(N[(N[(a * N[(N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-76], N[(N[(0.3333333333333333 / a), $MachinePrecision] * N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{-142}:\\
\;\;\;\;\frac{a \cdot \left(\frac{c}{b} \cdot 1.5 - \frac{b}{a}\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(\sqrt{c \cdot \left(a \cdot -3\right)} - b\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -7.00000000000000029e-142Initial program 76.3%
/-lowering-/.f64N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
*-lowering-*.f6476.3%
Simplified76.3%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f6490.1%
Simplified90.1%
Taylor expanded in a around inf
*-lowering-*.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6492.4%
Simplified92.4%
if -7.00000000000000029e-142 < b < 5.1999999999999999e-76Initial program 76.2%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
Applied egg-rr76.1%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6474.6%
Simplified74.6%
if 5.1999999999999999e-76 < b Initial program 17.5%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6483.4%
Simplified83.4%
Final simplification84.5%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (+ (/ (* b -0.6666666666666666) a) (/ (* c 0.5) b)) (/ (* -0.5 c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5d-310)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + ((c * 0.5d0) / 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 <= -5e-310) {
tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b);
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b) else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(Float64(c * 0.5) / b)); else tmp = Float64(Float64(-0.5 * c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b); else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(N[(c * 0.5), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c \cdot 0.5}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 78.9%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6472.3%
Simplified72.3%
Taylor expanded in c around 0
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6472.5%
Simplified72.5%
if -4.999999999999985e-310 < b Initial program 30.5%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6468.8%
Simplified68.8%
Final simplification70.6%
(FPCore (a b c) :precision binary64 (if (<= b 3.5e-280) (/ (* b -0.6666666666666666) a) (/ (* -0.5 c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-280) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 3.5d-280) then
tmp = (b * (-0.6666666666666666d0)) / 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 <= 3.5e-280) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (-0.5 * c) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.5e-280: tmp = (b * -0.6666666666666666) / a else: tmp = (-0.5 * c) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.5e-280) tmp = Float64(Float64(b * -0.6666666666666666) / 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 <= 3.5e-280) tmp = (b * -0.6666666666666666) / a; else tmp = (-0.5 * c) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-280], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b}\\
\end{array}
\end{array}
if b < 3.5000000000000001e-280Initial program 78.6%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.7%
Simplified70.7%
if 3.5000000000000001e-280 < b Initial program 29.7%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.3%
Simplified70.3%
Final simplification70.5%
(FPCore (a b c) :precision binary64 (if (<= b 3.5e-280) (/ (* b -0.6666666666666666) a) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-280) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 3.5d-280) then
tmp = (b * (-0.6666666666666666d0)) / a
else
tmp = c * ((-0.5d0) / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-280) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.5e-280: tmp = (b * -0.6666666666666666) / a else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.5e-280) tmp = Float64(Float64(b * -0.6666666666666666) / a); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3.5e-280) tmp = (b * -0.6666666666666666) / a; else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-280], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 3.5000000000000001e-280Initial program 78.6%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.7%
Simplified70.7%
if 3.5000000000000001e-280 < b Initial program 29.7%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr29.6%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.0%
Simplified70.0%
div-invN/A
metadata-evalN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.0%
Applied egg-rr70.0%
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-eval70.0%
Applied egg-rr70.0%
(FPCore (a b c) :precision binary64 (if (<= b 3e-279) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3e-279) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 3d-279) then
tmp = b * ((-0.6666666666666666d0) / a)
else
tmp = c * ((-0.5d0) / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3e-279) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3e-279: tmp = b * (-0.6666666666666666 / a) else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3e-279) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3e-279) tmp = b * (-0.6666666666666666 / a); else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3e-279], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-279}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 3e-279Initial program 78.6%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.7%
Simplified70.7%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6470.7%
Applied egg-rr70.7%
if 3e-279 < b Initial program 29.7%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr29.6%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.0%
Simplified70.0%
div-invN/A
metadata-evalN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.0%
Applied egg-rr70.0%
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-eval70.0%
Applied egg-rr70.0%
Final simplification70.4%
(FPCore (a b c) :precision binary64 (if (<= b 3.5e-280) (* (/ b a) -0.6666666666666666) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-280) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 3.5d-280) then
tmp = (b / a) * (-0.6666666666666666d0)
else
tmp = c * ((-0.5d0) / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-280) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.5e-280: tmp = (b / a) * -0.6666666666666666 else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.5e-280) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3.5e-280) tmp = (b / a) * -0.6666666666666666; else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-280], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 3.5000000000000001e-280Initial program 78.6%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.7%
Simplified70.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6470.6%
Applied egg-rr70.6%
if 3.5000000000000001e-280 < b Initial program 29.7%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr29.6%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.0%
Simplified70.0%
div-invN/A
metadata-evalN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.0%
Applied egg-rr70.0%
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-eval70.0%
Applied egg-rr70.0%
Final simplification70.3%
(FPCore (a b c) :precision binary64 (* (/ b a) -0.6666666666666666))
double code(double a, double b, double c) {
return (b / a) * -0.6666666666666666;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (b / a) * (-0.6666666666666666d0)
end function
public static double code(double a, double b, double c) {
return (b / a) * -0.6666666666666666;
}
def code(a, b, c): return (b / a) * -0.6666666666666666
function code(a, b, c) return Float64(Float64(b / a) * -0.6666666666666666) end
function tmp = code(a, b, c) tmp = (b / a) * -0.6666666666666666; end
code[a_, b_, c_] := N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{a} \cdot -0.6666666666666666
\end{array}
Initial program 53.7%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6436.2%
Simplified36.2%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6436.1%
Applied egg-rr36.1%
Final simplification36.1%
herbie shell --seed 2024141
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))