
(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 12 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 -3.3e+71)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 5.6e-39)
(/ (- (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 <= -3.3e+71) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.6e-39) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 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 <= (-3.3d+71)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 5.6d-39) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 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 <= -3.3e+71) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.6e-39) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.3e+71: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 5.6e-39: tmp = (math.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 <= -3.3e+71) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 5.6e-39) 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
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.3e+71) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 5.6e-39) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.3e+71], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.6e-39], 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 -3.3 \cdot 10^{+71}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{-39}:\\
\;\;\;\;\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 < -3.2999999999999998e71Initial program 50.3%
Taylor expanded in b around -inf 97.5%
if -3.2999999999999998e71 < b < 5.6000000000000003e-39Initial program 80.7%
if 5.6000000000000003e-39 < b Initial program 13.6%
prod-diff13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
fma-udef13.4%
distribute-lft-neg-in13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
associate-*l*13.5%
Applied egg-rr13.5%
Taylor expanded in b around inf 66.2%
distribute-rgt-out66.3%
metadata-eval66.3%
associate-*r*66.3%
Simplified66.3%
Taylor expanded in a around 0 88.4%
associate-*r/88.4%
Simplified88.4%
Final simplification87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -7e-47)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 3.2e-39)
(/ (- (sqrt (* -3.0 (* a c))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7e-47) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 3.2e-39) {
tmp = (sqrt((-3.0 * (a * c))) - b) / (a * 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 <= (-7d-47)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 3.2d-39) then
tmp = (sqrt(((-3.0d0) * (a * c))) - b) / (a * 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 <= -7e-47) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 3.2e-39) {
tmp = (Math.sqrt((-3.0 * (a * c))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7e-47: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 3.2e-39: tmp = (math.sqrt((-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 <= -7e-47) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 3.2e-39) tmp = Float64(Float64(sqrt(Float64(-3.0 * Float64(a * c))) - b) / Float64(a * 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 <= -7e-47) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 3.2e-39) tmp = (sqrt((-3.0 * (a * c))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7e-47], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.2e-39], N[(N[(N[Sqrt[N[(-3.0 * N[(a * c), $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 -7 \cdot 10^{-47}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{-39}:\\
\;\;\;\;\frac{\sqrt{-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 < -6.9999999999999996e-47Initial program 65.2%
Taylor expanded in b around -inf 88.5%
if -6.9999999999999996e-47 < b < 3.1999999999999998e-39Initial program 73.4%
Taylor expanded in b around 0 72.0%
if 3.1999999999999998e-39 < b Initial program 13.6%
prod-diff13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
fma-udef13.4%
distribute-lft-neg-in13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
associate-*l*13.5%
Applied egg-rr13.5%
Taylor expanded in b around inf 66.2%
distribute-rgt-out66.3%
metadata-eval66.3%
associate-*r*66.3%
Simplified66.3%
Taylor expanded in a around 0 88.4%
associate-*r/88.4%
Simplified88.4%
Final simplification84.1%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-48)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 5.5e-39)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-48) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.5e-39) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 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 <= (-8.2d-48)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 5.5d-39) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 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 <= -8.2e-48) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.5e-39) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e-48: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 5.5e-39: tmp = (math.sqrt((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 <= -8.2e-48) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 5.5e-39) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 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 <= -8.2e-48) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 5.5e-39) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-48], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.5e-39], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $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 -8.2 \cdot 10^{-48}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{\sqrt{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 < -8.20000000000000028e-48Initial program 65.2%
Taylor expanded in b around -inf 88.5%
if -8.20000000000000028e-48 < b < 5.50000000000000018e-39Initial program 73.4%
Taylor expanded in b around 0 72.0%
associate-*r*72.1%
*-commutative72.1%
*-commutative72.1%
Simplified72.1%
if 5.50000000000000018e-39 < b Initial program 13.6%
prod-diff13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
fma-udef13.4%
distribute-lft-neg-in13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
associate-*l*13.5%
Applied egg-rr13.5%
Taylor expanded in b around inf 66.2%
distribute-rgt-out66.3%
metadata-eval66.3%
associate-*r*66.3%
Simplified66.3%
Taylor expanded in a around 0 88.4%
associate-*r/88.4%
Simplified88.4%
Final simplification84.1%
(FPCore (a b c)
:precision binary64
(if (<= b -2.8e-47)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 1.65e-38)
(* 0.3333333333333333 (/ (sqrt (* -3.0 (* a c))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.8e-47) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 1.65e-38) {
tmp = 0.3333333333333333 * (sqrt((-3.0 * (a * c))) / 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.8d-47)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 1.65d-38) then
tmp = 0.3333333333333333d0 * (sqrt(((-3.0d0) * (a * c))) / 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.8e-47) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 1.65e-38) {
tmp = 0.3333333333333333 * (Math.sqrt((-3.0 * (a * c))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.8e-47: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 1.65e-38: tmp = 0.3333333333333333 * (math.sqrt((-3.0 * (a * c))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.8e-47) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 1.65e-38) tmp = Float64(0.3333333333333333 * Float64(sqrt(Float64(-3.0 * Float64(a * c))) / 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.8e-47) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 1.65e-38) tmp = 0.3333333333333333 * (sqrt((-3.0 * (a * c))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.8e-47], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.65e-38], N[(0.3333333333333333 * N[(N[Sqrt[N[(-3.0 * N[(a * c), $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.8 \cdot 10^{-47}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 1.65 \cdot 10^{-38}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{-3 \cdot \left(a \cdot c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.79999999999999993e-47Initial program 65.2%
Taylor expanded in b around -inf 88.5%
if -2.79999999999999993e-47 < b < 1.6500000000000001e-38Initial program 73.4%
prod-diff73.1%
distribute-rgt-neg-in73.1%
*-commutative73.1%
distribute-rgt-neg-in73.1%
metadata-eval73.1%
*-commutative73.1%
fma-udef73.1%
distribute-lft-neg-in73.1%
distribute-rgt-neg-in73.1%
*-commutative73.1%
distribute-rgt-neg-in73.1%
metadata-eval73.1%
*-commutative73.1%
associate-*l*71.6%
Applied egg-rr71.6%
Taylor expanded in b around 0 71.3%
associate-*l/71.3%
distribute-rgt-out71.6%
*-commutative71.6%
metadata-eval71.6%
associate-*r*71.6%
*-lft-identity71.6%
associate-*r*71.6%
*-commutative71.6%
associate-*r*70.3%
Simplified70.3%
Taylor expanded in a around 0 71.6%
if 1.6500000000000001e-38 < b Initial program 13.6%
prod-diff13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
fma-udef13.4%
distribute-lft-neg-in13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
associate-*l*13.5%
Applied egg-rr13.5%
Taylor expanded in b around inf 66.2%
distribute-rgt-out66.3%
metadata-eval66.3%
associate-*r*66.3%
Simplified66.3%
Taylor expanded in a around 0 88.4%
associate-*r/88.4%
Simplified88.4%
Final simplification84.0%
(FPCore (a b c)
:precision binary64
(if (<= b -4.4e-48)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 5.6e-39)
(/ 0.3333333333333333 (/ a (sqrt (* c (* a -3.0)))))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e-48) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.6e-39) {
tmp = 0.3333333333333333 / (a / sqrt((c * (a * -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 <= (-4.4d-48)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 5.6d-39) then
tmp = 0.3333333333333333d0 / (a / sqrt((c * (a * (-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 <= -4.4e-48) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.6e-39) {
tmp = 0.3333333333333333 / (a / Math.sqrt((c * (a * -3.0))));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.4e-48: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 5.6e-39: tmp = 0.3333333333333333 / (a / math.sqrt((c * (a * -3.0)))) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.4e-48) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 5.6e-39) tmp = Float64(0.3333333333333333 / Float64(a / sqrt(Float64(c * Float64(a * -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 <= -4.4e-48) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 5.6e-39) tmp = 0.3333333333333333 / (a / sqrt((c * (a * -3.0)))); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.4e-48], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.6e-39], N[(0.3333333333333333 / N[(a / N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{-48}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{-39}:\\
\;\;\;\;\frac{0.3333333333333333}{\frac{a}{\sqrt{c \cdot \left(a \cdot -3\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.40000000000000025e-48Initial program 65.2%
Taylor expanded in b around -inf 88.5%
if -4.40000000000000025e-48 < b < 5.6000000000000003e-39Initial program 73.4%
prod-diff73.1%
distribute-rgt-neg-in73.1%
*-commutative73.1%
distribute-rgt-neg-in73.1%
metadata-eval73.1%
*-commutative73.1%
fma-udef73.1%
distribute-lft-neg-in73.1%
distribute-rgt-neg-in73.1%
*-commutative73.1%
distribute-rgt-neg-in73.1%
metadata-eval73.1%
*-commutative73.1%
associate-*l*71.6%
Applied egg-rr71.6%
Taylor expanded in b around 0 71.3%
associate-*l/71.3%
distribute-rgt-out71.6%
*-commutative71.6%
metadata-eval71.6%
associate-*r*71.6%
*-lft-identity71.6%
associate-*r*71.6%
*-commutative71.6%
associate-*r*70.3%
Simplified70.3%
clear-num70.3%
un-div-inv70.2%
*-commutative70.2%
associate-*r*71.7%
*-commutative71.7%
Applied egg-rr71.7%
if 5.6000000000000003e-39 < b Initial program 13.6%
prod-diff13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
fma-udef13.4%
distribute-lft-neg-in13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
associate-*l*13.5%
Applied egg-rr13.5%
Taylor expanded in b around inf 66.2%
distribute-rgt-out66.3%
metadata-eval66.3%
associate-*r*66.3%
Simplified66.3%
Taylor expanded in a around 0 88.4%
associate-*r/88.4%
Simplified88.4%
Final simplification84.0%
(FPCore (a b c)
:precision binary64
(if (<= b -6.5e-47)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 5.5e-39)
(/ (* (sqrt (* c (* a -3.0))) 0.3333333333333333) a)
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -6.5e-47) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.5e-39) {
tmp = (sqrt((c * (a * -3.0))) * 0.3333333333333333) / 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 <= (-6.5d-47)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 5.5d-39) then
tmp = (sqrt((c * (a * (-3.0d0)))) * 0.3333333333333333d0) / 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 <= -6.5e-47) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.5e-39) {
tmp = (Math.sqrt((c * (a * -3.0))) * 0.3333333333333333) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -6.5e-47: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 5.5e-39: tmp = (math.sqrt((c * (a * -3.0))) * 0.3333333333333333) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -6.5e-47) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 5.5e-39) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) * 0.3333333333333333) / 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 <= -6.5e-47) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 5.5e-39) tmp = (sqrt((c * (a * -3.0))) * 0.3333333333333333) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -6.5e-47], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.5e-39], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{-47}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} \cdot 0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -6.5000000000000004e-47Initial program 65.2%
Taylor expanded in b around -inf 88.5%
if -6.5000000000000004e-47 < b < 5.50000000000000018e-39Initial program 73.4%
prod-diff73.1%
distribute-rgt-neg-in73.1%
*-commutative73.1%
distribute-rgt-neg-in73.1%
metadata-eval73.1%
*-commutative73.1%
fma-udef73.1%
distribute-lft-neg-in73.1%
distribute-rgt-neg-in73.1%
*-commutative73.1%
distribute-rgt-neg-in73.1%
metadata-eval73.1%
*-commutative73.1%
associate-*l*71.6%
Applied egg-rr71.6%
Taylor expanded in b around 0 71.3%
associate-*l/71.3%
distribute-rgt-out71.6%
*-commutative71.6%
metadata-eval71.6%
associate-*r*71.6%
*-lft-identity71.6%
associate-*r*71.6%
*-commutative71.6%
associate-*r*70.3%
Simplified70.3%
associate-*r/70.4%
*-commutative70.4%
associate-*r*71.7%
*-commutative71.7%
Applied egg-rr71.7%
if 5.50000000000000018e-39 < b Initial program 13.6%
prod-diff13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
fma-udef13.4%
distribute-lft-neg-in13.4%
distribute-rgt-neg-in13.4%
*-commutative13.4%
distribute-rgt-neg-in13.4%
metadata-eval13.4%
*-commutative13.4%
associate-*l*13.5%
Applied egg-rr13.5%
Taylor expanded in b around inf 66.2%
distribute-rgt-out66.3%
metadata-eval66.3%
associate-*r*66.3%
Simplified66.3%
Taylor expanded in a around 0 88.4%
associate-*r/88.4%
Simplified88.4%
Final simplification84.0%
(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 71.0%
Taylor expanded in b around -inf 69.7%
if -4.999999999999985e-310 < b Initial program 27.1%
prod-diff26.8%
distribute-rgt-neg-in26.8%
*-commutative26.8%
distribute-rgt-neg-in26.8%
metadata-eval26.8%
*-commutative26.8%
fma-udef26.8%
distribute-lft-neg-in26.8%
distribute-rgt-neg-in26.8%
*-commutative26.8%
distribute-rgt-neg-in26.8%
metadata-eval26.8%
*-commutative26.8%
associate-*l*26.1%
Applied egg-rr26.1%
Taylor expanded in b around inf 48.8%
distribute-rgt-out49.0%
metadata-eval49.0%
associate-*r*49.0%
Simplified49.0%
Taylor expanded in a around 0 70.3%
associate-*r/70.4%
Simplified70.4%
Final simplification70.0%
(FPCore (a b c) :precision binary64 (if (<= b 5e-309) (* b (/ -0.6666666666666666 a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 5e-309) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = (c / b) * -0.5;
}
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-309) then
tmp = b * ((-0.6666666666666666d0) / 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 <= 5e-309) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 5e-309: tmp = b * (-0.6666666666666666 / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 5e-309) tmp = Float64(b * Float64(-0.6666666666666666 / 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 <= 5e-309) tmp = b * (-0.6666666666666666 / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 5e-309], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5 \cdot 10^{-309}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 4.9999999999999995e-309Initial program 71.0%
Applied egg-rr63.2%
sub-neg63.2%
distribute-rgt-out--63.2%
Simplified63.2%
Taylor expanded in b around -inf 69.3%
associate-*r/69.2%
associate-*l/69.3%
Simplified69.3%
if 4.9999999999999995e-309 < b Initial program 27.1%
Taylor expanded in b around inf 70.3%
Final simplification69.8%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* -0.6666666666666666 (/ b a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c / b) * -0.5;
}
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)
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 <= -5e-310) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = -0.6666666666666666 * (b / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) 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 <= -5e-310) tmp = -0.6666666666666666 * (b / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], 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 -5 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 71.0%
Taylor expanded in b around -inf 69.3%
*-commutative69.3%
Simplified69.3%
if -4.999999999999985e-310 < b Initial program 27.1%
Taylor expanded in b around inf 70.3%
Final simplification69.8%
(FPCore (a b c) :precision binary64 (if (<= b 9e-308) (/ b (* a -1.5)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 9e-308) {
tmp = b / (a * -1.5);
} else {
tmp = (c / b) * -0.5;
}
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 <= 9d-308) then
tmp = b / (a * (-1.5d0))
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 <= 9e-308) {
tmp = b / (a * -1.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 9e-308: tmp = b / (a * -1.5) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 9e-308) tmp = Float64(b / Float64(a * -1.5)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 9e-308) tmp = b / (a * -1.5); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 9e-308], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9 \cdot 10^{-308}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 9.00000000000000017e-308Initial program 71.0%
Applied egg-rr63.2%
sub-neg63.2%
distribute-rgt-out--63.2%
Simplified63.2%
Taylor expanded in b around -inf 69.3%
associate-*r/69.2%
associate-*l/69.3%
Simplified69.3%
*-commutative69.3%
clear-num69.3%
un-div-inv69.4%
div-inv69.5%
metadata-eval69.5%
Applied egg-rr69.5%
if 9.00000000000000017e-308 < b Initial program 27.1%
Taylor expanded in b around inf 70.3%
Final simplification69.9%
(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 71.0%
Applied egg-rr63.2%
sub-neg63.2%
distribute-rgt-out--63.2%
Simplified63.2%
Taylor expanded in b around -inf 69.3%
associate-*r/69.2%
associate-*l/69.3%
Simplified69.3%
*-commutative69.3%
clear-num69.3%
un-div-inv69.4%
div-inv69.5%
metadata-eval69.5%
Applied egg-rr69.5%
if -4.999999999999985e-310 < b Initial program 27.1%
prod-diff26.8%
distribute-rgt-neg-in26.8%
*-commutative26.8%
distribute-rgt-neg-in26.8%
metadata-eval26.8%
*-commutative26.8%
fma-udef26.8%
distribute-lft-neg-in26.8%
distribute-rgt-neg-in26.8%
*-commutative26.8%
distribute-rgt-neg-in26.8%
metadata-eval26.8%
*-commutative26.8%
associate-*l*26.1%
Applied egg-rr26.1%
Taylor expanded in b around inf 48.8%
distribute-rgt-out49.0%
metadata-eval49.0%
associate-*r*49.0%
Simplified49.0%
Taylor expanded in a around 0 70.3%
associate-*r/70.4%
Simplified70.4%
Final simplification69.9%
(FPCore (a b c) :precision binary64 (* (/ c b) -0.5))
double code(double a, double b, double c) {
return (c / b) * -0.5;
}
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) * (-0.5d0)
end function
public static double code(double a, double b, double c) {
return (c / b) * -0.5;
}
def code(a, b, c): return (c / b) * -0.5
function code(a, b, c) return Float64(Float64(c / b) * -0.5) end
function tmp = code(a, b, c) tmp = (c / b) * -0.5; end
code[a_, b_, c_] := N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{c}{b} \cdot -0.5
\end{array}
Initial program 48.9%
Taylor expanded in b around inf 36.6%
Final simplification36.6%
herbie shell --seed 2023322
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))