
(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 -4.2e+153)
(/ (+ (* (/ a (/ b c)) 1.5) (* b -2.0)) (* a 3.0))
(if (<= b 1.7e-108)
(/ (- (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 <= -4.2e+153) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 1.7e-108) {
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 <= (-4.2d+153)) then
tmp = (((a / (b / c)) * 1.5d0) + (b * (-2.0d0))) / (a * 3.0d0)
else if (b <= 1.7d-108) 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 <= -4.2e+153) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 1.7e-108) {
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 <= -4.2e+153: tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0) elif b <= 1.7e-108: 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 <= -4.2e+153) tmp = Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) + Float64(b * -2.0)) / Float64(a * 3.0)); elseif (b <= 1.7e-108) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.2e+153) tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0); elseif (b <= 1.7e-108) 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, -4.2e+153], N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] + N[(b * -2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.7e-108], 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[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.2 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{a}{\frac{b}{c}} \cdot 1.5 + b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{-108}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4.20000000000000033e153Initial program 37.1%
sqr-neg37.1%
sqr-neg37.1%
associate-*l*37.1%
Simplified37.1%
Taylor expanded in b around -inf 92.0%
expm1-log1p-u86.0%
expm1-udef86.0%
*-commutative86.0%
*-commutative86.0%
Applied egg-rr86.0%
expm1-def86.0%
expm1-log1p92.0%
associate-/l*99.7%
Simplified99.7%
if -4.20000000000000033e153 < b < 1.70000000000000001e-108Initial program 84.4%
if 1.70000000000000001e-108 < b Initial program 22.6%
sqr-neg22.6%
sqr-neg22.6%
associate-*l*22.6%
Simplified22.6%
Taylor expanded in b around inf 83.9%
Final simplification87.2%
(FPCore (a b c)
:precision binary64
(if (<= b -2e+152)
(/ (+ (* (/ a (/ b c)) 1.5) (* b -2.0)) (* a 3.0))
(if (<= b 2e-108)
(/ (- (sqrt (- (* b b) (* a (* c 3.0)))) b) (/ a 0.3333333333333333))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e+152) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 2e-108) {
tmp = (sqrt(((b * b) - (a * (c * 3.0)))) - b) / (a / 0.3333333333333333);
} 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 <= (-2d+152)) then
tmp = (((a / (b / c)) * 1.5d0) + (b * (-2.0d0))) / (a * 3.0d0)
else if (b <= 2d-108) then
tmp = (sqrt(((b * b) - (a * (c * 3.0d0)))) - b) / (a / 0.3333333333333333d0)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2e+152) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 2e-108) {
tmp = (Math.sqrt(((b * b) - (a * (c * 3.0)))) - b) / (a / 0.3333333333333333);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2e+152: tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0) elif b <= 2e-108: tmp = (math.sqrt(((b * b) - (a * (c * 3.0)))) - b) / (a / 0.3333333333333333) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2e+152) tmp = Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) + Float64(b * -2.0)) / Float64(a * 3.0)); elseif (b <= 2e-108) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(a * Float64(c * 3.0)))) - b) / Float64(a / 0.3333333333333333)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2e+152) tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0); elseif (b <= 2e-108) tmp = (sqrt(((b * b) - (a * (c * 3.0)))) - b) / (a / 0.3333333333333333); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2e+152], N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] + N[(b * -2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-108], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a / 0.3333333333333333), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{+152}:\\
\;\;\;\;\frac{\frac{a}{\frac{b}{c}} \cdot 1.5 + b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-108}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(c \cdot 3\right)} - b}{\frac{a}{0.3333333333333333}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -2.0000000000000001e152Initial program 37.1%
sqr-neg37.1%
sqr-neg37.1%
associate-*l*37.1%
Simplified37.1%
Taylor expanded in b around -inf 92.0%
expm1-log1p-u86.0%
expm1-udef86.0%
*-commutative86.0%
*-commutative86.0%
Applied egg-rr86.0%
expm1-def86.0%
expm1-log1p92.0%
associate-/l*99.7%
Simplified99.7%
if -2.0000000000000001e152 < b < 2.00000000000000008e-108Initial program 84.4%
neg-sub084.4%
sqr-neg84.4%
associate-+l-84.4%
sub0-neg84.4%
neg-mul-184.4%
Simplified84.1%
associate-*r*84.1%
metadata-eval84.1%
distribute-rgt-neg-in84.1%
*-commutative84.1%
fma-neg84.1%
associate-*r*84.1%
*-commutative84.1%
associate-*l*84.1%
Applied egg-rr84.1%
if 2.00000000000000008e-108 < b Initial program 22.6%
sqr-neg22.6%
sqr-neg22.6%
associate-*l*22.6%
Simplified22.6%
Taylor expanded in b around inf 83.9%
Final simplification87.1%
(FPCore (a b c)
:precision binary64
(if (<= b -4e+153)
(/ (+ (* (/ a (/ b c)) 1.5) (* b -2.0)) (* a 3.0))
(if (<= b 2e-108)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (/ a 0.3333333333333333))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e+153) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 2e-108) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a / 0.3333333333333333);
} 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 <= (-4d+153)) then
tmp = (((a / (b / c)) * 1.5d0) + (b * (-2.0d0))) / (a * 3.0d0)
else if (b <= 2d-108) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a / 0.3333333333333333d0)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4e+153) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 2e-108) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a / 0.3333333333333333);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e+153: tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0) elif b <= 2e-108: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a / 0.3333333333333333) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e+153) tmp = Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) + Float64(b * -2.0)) / Float64(a * 3.0)); elseif (b <= 2e-108) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a / 0.3333333333333333)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e+153) tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0); elseif (b <= 2e-108) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a / 0.3333333333333333); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e+153], N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] + N[(b * -2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-108], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a / 0.3333333333333333), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{a}{\frac{b}{c}} \cdot 1.5 + b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-108}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{\frac{a}{0.3333333333333333}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4e153Initial program 37.1%
sqr-neg37.1%
sqr-neg37.1%
associate-*l*37.1%
Simplified37.1%
Taylor expanded in b around -inf 92.0%
expm1-log1p-u86.0%
expm1-udef86.0%
*-commutative86.0%
*-commutative86.0%
Applied egg-rr86.0%
expm1-def86.0%
expm1-log1p92.0%
associate-/l*99.7%
Simplified99.7%
if -4e153 < b < 2.00000000000000008e-108Initial program 84.4%
neg-sub084.4%
sqr-neg84.4%
associate-+l-84.4%
sub0-neg84.4%
neg-mul-184.4%
Simplified84.1%
associate-*r*84.1%
metadata-eval84.1%
distribute-rgt-neg-in84.1%
*-commutative84.1%
fma-neg84.1%
associate-*r*84.1%
*-commutative84.1%
associate-*l*84.1%
Applied egg-rr84.1%
associate-*r*84.1%
Simplified84.1%
if 2.00000000000000008e-108 < b Initial program 22.6%
sqr-neg22.6%
sqr-neg22.6%
associate-*l*22.6%
Simplified22.6%
Taylor expanded in b around inf 83.9%
Final simplification87.1%
(FPCore (a b c)
:precision binary64
(if (<= b -5e+152)
(/ (+ (* (/ a (/ b c)) 1.5) (* b -2.0)) (* a 3.0))
(if (<= b 1.45e-108)
(/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* a 3.0))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e+152) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 1.45e-108) {
tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - 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 <= (-5d+152)) then
tmp = (((a / (b / c)) * 1.5d0) + (b * (-2.0d0))) / (a * 3.0d0)
else if (b <= 1.45d-108) then
tmp = (sqrt(((b * b) - (3.0d0 * (a * c)))) - 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 <= -5e+152) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 1.45e-108) {
tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e+152: tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0) elif b <= 1.45e-108: tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e+152) tmp = Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) + Float64(b * -2.0)) / Float64(a * 3.0)); elseif (b <= 1.45e-108) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e+152) tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0); elseif (b <= 1.45e-108) tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e+152], N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] + N[(b * -2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.45e-108], 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[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+152}:\\
\;\;\;\;\frac{\frac{a}{\frac{b}{c}} \cdot 1.5 + b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{-108}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -5e152Initial program 37.1%
sqr-neg37.1%
sqr-neg37.1%
associate-*l*37.1%
Simplified37.1%
Taylor expanded in b around -inf 92.0%
expm1-log1p-u86.0%
expm1-udef86.0%
*-commutative86.0%
*-commutative86.0%
Applied egg-rr86.0%
expm1-def86.0%
expm1-log1p92.0%
associate-/l*99.7%
Simplified99.7%
if -5e152 < b < 1.45e-108Initial program 84.4%
sqr-neg84.4%
sqr-neg84.4%
associate-*l*84.2%
Simplified84.2%
if 1.45e-108 < b Initial program 22.6%
sqr-neg22.6%
sqr-neg22.6%
associate-*l*22.6%
Simplified22.6%
Taylor expanded in b around inf 83.9%
Final simplification87.1%
(FPCore (a b c)
:precision binary64
(if (<= b -2.7e-27)
(/ (+ (* (/ a (/ b c)) 1.5) (* b -2.0)) (* a 3.0))
(if (<= b 1.05e-108)
(/ (- (sqrt (* (* a c) -3.0)) b) (* a 3.0))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.7e-27) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 1.05e-108) {
tmp = (sqrt(((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 <= (-2.7d-27)) then
tmp = (((a / (b / c)) * 1.5d0) + (b * (-2.0d0))) / (a * 3.0d0)
else if (b <= 1.05d-108) then
tmp = (sqrt(((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 <= -2.7e-27) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 1.05e-108) {
tmp = (Math.sqrt(((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 <= -2.7e-27: tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0) elif b <= 1.05e-108: tmp = (math.sqrt(((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 <= -2.7e-27) tmp = Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) + Float64(b * -2.0)) / Float64(a * 3.0)); elseif (b <= 1.05e-108) tmp = Float64(Float64(sqrt(Float64(Float64(a * c) * -3.0)) - b) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.7e-27) tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0); elseif (b <= 1.05e-108) tmp = (sqrt(((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, -2.7e-27], N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] + N[(b * -2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.05e-108], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{-27}:\\
\;\;\;\;\frac{\frac{a}{\frac{b}{c}} \cdot 1.5 + b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{-108}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -2.69999999999999989e-27Initial program 63.4%
sqr-neg63.4%
sqr-neg63.4%
associate-*l*63.4%
Simplified63.4%
Taylor expanded in b around -inf 87.2%
expm1-log1p-u80.5%
expm1-udef80.5%
*-commutative80.5%
*-commutative80.5%
Applied egg-rr80.5%
expm1-def80.5%
expm1-log1p87.2%
associate-/l*91.6%
Simplified91.6%
if -2.69999999999999989e-27 < b < 1.05e-108Initial program 77.5%
sqr-neg77.5%
sqr-neg77.5%
associate-*l*77.3%
Simplified77.3%
Taylor expanded in b around 0 75.1%
if 1.05e-108 < b Initial program 22.6%
sqr-neg22.6%
sqr-neg22.6%
associate-*l*22.6%
Simplified22.6%
Taylor expanded in b around inf 83.9%
Final simplification84.1%
(FPCore (a b c)
:precision binary64
(if (<= b -3.4e-26)
(/ (+ (* (/ a (/ b c)) 1.5) (* b -2.0)) (* a 3.0))
(if (<= b 2e-108)
(/ (- (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 <= -3.4e-26) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 2e-108) {
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 <= (-3.4d-26)) then
tmp = (((a / (b / c)) * 1.5d0) + (b * (-2.0d0))) / (a * 3.0d0)
else if (b <= 2d-108) 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 <= -3.4e-26) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else if (b <= 2e-108) {
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 <= -3.4e-26: tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0) elif b <= 2e-108: 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 <= -3.4e-26) tmp = Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) + Float64(b * -2.0)) / Float64(a * 3.0)); elseif (b <= 2e-108) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.4e-26) tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0); elseif (b <= 2e-108) 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, -3.4e-26], N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] + N[(b * -2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-108], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.4 \cdot 10^{-26}:\\
\;\;\;\;\frac{\frac{a}{\frac{b}{c}} \cdot 1.5 + b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-108}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -3.40000000000000013e-26Initial program 63.4%
sqr-neg63.4%
sqr-neg63.4%
associate-*l*63.4%
Simplified63.4%
Taylor expanded in b around -inf 87.2%
expm1-log1p-u80.5%
expm1-udef80.5%
*-commutative80.5%
*-commutative80.5%
Applied egg-rr80.5%
expm1-def80.5%
expm1-log1p87.2%
associate-/l*91.6%
Simplified91.6%
if -3.40000000000000013e-26 < b < 2.00000000000000008e-108Initial program 77.5%
sqr-neg77.5%
sqr-neg77.5%
associate-*l*77.3%
Simplified77.3%
Taylor expanded in b around 0 75.1%
*-commutative75.1%
*-commutative75.1%
*-commutative75.1%
associate-*l*75.3%
Simplified75.3%
if 2.00000000000000008e-108 < b Initial program 22.6%
sqr-neg22.6%
sqr-neg22.6%
associate-*l*22.6%
Simplified22.6%
Taylor expanded in b around inf 83.9%
Final simplification84.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (+ (* (/ a (/ b c)) 1.5) (* b -2.0)) (* a 3.0)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (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 <= (-5d-310)) then
tmp = (((a / (b / c)) * 1.5d0) + (b * (-2.0d0))) / (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 <= -5e-310) {
tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) + Float64(b * -2.0)) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (((a / (b / c)) * 1.5) + (b * -2.0)) / (a * 3.0); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] + N[(b * -2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{a}{\frac{b}{c}} \cdot 1.5 + b \cdot -2}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 66.0%
sqr-neg66.0%
sqr-neg66.0%
associate-*l*66.0%
Simplified66.0%
Taylor expanded in b around -inf 64.2%
expm1-log1p-u59.5%
expm1-udef59.5%
*-commutative59.5%
*-commutative59.5%
Applied egg-rr59.5%
expm1-def59.5%
expm1-log1p64.2%
associate-/l*67.2%
Simplified67.2%
if -4.999999999999985e-310 < b Initial program 39.1%
sqr-neg39.1%
sqr-neg39.1%
associate-*l*39.0%
Simplified39.0%
Taylor expanded in b around inf 65.9%
Final simplification66.6%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} 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 = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
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 = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5); else tmp = -0.5 * (c / 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[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 66.0%
sqr-neg66.0%
sqr-neg66.0%
associate-*l*66.0%
Simplified66.0%
Taylor expanded in b around -inf 67.2%
if -4.999999999999985e-310 < b Initial program 39.1%
sqr-neg39.1%
sqr-neg39.1%
associate-*l*39.0%
Simplified39.0%
Taylor expanded in b around inf 65.9%
Final simplification66.5%
(FPCore (a b c) :precision binary64 (if (<= b 5.5e-297) (* (* b -2.0) (/ 0.3333333333333333 a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 5.5e-297) {
tmp = (b * -2.0) * (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 <= 5.5d-297) then
tmp = (b * (-2.0d0)) * (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 <= 5.5e-297) {
tmp = (b * -2.0) * (0.3333333333333333 / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 5.5e-297: tmp = (b * -2.0) * (0.3333333333333333 / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 5.5e-297) tmp = Float64(Float64(b * -2.0) * Float64(0.3333333333333333 / a)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 5.5e-297) tmp = (b * -2.0) * (0.3333333333333333 / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 5.5e-297], N[(N[(b * -2.0), $MachinePrecision] * N[(0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.5 \cdot 10^{-297}:\\
\;\;\;\;\left(b \cdot -2\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 5.5000000000000003e-297Initial program 66.3%
sqr-neg66.3%
sqr-neg66.3%
associate-*l*66.2%
Simplified66.2%
Applied egg-rr39.1%
sub-neg39.1%
distribute-rgt-out--39.1%
associate-*r*39.1%
Simplified39.1%
Taylor expanded in b around -inf 66.4%
*-commutative66.4%
Simplified66.4%
if 5.5000000000000003e-297 < b Initial program 38.6%
sqr-neg38.6%
sqr-neg38.6%
associate-*l*38.5%
Simplified38.5%
Taylor expanded in b around inf 66.4%
Final simplification66.4%
(FPCore (a b c) :precision binary64 (if (<= b 5.5e-297) (/ (* b -2.0) (* a 3.0)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 5.5e-297) {
tmp = (b * -2.0) / (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 <= 5.5d-297) then
tmp = (b * (-2.0d0)) / (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 <= 5.5e-297) {
tmp = (b * -2.0) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 5.5e-297: tmp = (b * -2.0) / (a * 3.0) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 5.5e-297) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 5.5e-297) tmp = (b * -2.0) / (a * 3.0); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 5.5e-297], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.5 \cdot 10^{-297}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 5.5000000000000003e-297Initial program 66.3%
sqr-neg66.3%
sqr-neg66.3%
associate-*l*66.2%
Simplified66.2%
Taylor expanded in b around -inf 66.5%
*-commutative66.5%
Simplified66.5%
if 5.5000000000000003e-297 < b Initial program 38.6%
sqr-neg38.6%
sqr-neg38.6%
associate-*l*38.5%
Simplified38.5%
Taylor expanded in b around inf 66.4%
Final simplification66.4%
(FPCore (a b c) :precision binary64 (if (<= b 5.5e-297) (* -0.6666666666666666 (/ b a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 5.5e-297) {
tmp = -0.6666666666666666 * (b / 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 <= 5.5d-297) then
tmp = (-0.6666666666666666d0) * (b / a)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 5.5e-297) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 5.5e-297: tmp = -0.6666666666666666 * (b / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 5.5e-297) tmp = Float64(-0.6666666666666666 * Float64(b / a)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 5.5e-297) tmp = -0.6666666666666666 * (b / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 5.5e-297], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.5 \cdot 10^{-297}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 5.5000000000000003e-297Initial program 66.3%
sqr-neg66.3%
sqr-neg66.3%
associate-*l*66.2%
Simplified66.2%
Taylor expanded in b around -inf 66.4%
*-commutative66.4%
Simplified66.4%
if 5.5000000000000003e-297 < b Initial program 38.6%
sqr-neg38.6%
sqr-neg38.6%
associate-*l*38.5%
Simplified38.5%
Taylor expanded in b around inf 66.4%
Final simplification66.4%
(FPCore (a b c) :precision binary64 (* -0.5 (/ c b)))
double code(double a, double b, double c) {
return -0.5 * (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 = (-0.5d0) * (c / b)
end function
public static double code(double a, double b, double c) {
return -0.5 * (c / b);
}
def code(a, b, c): return -0.5 * (c / b)
function code(a, b, c) return Float64(-0.5 * Float64(c / b)) end
function tmp = code(a, b, c) tmp = -0.5 * (c / b); end
code[a_, b_, c_] := N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.5 \cdot \frac{c}{b}
\end{array}
Initial program 52.5%
sqr-neg52.5%
sqr-neg52.5%
associate-*l*52.4%
Simplified52.4%
Taylor expanded in b around inf 34.3%
Final simplification34.3%
(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.5%
neg-sub052.5%
sqr-neg52.5%
associate-+l-52.5%
sub0-neg52.5%
neg-mul-152.5%
Simplified52.3%
Applied egg-rr5.6%
Taylor expanded in b around inf 2.5%
Final simplification2.5%
herbie shell --seed 2023268
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))