
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.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) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.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) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}
(FPCore (a b c)
:precision binary64
(if (<= b -5e+154)
(/ (- b) a)
(if (<= b 9.2e-10)
(/ (- (sqrt (- (* b b) (* (* a 4.0) c))) b) (* a 2.0))
(/ (- c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e+154) {
tmp = -b / a;
} else if (b <= 9.2e-10) {
tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
} else {
tmp = -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+154)) then
tmp = -b / a
else if (b <= 9.2d-10) then
tmp = (sqrt(((b * b) - ((a * 4.0d0) * c))) - b) / (a * 2.0d0)
else
tmp = -c / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e+154) {
tmp = -b / a;
} else if (b <= 9.2e-10) {
tmp = (Math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e+154: tmp = -b / a elif b <= 9.2e-10: tmp = (math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0) else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e+154) tmp = Float64(Float64(-b) / a); elseif (b <= 9.2e-10) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 4.0) * c))) - b) / Float64(a * 2.0)); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e+154) tmp = -b / a; elseif (b <= 9.2e-10) tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0); else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e+154], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 9.2e-10], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+154}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -5.00000000000000004e154Initial program 49.6%
neg-sub049.6%
associate-+l-49.6%
sub0-neg49.6%
neg-mul-149.6%
associate-*l/49.6%
*-commutative49.6%
associate-/r*49.6%
/-rgt-identity49.6%
metadata-eval49.6%
Simplified49.6%
Taylor expanded in b around -inf 100.0%
associate-*r/100.0%
mul-1-neg100.0%
Simplified100.0%
if -5.00000000000000004e154 < b < 9.20000000000000028e-10Initial program 80.1%
if 9.20000000000000028e-10 < b Initial program 8.1%
neg-sub08.1%
associate-+l-8.1%
sub0-neg8.1%
neg-mul-18.1%
associate-*l/8.0%
*-commutative8.0%
associate-/r*8.0%
/-rgt-identity8.0%
metadata-eval8.0%
Simplified8.1%
Taylor expanded in b around inf 93.9%
mul-1-neg93.9%
distribute-neg-frac93.9%
Simplified93.9%
Final simplification88.1%
(FPCore (a b c) :precision binary64 (if (<= b -1.45e-74) (- (/ c b) (/ b a)) (if (<= b 7e-10) (/ (- (sqrt (* a (* c -4.0))) b) (* a 2.0)) (/ (- c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.45e-74) {
tmp = (c / b) - (b / a);
} else if (b <= 7e-10) {
tmp = (sqrt((a * (c * -4.0))) - b) / (a * 2.0);
} else {
tmp = -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.45d-74)) then
tmp = (c / b) - (b / a)
else if (b <= 7d-10) then
tmp = (sqrt((a * (c * (-4.0d0)))) - b) / (a * 2.0d0)
else
tmp = -c / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.45e-74) {
tmp = (c / b) - (b / a);
} else if (b <= 7e-10) {
tmp = (Math.sqrt((a * (c * -4.0))) - b) / (a * 2.0);
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.45e-74: tmp = (c / b) - (b / a) elif b <= 7e-10: tmp = (math.sqrt((a * (c * -4.0))) - b) / (a * 2.0) else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.45e-74) tmp = Float64(Float64(c / b) - Float64(b / a)); elseif (b <= 7e-10) tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -4.0))) - b) / Float64(a * 2.0)); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.45e-74) tmp = (c / b) - (b / a); elseif (b <= 7e-10) tmp = (sqrt((a * (c * -4.0))) - b) / (a * 2.0); else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.45e-74], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e-10], N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{-74}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{elif}\;b \leq 7 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -1.45e-74Initial program 70.3%
neg-sub070.3%
associate-+l-70.3%
sub0-neg70.3%
neg-mul-170.3%
associate-*l/70.1%
*-commutative70.1%
associate-/r*70.1%
/-rgt-identity70.1%
metadata-eval70.1%
Simplified70.1%
Taylor expanded in b around -inf 89.8%
mul-1-neg89.8%
unsub-neg89.8%
Simplified89.8%
if -1.45e-74 < b < 6.99999999999999961e-10Initial program 73.3%
Taylor expanded in b around 0 67.2%
*-commutative67.2%
*-commutative67.2%
associate-*r*67.2%
Simplified67.2%
if 6.99999999999999961e-10 < b Initial program 8.1%
neg-sub08.1%
associate-+l-8.1%
sub0-neg8.1%
neg-mul-18.1%
associate-*l/8.0%
*-commutative8.0%
associate-/r*8.0%
/-rgt-identity8.0%
metadata-eval8.0%
Simplified8.1%
Taylor expanded in b around inf 93.9%
mul-1-neg93.9%
distribute-neg-frac93.9%
Simplified93.9%
Final simplification83.5%
(FPCore (a b c) :precision binary64 (if (<= b -1.05e-296) (- (/ c b) (/ b a)) (/ 1.0 (- (/ a b) (/ b c)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.05e-296) {
tmp = (c / b) - (b / a);
} else {
tmp = 1.0 / ((a / b) - (b / c));
}
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.05d-296)) then
tmp = (c / b) - (b / a)
else
tmp = 1.0d0 / ((a / b) - (b / c))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.05e-296) {
tmp = (c / b) - (b / a);
} else {
tmp = 1.0 / ((a / b) - (b / c));
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.05e-296: tmp = (c / b) - (b / a) else: tmp = 1.0 / ((a / b) - (b / c)) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.05e-296) tmp = Float64(Float64(c / b) - Float64(b / a)); else tmp = Float64(1.0 / Float64(Float64(a / b) - Float64(b / c))); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.05e-296) tmp = (c / b) - (b / a); else tmp = 1.0 / ((a / b) - (b / c)); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.05e-296], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(a / b), $MachinePrecision] - N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.05 \cdot 10^{-296}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\
\end{array}
\end{array}
if b < -1.05e-296Initial program 74.5%
neg-sub074.5%
associate-+l-74.5%
sub0-neg74.5%
neg-mul-174.5%
associate-*l/74.3%
*-commutative74.3%
associate-/r*74.3%
/-rgt-identity74.3%
metadata-eval74.3%
Simplified74.3%
Taylor expanded in b around -inf 68.6%
mul-1-neg68.6%
unsub-neg68.6%
Simplified68.6%
if -1.05e-296 < b Initial program 30.7%
neg-sub030.7%
associate-+l-30.7%
sub0-neg30.7%
neg-mul-130.7%
associate-*l/30.8%
*-commutative30.8%
associate-/r*30.8%
/-rgt-identity30.8%
metadata-eval30.8%
Simplified30.8%
associate-*r/30.7%
clear-num30.7%
Applied egg-rr30.7%
Taylor expanded in a around 0 67.2%
mul-1-neg67.2%
unsub-neg67.2%
Simplified67.2%
Final simplification67.9%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (- (/ c b) (/ b a)) (/ (- c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (c / b) - (b / a);
} else {
tmp = -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 = (c / b) - (b / a)
else
tmp = -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 = (c / b) - (b / a);
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (c / b) - (b / a) else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(c / b) - Float64(b / a)); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (c / b) - (b / a); else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 74.9%
neg-sub074.9%
associate-+l-74.9%
sub0-neg74.9%
neg-mul-174.9%
associate-*l/74.7%
*-commutative74.7%
associate-/r*74.7%
/-rgt-identity74.7%
metadata-eval74.7%
Simplified74.7%
Taylor expanded in b around -inf 67.6%
mul-1-neg67.6%
unsub-neg67.6%
Simplified67.6%
if -4.999999999999985e-310 < b Initial program 29.6%
neg-sub029.6%
associate-+l-29.6%
sub0-neg29.6%
neg-mul-129.6%
associate-*l/29.7%
*-commutative29.7%
associate-/r*29.7%
/-rgt-identity29.7%
metadata-eval29.7%
Simplified29.7%
Taylor expanded in b around inf 68.1%
mul-1-neg68.1%
distribute-neg-frac68.1%
Simplified68.1%
Final simplification67.9%
(FPCore (a b c) :precision binary64 (if (<= b 7.5e+56) (/ (- b) a) (/ c b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 7.5e+56) {
tmp = -b / a;
} else {
tmp = 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 <= 7.5d+56) then
tmp = -b / a
else
tmp = c / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 7.5e+56) {
tmp = -b / a;
} else {
tmp = c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 7.5e+56: tmp = -b / a else: tmp = c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 7.5e+56) tmp = Float64(Float64(-b) / a); else tmp = Float64(c / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 7.5e+56) tmp = -b / a; else tmp = c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 7.5e+56], N[((-b) / a), $MachinePrecision], N[(c / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.5 \cdot 10^{+56}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b}\\
\end{array}
\end{array}
if b < 7.4999999999999999e56Initial program 69.0%
neg-sub069.0%
associate-+l-69.0%
sub0-neg69.0%
neg-mul-169.0%
associate-*l/69.0%
*-commutative69.0%
associate-/r*69.0%
/-rgt-identity69.0%
metadata-eval69.0%
Simplified69.0%
Taylor expanded in b around -inf 47.5%
associate-*r/47.5%
mul-1-neg47.5%
Simplified47.5%
if 7.4999999999999999e56 < b Initial program 7.2%
neg-sub07.2%
associate-+l-7.2%
sub0-neg7.2%
neg-mul-17.2%
associate-*l/7.2%
*-commutative7.2%
associate-/r*7.2%
/-rgt-identity7.2%
metadata-eval7.2%
Simplified7.2%
Taylor expanded in b around -inf 2.6%
mul-1-neg2.6%
unsub-neg2.6%
Simplified2.6%
Taylor expanded in c around inf 24.3%
Final simplification41.3%
(FPCore (a b c) :precision binary64 (if (<= b 6e-267) (/ (- b) a) (/ (- c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 6e-267) {
tmp = -b / a;
} else {
tmp = -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 <= 6d-267) then
tmp = -b / a
else
tmp = -c / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 6e-267) {
tmp = -b / a;
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 6e-267: tmp = -b / a else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 6e-267) tmp = Float64(Float64(-b) / a); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 6e-267) tmp = -b / a; else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 6e-267], N[((-b) / a), $MachinePrecision], N[((-c) / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6 \cdot 10^{-267}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < 5.9999999999999999e-267Initial program 75.8%
neg-sub075.8%
associate-+l-75.8%
sub0-neg75.8%
neg-mul-175.8%
associate-*l/75.6%
*-commutative75.6%
associate-/r*75.6%
/-rgt-identity75.6%
metadata-eval75.6%
Simplified75.6%
Taylor expanded in b around -inf 64.8%
associate-*r/64.8%
mul-1-neg64.8%
Simplified64.8%
if 5.9999999999999999e-267 < b Initial program 26.7%
neg-sub026.7%
associate-+l-26.7%
sub0-neg26.7%
neg-mul-126.7%
associate-*l/26.8%
*-commutative26.8%
associate-/r*26.8%
/-rgt-identity26.8%
metadata-eval26.8%
Simplified26.8%
Taylor expanded in b around inf 70.8%
mul-1-neg70.8%
distribute-neg-frac70.8%
Simplified70.8%
Final simplification67.7%
(FPCore (a b c) :precision binary64 (/ b a))
double code(double a, double b, double c) {
return b / 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 / a
end function
public static double code(double a, double b, double c) {
return b / a;
}
def code(a, b, c): return b / a
function code(a, b, c) return Float64(b / a) end
function tmp = code(a, b, c) tmp = b / a; end
code[a_, b_, c_] := N[(b / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{a}
\end{array}
Initial program 52.6%
neg-sub052.6%
associate-+l-52.6%
sub0-neg52.6%
neg-mul-152.6%
associate-*l/52.5%
*-commutative52.5%
associate-/r*52.5%
/-rgt-identity52.5%
metadata-eval52.5%
Simplified52.5%
associate-*r/52.6%
clear-num52.6%
Applied egg-rr52.6%
Taylor expanded in a around 0 34.8%
mul-1-neg34.8%
unsub-neg34.8%
Simplified34.8%
Taylor expanded in a around inf 2.5%
Final simplification2.5%
(FPCore (a b c) :precision binary64 (/ c b))
double code(double a, double b, double c) {
return c / b;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c / b
end function
public static double code(double a, double b, double c) {
return c / b;
}
def code(a, b, c): return c / b
function code(a, b, c) return Float64(c / b) end
function tmp = code(a, b, c) tmp = c / b; end
code[a_, b_, c_] := N[(c / b), $MachinePrecision]
\begin{array}{l}
\\
\frac{c}{b}
\end{array}
Initial program 52.6%
neg-sub052.6%
associate-+l-52.6%
sub0-neg52.6%
neg-mul-152.6%
associate-*l/52.5%
*-commutative52.5%
associate-/r*52.5%
/-rgt-identity52.5%
metadata-eval52.5%
Simplified52.5%
Taylor expanded in b around -inf 35.5%
mul-1-neg35.5%
unsub-neg35.5%
Simplified35.5%
Taylor expanded in c around inf 8.7%
Final simplification8.7%
herbie shell --seed 2023199
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))