
(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 13 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 -5e+166)
(/ (fma -2.0 b (* (/ a (/ b c)) 1.5)) (* a 3.0))
(if (<= b 3.55e-66)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e+166) {
tmp = fma(-2.0, b, ((a / (b / c)) * 1.5)) / (a * 3.0);
} else if (b <= 3.55e-66) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -5e+166) tmp = Float64(fma(-2.0, b, Float64(Float64(a / Float64(b / c)) * 1.5)) / Float64(a * 3.0)); elseif (b <= 3.55e-66) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -5e+166], N[(N[(-2.0 * b + N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.55e-66], 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[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+166}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2, b, \frac{a}{\frac{b}{c}} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 3.55 \cdot 10^{-66}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -5.0000000000000002e166Initial program 37.5%
associate-*l*37.5%
Simplified37.5%
Taylor expanded in b around -inf 90.2%
fma-def90.2%
*-commutative90.2%
associate-/l*97.5%
Simplified97.5%
if -5.0000000000000002e166 < b < 3.54999999999999982e-66Initial program 77.7%
if 3.54999999999999982e-66 < b Initial program 9.8%
associate-*l*9.8%
Simplified9.8%
Taylor expanded in b around inf 93.1%
associate-*r/93.1%
Simplified93.1%
Final simplification86.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5e+166)
(/ (fma -2.0 b (* (/ a (/ b c)) 1.5)) (* a 3.0))
(if (<= b 1.15e-78)
(/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e+166) {
tmp = fma(-2.0, b, ((a / (b / c)) * 1.5)) / (a * 3.0);
} else if (b <= 1.15e-78) {
tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -5e+166) tmp = Float64(fma(-2.0, b, Float64(Float64(a / Float64(b / c)) * 1.5)) / Float64(a * 3.0)); elseif (b <= 1.15e-78) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -5e+166], N[(N[(-2.0 * b + N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e-78], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+166}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2, b, \frac{a}{\frac{b}{c}} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-78}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -5.0000000000000002e166Initial program 37.5%
associate-*l*37.5%
Simplified37.5%
Taylor expanded in b around -inf 90.2%
fma-def90.2%
*-commutative90.2%
associate-/l*97.5%
Simplified97.5%
if -5.0000000000000002e166 < b < 1.1500000000000001e-78Initial program 77.7%
associate-*l*77.6%
Simplified77.6%
if 1.1500000000000001e-78 < b Initial program 9.8%
associate-*l*9.8%
Simplified9.8%
Taylor expanded in b around inf 93.1%
associate-*r/93.1%
Simplified93.1%
Final simplification86.5%
(FPCore (a b c)
:precision binary64
(if (<= b -9.6e-73)
(* (/ -0.3333333333333333 a) (+ b (- b (/ (* a 1.5) (/ b c)))))
(if (<= b 3.7e-68)
(* (/ 0.3333333333333333 a) (- (sqrt (* (* a c) -3.0)) b))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -9.6e-73) {
tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c))));
} else if (b <= 3.7e-68) {
tmp = (0.3333333333333333 / a) * (sqrt(((a * c) * -3.0)) - b);
} 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 <= (-9.6d-73)) then
tmp = ((-0.3333333333333333d0) / a) * (b + (b - ((a * 1.5d0) / (b / c))))
else if (b <= 3.7d-68) then
tmp = (0.3333333333333333d0 / a) * (sqrt(((a * c) * (-3.0d0))) - b)
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 <= -9.6e-73) {
tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c))));
} else if (b <= 3.7e-68) {
tmp = (0.3333333333333333 / a) * (Math.sqrt(((a * c) * -3.0)) - b);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -9.6e-73: tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c)))) elif b <= 3.7e-68: tmp = (0.3333333333333333 / a) * (math.sqrt(((a * c) * -3.0)) - b) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -9.6e-73) tmp = Float64(Float64(-0.3333333333333333 / a) * Float64(b + Float64(b - Float64(Float64(a * 1.5) / Float64(b / c))))); elseif (b <= 3.7e-68) tmp = Float64(Float64(0.3333333333333333 / a) * Float64(sqrt(Float64(Float64(a * c) * -3.0)) - b)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -9.6e-73) tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c)))); elseif (b <= 3.7e-68) tmp = (0.3333333333333333 / a) * (sqrt(((a * c) * -3.0)) - b); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -9.6e-73], N[(N[(-0.3333333333333333 / a), $MachinePrecision] * N[(b + N[(b - N[(N[(a * 1.5), $MachinePrecision] / N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.7e-68], N[(N[(0.3333333333333333 / a), $MachinePrecision] * N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.6 \cdot 10^{-73}:\\
\;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b + \left(b - \frac{a \cdot 1.5}{\frac{b}{c}}\right)\right)\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{-68}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(\sqrt{\left(a \cdot c\right) \cdot -3} - b\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -9.60000000000000022e-73Initial program 65.2%
associate-*l*65.2%
Simplified65.2%
Taylor expanded in b around -inf 81.5%
+-commutative81.5%
mul-1-neg81.5%
unsub-neg81.5%
associate-*r/81.5%
associate-*r*81.5%
Simplified81.5%
frac-2neg81.5%
div-inv81.4%
Applied egg-rr84.9%
*-commutative84.9%
*-commutative84.9%
associate-/r*84.8%
metadata-eval84.8%
+-commutative84.8%
*-commutative84.8%
associate-*r/84.8%
*-commutative84.8%
associate-/r/84.8%
Simplified84.8%
if -9.60000000000000022e-73 < b < 3.70000000000000002e-68Initial program 70.1%
associate-*l*69.9%
Simplified69.9%
+-commutative69.9%
unsub-neg69.9%
*-un-lft-identity69.9%
cancel-sign-sub-inv69.9%
*-un-lft-identity69.9%
+-commutative69.9%
metadata-eval69.9%
*-commutative69.9%
associate-*r*70.0%
fma-udef70.0%
div-sub70.0%
sub-neg70.0%
Applied egg-rr70.0%
sub-neg70.0%
distribute-rgt-out--70.0%
Simplified70.0%
Taylor expanded in a around inf 62.7%
if 3.70000000000000002e-68 < b Initial program 9.8%
associate-*l*9.8%
Simplified9.8%
Taylor expanded in b around inf 93.1%
associate-*r/93.1%
Simplified93.1%
Final simplification81.6%
(FPCore (a b c)
:precision binary64
(if (<= b -1.72e-74)
(/ (fma -2.0 b (* (/ a (/ b c)) 1.5)) (* a 3.0))
(if (<= b 1.5e-69)
(* (/ 0.3333333333333333 a) (- (sqrt (* (* a c) -3.0)) b))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.72e-74) {
tmp = fma(-2.0, b, ((a / (b / c)) * 1.5)) / (a * 3.0);
} else if (b <= 1.5e-69) {
tmp = (0.3333333333333333 / a) * (sqrt(((a * c) * -3.0)) - b);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -1.72e-74) tmp = Float64(fma(-2.0, b, Float64(Float64(a / Float64(b / c)) * 1.5)) / Float64(a * 3.0)); elseif (b <= 1.5e-69) tmp = Float64(Float64(0.3333333333333333 / a) * Float64(sqrt(Float64(Float64(a * c) * -3.0)) - b)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -1.72e-74], N[(N[(-2.0 * b + N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e-69], N[(N[(0.3333333333333333 / a), $MachinePrecision] * N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.72 \cdot 10^{-74}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2, b, \frac{a}{\frac{b}{c}} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{-69}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(\sqrt{\left(a \cdot c\right) \cdot -3} - b\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.72e-74Initial program 65.2%
associate-*l*65.2%
Simplified65.2%
Taylor expanded in b around -inf 81.5%
fma-def81.5%
*-commutative81.5%
associate-/l*84.9%
Simplified84.9%
if -1.72e-74 < b < 1.49999999999999995e-69Initial program 70.1%
associate-*l*69.9%
Simplified69.9%
+-commutative69.9%
unsub-neg69.9%
*-un-lft-identity69.9%
cancel-sign-sub-inv69.9%
*-un-lft-identity69.9%
+-commutative69.9%
metadata-eval69.9%
*-commutative69.9%
associate-*r*70.0%
fma-udef70.0%
div-sub70.0%
sub-neg70.0%
Applied egg-rr70.0%
sub-neg70.0%
distribute-rgt-out--70.0%
Simplified70.0%
Taylor expanded in a around inf 62.7%
if 1.49999999999999995e-69 < b Initial program 9.8%
associate-*l*9.8%
Simplified9.8%
Taylor expanded in b around inf 93.1%
associate-*r/93.1%
Simplified93.1%
Final simplification81.6%
(FPCore (a b c)
:precision binary64
(if (<= b -2.95e-74)
(* (/ -0.3333333333333333 a) (+ b (- b (/ (* a 1.5) (/ b c)))))
(if (<= b 3.3e-143)
(* 0.3333333333333333 (/ (sqrt (* a (* c -3.0))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.95e-74) {
tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c))));
} else if (b <= 3.3e-143) {
tmp = 0.3333333333333333 * (sqrt((a * (c * -3.0))) / 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 <= (-2.95d-74)) then
tmp = ((-0.3333333333333333d0) / a) * (b + (b - ((a * 1.5d0) / (b / c))))
else if (b <= 3.3d-143) then
tmp = 0.3333333333333333d0 * (sqrt((a * (c * (-3.0d0)))) / 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 <= -2.95e-74) {
tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c))));
} else if (b <= 3.3e-143) {
tmp = 0.3333333333333333 * (Math.sqrt((a * (c * -3.0))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.95e-74: tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c)))) elif b <= 3.3e-143: tmp = 0.3333333333333333 * (math.sqrt((a * (c * -3.0))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.95e-74) tmp = Float64(Float64(-0.3333333333333333 / a) * Float64(b + Float64(b - Float64(Float64(a * 1.5) / Float64(b / c))))); elseif (b <= 3.3e-143) tmp = Float64(0.3333333333333333 * Float64(sqrt(Float64(a * Float64(c * -3.0))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.95e-74) tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c)))); elseif (b <= 3.3e-143) tmp = 0.3333333333333333 * (sqrt((a * (c * -3.0))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.95e-74], N[(N[(-0.3333333333333333 / a), $MachinePrecision] * N[(b + N[(b - N[(N[(a * 1.5), $MachinePrecision] / N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.3e-143], N[(0.3333333333333333 * N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.95 \cdot 10^{-74}:\\
\;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b + \left(b - \frac{a \cdot 1.5}{\frac{b}{c}}\right)\right)\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{-143}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.94999999999999983e-74Initial program 65.2%
associate-*l*65.2%
Simplified65.2%
Taylor expanded in b around -inf 81.5%
+-commutative81.5%
mul-1-neg81.5%
unsub-neg81.5%
associate-*r/81.5%
associate-*r*81.5%
Simplified81.5%
frac-2neg81.5%
div-inv81.4%
Applied egg-rr84.9%
*-commutative84.9%
*-commutative84.9%
associate-/r*84.8%
metadata-eval84.8%
+-commutative84.8%
*-commutative84.8%
associate-*r/84.8%
*-commutative84.8%
associate-/r/84.8%
Simplified84.8%
if -2.94999999999999983e-74 < b < 3.3000000000000001e-143Initial program 73.7%
associate-*l*73.5%
Simplified73.5%
+-commutative73.5%
unsub-neg73.5%
*-un-lft-identity73.5%
cancel-sign-sub-inv73.5%
*-un-lft-identity73.5%
+-commutative73.5%
metadata-eval73.5%
*-commutative73.5%
associate-*r*73.6%
fma-udef73.6%
div-sub73.6%
sub-neg73.6%
Applied egg-rr73.6%
sub-neg73.6%
distribute-rgt-out--73.6%
Simplified73.6%
*-commutative73.6%
metadata-eval73.6%
metadata-eval73.6%
associate-/r*73.5%
metadata-eval73.5%
un-div-inv73.6%
Applied egg-rr62.9%
*-lft-identity62.9%
associate-/l*63.0%
*-commutative63.0%
associate-/l*63.0%
associate-/r/63.0%
metadata-eval63.0%
+-rgt-identity63.0%
Simplified63.0%
if 3.3000000000000001e-143 < b Initial program 14.5%
associate-*l*14.5%
Simplified14.5%
Taylor expanded in b around inf 87.8%
associate-*r/87.8%
Simplified87.8%
Final simplification80.9%
(FPCore (a b c)
:precision binary64
(if (<= b -1.55e-73)
(* (/ -0.3333333333333333 a) (+ b (- b (/ (* a 1.5) (/ b c)))))
(if (<= b 3.3e-143)
(* (/ 0.3333333333333333 a) (sqrt (* a (* c -3.0))))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.55e-73) {
tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c))));
} else if (b <= 3.3e-143) {
tmp = (0.3333333333333333 / a) * sqrt((a * (c * -3.0)));
} 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 <= (-1.55d-73)) then
tmp = ((-0.3333333333333333d0) / a) * (b + (b - ((a * 1.5d0) / (b / c))))
else if (b <= 3.3d-143) then
tmp = (0.3333333333333333d0 / a) * sqrt((a * (c * (-3.0d0))))
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 <= -1.55e-73) {
tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c))));
} else if (b <= 3.3e-143) {
tmp = (0.3333333333333333 / a) * Math.sqrt((a * (c * -3.0)));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.55e-73: tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c)))) elif b <= 3.3e-143: tmp = (0.3333333333333333 / a) * math.sqrt((a * (c * -3.0))) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.55e-73) tmp = Float64(Float64(-0.3333333333333333 / a) * Float64(b + Float64(b - Float64(Float64(a * 1.5) / Float64(b / c))))); elseif (b <= 3.3e-143) tmp = Float64(Float64(0.3333333333333333 / a) * sqrt(Float64(a * Float64(c * -3.0)))); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.55e-73) tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c)))); elseif (b <= 3.3e-143) tmp = (0.3333333333333333 / a) * sqrt((a * (c * -3.0))); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.55e-73], N[(N[(-0.3333333333333333 / a), $MachinePrecision] * N[(b + N[(b - N[(N[(a * 1.5), $MachinePrecision] / N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.3e-143], N[(N[(0.3333333333333333 / a), $MachinePrecision] * N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{-73}:\\
\;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b + \left(b - \frac{a \cdot 1.5}{\frac{b}{c}}\right)\right)\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{-143}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \sqrt{a \cdot \left(c \cdot -3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.54999999999999985e-73Initial program 65.2%
associate-*l*65.2%
Simplified65.2%
Taylor expanded in b around -inf 81.5%
+-commutative81.5%
mul-1-neg81.5%
unsub-neg81.5%
associate-*r/81.5%
associate-*r*81.5%
Simplified81.5%
frac-2neg81.5%
div-inv81.4%
Applied egg-rr84.9%
*-commutative84.9%
*-commutative84.9%
associate-/r*84.8%
metadata-eval84.8%
+-commutative84.8%
*-commutative84.8%
associate-*r/84.8%
*-commutative84.8%
associate-/r/84.8%
Simplified84.8%
if -1.54999999999999985e-73 < b < 3.3000000000000001e-143Initial program 73.7%
associate-*l*73.5%
Simplified73.5%
+-commutative73.5%
unsub-neg73.5%
*-un-lft-identity73.5%
cancel-sign-sub-inv73.5%
*-un-lft-identity73.5%
+-commutative73.5%
metadata-eval73.5%
*-commutative73.5%
associate-*r*73.6%
fma-udef73.6%
div-sub73.6%
sub-neg73.6%
Applied egg-rr73.6%
sub-neg73.6%
distribute-rgt-out--73.6%
Simplified73.6%
Applied egg-rr63.0%
+-rgt-identity63.0%
+-rgt-identity63.0%
Simplified63.0%
if 3.3000000000000001e-143 < b Initial program 14.5%
associate-*l*14.5%
Simplified14.5%
Taylor expanded in b around inf 87.8%
associate-*r/87.8%
Simplified87.8%
Final simplification80.9%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* (/ -0.3333333333333333 a) (+ b (- b (/ (* a 1.5) (/ b c))))) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c))));
} 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 <= (-5d-310)) then
tmp = ((-0.3333333333333333d0) / a) * (b + (b - ((a * 1.5d0) / (b / c))))
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 <= -5e-310) {
tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c))));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c)))) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(-0.3333333333333333 / a) * Float64(b + Float64(b - Float64(Float64(a * 1.5) / Float64(b / c))))); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (-0.3333333333333333 / a) * (b + (b - ((a * 1.5) / (b / c)))); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(-0.3333333333333333 / a), $MachinePrecision] * N[(b + N[(b - N[(N[(a * 1.5), $MachinePrecision] / N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b + \left(b - \frac{a \cdot 1.5}{\frac{b}{c}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 68.5%
associate-*l*68.4%
Simplified68.4%
Taylor expanded in b around -inf 67.8%
+-commutative67.8%
mul-1-neg67.8%
unsub-neg67.8%
associate-*r/67.8%
associate-*r*67.8%
Simplified67.8%
frac-2neg67.8%
div-inv67.7%
Applied egg-rr70.5%
*-commutative70.5%
*-commutative70.5%
associate-/r*70.5%
metadata-eval70.5%
+-commutative70.5%
*-commutative70.5%
associate-*r/70.5%
*-commutative70.5%
associate-/r/70.5%
Simplified70.5%
if -4.999999999999985e-310 < b Initial program 26.2%
associate-*l*26.2%
Simplified26.2%
Taylor expanded in b around inf 70.9%
associate-*r/70.9%
Simplified70.9%
Final simplification70.7%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b))) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} 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 <= (-5d-310)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
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 <= -5e-310) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 68.5%
associate-*l*68.4%
Simplified68.4%
Taylor expanded in b around -inf 70.4%
if -4.999999999999985e-310 < b Initial program 26.2%
associate-*l*26.2%
Simplified26.2%
Taylor expanded in b around inf 70.9%
associate-*r/70.9%
Simplified70.9%
Final simplification70.7%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* b (/ -0.6666666666666666 a)) (/ -0.5 (/ b c))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = -0.5 / (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 <= (-5d-310)) then
tmp = b * ((-0.6666666666666666d0) / a)
else
tmp = (-0.5d0) / (b / c)
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);
} else {
tmp = -0.5 / (b / c);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = -0.5 / (b / c) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = Float64(-0.5 / Float64(b / c)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = b * (-0.6666666666666666 / a); else tmp = -0.5 / (b / c); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 / N[(b / c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5}{\frac{b}{c}}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 68.5%
associate-*l*68.4%
Simplified68.4%
+-commutative68.4%
unsub-neg68.4%
*-un-lft-identity68.4%
cancel-sign-sub-inv68.4%
*-un-lft-identity68.4%
+-commutative68.4%
metadata-eval68.4%
*-commutative68.4%
associate-*r*68.5%
fma-udef68.5%
div-sub68.5%
sub-neg68.5%
Applied egg-rr68.5%
sub-neg68.5%
distribute-rgt-out--68.5%
Simplified68.5%
Taylor expanded in b around -inf 69.6%
associate-*r/69.7%
associate-*l/69.7%
*-commutative69.7%
Simplified69.7%
if -4.999999999999985e-310 < b Initial program 26.2%
associate-*l*26.2%
Simplified26.2%
Taylor expanded in b around inf 70.9%
associate-*r/70.9%
associate-/l*70.3%
Simplified70.3%
Final simplification70.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ b (* a -1.5)) (/ -0.5 (/ b c))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = b / (a * -1.5);
} else {
tmp = -0.5 / (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 <= (-5d-310)) then
tmp = b / (a * (-1.5d0))
else
tmp = (-0.5d0) / (b / c)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = b / (a * -1.5);
} else {
tmp = -0.5 / (b / c);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = b / (a * -1.5) else: tmp = -0.5 / (b / c) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(b / Float64(a * -1.5)); else tmp = Float64(-0.5 / Float64(b / c)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = b / (a * -1.5); else tmp = -0.5 / (b / c); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], N[(-0.5 / N[(b / c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5}{\frac{b}{c}}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 68.5%
associate-*l*68.4%
Simplified68.4%
+-commutative68.4%
unsub-neg68.4%
*-un-lft-identity68.4%
cancel-sign-sub-inv68.4%
*-un-lft-identity68.4%
+-commutative68.4%
metadata-eval68.4%
*-commutative68.4%
associate-*r*68.5%
fma-udef68.5%
div-sub68.5%
sub-neg68.5%
Applied egg-rr68.5%
sub-neg68.5%
distribute-rgt-out--68.5%
Simplified68.5%
Taylor expanded in b around -inf 69.6%
associate-*r/69.7%
associate-*l/69.7%
*-commutative69.7%
Simplified69.7%
associate-*r/69.7%
associate-/l*69.6%
div-inv69.8%
metadata-eval69.8%
Applied egg-rr69.8%
if -4.999999999999985e-310 < b Initial program 26.2%
associate-*l*26.2%
Simplified26.2%
Taylor expanded in b around inf 70.9%
associate-*r/70.9%
associate-/l*70.3%
Simplified70.3%
Final simplification70.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ b (* a -1.5)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = b / (a * -1.5);
} 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 <= (-5d-310)) then
tmp = b / (a * (-1.5d0))
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 <= -5e-310) {
tmp = b / (a * -1.5);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = b / (a * -1.5) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(b / Float64(a * -1.5)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = b / (a * -1.5); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 68.5%
associate-*l*68.4%
Simplified68.4%
+-commutative68.4%
unsub-neg68.4%
*-un-lft-identity68.4%
cancel-sign-sub-inv68.4%
*-un-lft-identity68.4%
+-commutative68.4%
metadata-eval68.4%
*-commutative68.4%
associate-*r*68.5%
fma-udef68.5%
div-sub68.5%
sub-neg68.5%
Applied egg-rr68.5%
sub-neg68.5%
distribute-rgt-out--68.5%
Simplified68.5%
Taylor expanded in b around -inf 69.6%
associate-*r/69.7%
associate-*l/69.7%
*-commutative69.7%
Simplified69.7%
associate-*r/69.7%
associate-/l*69.6%
div-inv69.8%
metadata-eval69.8%
Applied egg-rr69.8%
if -4.999999999999985e-310 < b Initial program 26.2%
associate-*l*26.2%
Simplified26.2%
Taylor expanded in b around inf 70.9%
associate-*r/70.9%
Simplified70.9%
Final simplification70.4%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (/ b -1.5) a) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (b / -1.5) / 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 <= (-5d-310)) then
tmp = (b / (-1.5d0)) / 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 <= -5e-310) {
tmp = (b / -1.5) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (b / -1.5) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(b / -1.5) / a); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (b / -1.5) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(b / -1.5), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b}{-1.5}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 68.5%
associate-*l*68.4%
Simplified68.4%
+-commutative68.4%
unsub-neg68.4%
*-un-lft-identity68.4%
cancel-sign-sub-inv68.4%
*-un-lft-identity68.4%
+-commutative68.4%
metadata-eval68.4%
*-commutative68.4%
associate-*r*68.5%
fma-udef68.5%
div-sub68.5%
sub-neg68.5%
Applied egg-rr68.5%
sub-neg68.5%
distribute-rgt-out--68.5%
Simplified68.5%
Taylor expanded in b around -inf 69.6%
associate-*r/69.7%
associate-*l/69.7%
*-commutative69.7%
Simplified69.7%
associate-*r/69.7%
associate-/l*69.6%
metadata-eval69.6%
associate-/l*69.8%
*-commutative69.8%
associate-/l*69.8%
associate-/r*69.8%
associate-/l*69.8%
metadata-eval69.8%
Applied egg-rr69.8%
if -4.999999999999985e-310 < b Initial program 26.2%
associate-*l*26.2%
Simplified26.2%
Taylor expanded in b around inf 70.9%
associate-*r/70.9%
Simplified70.9%
Final simplification70.4%
(FPCore (a b c) :precision binary64 (* b (/ -0.6666666666666666 a)))
double code(double a, double b, double c) {
return b * (-0.6666666666666666 / 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 * ((-0.6666666666666666d0) / a)
end function
public static double code(double a, double b, double c) {
return b * (-0.6666666666666666 / a);
}
def code(a, b, c): return b * (-0.6666666666666666 / a)
function code(a, b, c) return Float64(b * Float64(-0.6666666666666666 / a)) end
function tmp = code(a, b, c) tmp = b * (-0.6666666666666666 / a); end
code[a_, b_, c_] := N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \frac{-0.6666666666666666}{a}
\end{array}
Initial program 46.0%
associate-*l*46.0%
Simplified46.0%
+-commutative46.0%
unsub-neg46.0%
*-un-lft-identity46.0%
cancel-sign-sub-inv46.0%
*-un-lft-identity46.0%
+-commutative46.0%
metadata-eval46.0%
*-commutative46.0%
associate-*r*46.0%
fma-udef46.0%
div-sub45.5%
sub-neg45.5%
Applied egg-rr45.5%
sub-neg45.5%
distribute-rgt-out--46.0%
Simplified46.0%
Taylor expanded in b around -inf 34.0%
associate-*r/34.1%
associate-*l/34.1%
*-commutative34.1%
Simplified34.1%
Final simplification34.1%
herbie shell --seed 2023301
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))