
(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 14 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 -9.8e+113)
(/ 1.0 (/ a (* b -0.6666666666666666)))
(if (<= b 2.1e-32)
(/ (- (sqrt (- (* b b) (* (* a 3.0) c))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -9.8e+113) {
tmp = 1.0 / (a / (b * -0.6666666666666666));
} else if (b <= 2.1e-32) {
tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
} 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 <= (-9.8d+113)) then
tmp = 1.0d0 / (a / (b * (-0.6666666666666666d0)))
else if (b <= 2.1d-32) then
tmp = (sqrt(((b * b) - ((a * 3.0d0) * c))) - b) / (a * 3.0d0)
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 <= -9.8e+113) {
tmp = 1.0 / (a / (b * -0.6666666666666666));
} else if (b <= 2.1e-32) {
tmp = (Math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -9.8e+113: tmp = 1.0 / (a / (b * -0.6666666666666666)) elif b <= 2.1e-32: tmp = (math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -9.8e+113) tmp = Float64(1.0 / Float64(a / Float64(b * -0.6666666666666666))); elseif (b <= 2.1e-32) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 3.0) * c))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -9.8e+113) tmp = 1.0 / (a / (b * -0.6666666666666666)); elseif (b <= 2.1e-32) tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -9.8e+113], N[(1.0 / N[(a / N[(b * -0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e-32], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 3.0), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.8 \cdot 10^{+113}:\\
\;\;\;\;\frac{1}{\frac{a}{b \cdot -0.6666666666666666}}\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-32}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -9.80000000000000043e113Initial program 54.8%
sqr-neg54.8%
sqr-neg54.8%
associate-*l*54.8%
Simplified54.8%
Applied egg-rr52.9%
Taylor expanded in b around -inf 95.0%
associate-*r/95.0%
*-commutative95.0%
associate-/l*95.1%
Simplified95.1%
associate-*r/95.0%
clear-num95.1%
Applied egg-rr95.1%
if -9.80000000000000043e113 < b < 2.0999999999999999e-32Initial program 79.7%
if 2.0999999999999999e-32 < b Initial program 7.3%
sqr-neg7.3%
sqr-neg7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in b around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification87.9%
(FPCore (a b c)
:precision binary64
(if (<= b -9.8e+113)
(/ 1.0 (/ a (* b -0.6666666666666666)))
(if (<= b 8.2e-32)
(/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -9.8e+113) {
tmp = 1.0 / (a / (b * -0.6666666666666666));
} else if (b <= 8.2e-32) {
tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} 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 <= (-9.8d+113)) then
tmp = 1.0d0 / (a / (b * (-0.6666666666666666d0)))
else if (b <= 8.2d-32) then
tmp = (sqrt(((b * b) - (3.0d0 * (a * c)))) - b) / (a * 3.0d0)
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 <= -9.8e+113) {
tmp = 1.0 / (a / (b * -0.6666666666666666));
} else if (b <= 8.2e-32) {
tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -9.8e+113: tmp = 1.0 / (a / (b * -0.6666666666666666)) elif b <= 8.2e-32: tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -9.8e+113) tmp = Float64(1.0 / Float64(a / Float64(b * -0.6666666666666666))); elseif (b <= 8.2e-32) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -9.8e+113) tmp = 1.0 / (a / (b * -0.6666666666666666)); elseif (b <= 8.2e-32) tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -9.8e+113], N[(1.0 / N[(a / N[(b * -0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.2e-32], 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 / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.8 \cdot 10^{+113}:\\
\;\;\;\;\frac{1}{\frac{a}{b \cdot -0.6666666666666666}}\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{-32}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -9.80000000000000043e113Initial program 54.8%
sqr-neg54.8%
sqr-neg54.8%
associate-*l*54.8%
Simplified54.8%
Applied egg-rr52.9%
Taylor expanded in b around -inf 95.0%
associate-*r/95.0%
*-commutative95.0%
associate-/l*95.1%
Simplified95.1%
associate-*r/95.0%
clear-num95.1%
Applied egg-rr95.1%
if -9.80000000000000043e113 < b < 8.1999999999999995e-32Initial program 79.7%
sqr-neg79.7%
sqr-neg79.7%
associate-*l*79.6%
Simplified79.6%
if 8.1999999999999995e-32 < b Initial program 7.3%
sqr-neg7.3%
sqr-neg7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in b around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification87.8%
(FPCore (a b c)
:precision binary64
(if (<= b -2.1e-82)
(/ (* a (+ (* (/ b a) -2.0) (* (/ c b) 1.5))) (* a 3.0))
(if (<= b 9.4e-29)
(* (+ b (sqrt (* a (* c -3.0)))) (/ 0.3333333333333333 a))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.1e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 9.4e-29) {
tmp = (b + sqrt((a * (c * -3.0)))) * (0.3333333333333333 / 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 <= (-2.1d-82)) then
tmp = (a * (((b / a) * (-2.0d0)) + ((c / b) * 1.5d0))) / (a * 3.0d0)
else if (b <= 9.4d-29) then
tmp = (b + sqrt((a * (c * (-3.0d0))))) * (0.3333333333333333d0 / 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 <= -2.1e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 9.4e-29) {
tmp = (b + Math.sqrt((a * (c * -3.0)))) * (0.3333333333333333 / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.1e-82: tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0) elif b <= 9.4e-29: tmp = (b + math.sqrt((a * (c * -3.0)))) * (0.3333333333333333 / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.1e-82) tmp = Float64(Float64(a * Float64(Float64(Float64(b / a) * -2.0) + Float64(Float64(c / b) * 1.5))) / Float64(a * 3.0)); elseif (b <= 9.4e-29) tmp = Float64(Float64(b + sqrt(Float64(a * Float64(c * -3.0)))) * Float64(0.3333333333333333 / 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 <= -2.1e-82) tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0); elseif (b <= 9.4e-29) tmp = (b + sqrt((a * (c * -3.0)))) * (0.3333333333333333 / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.1e-82], N[(N[(a * N[(N[(N[(b / a), $MachinePrecision] * -2.0), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.4e-29], N[(N[(b + N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.1 \cdot 10^{-82}:\\
\;\;\;\;\frac{a \cdot \left(\frac{b}{a} \cdot -2 + \frac{c}{b} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 9.4 \cdot 10^{-29}:\\
\;\;\;\;\left(b + \sqrt{a \cdot \left(c \cdot -3\right)}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -2.1e-82Initial program 69.0%
sqr-neg69.0%
sqr-neg69.0%
associate-*l*69.0%
Simplified69.0%
Taylor expanded in b around -inf 83.9%
associate-*r*83.9%
mul-1-neg83.9%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in a around inf 89.2%
if -2.1e-82 < b < 9.3999999999999997e-29Initial program 73.9%
sqr-neg73.9%
sqr-neg73.9%
associate-*l*73.8%
Simplified73.8%
Taylor expanded in b around 0 66.5%
*-commutative66.5%
associate-*r*66.6%
Simplified66.6%
*-un-lft-identity66.6%
+-commutative66.6%
sqrt-prod39.7%
fma-define39.7%
add-sqr-sqrt21.6%
sqrt-unprod39.8%
sqr-neg39.8%
sqrt-prod18.2%
add-sqr-sqrt39.2%
*-commutative39.2%
Applied egg-rr39.2%
associate-*r/39.2%
*-commutative39.2%
times-frac39.2%
metadata-eval39.2%
Simplified39.2%
clear-num39.2%
un-div-inv39.2%
fma-undefine39.2%
sqrt-prod63.8%
*-commutative63.8%
associate-*l*63.8%
+-commutative63.8%
associate-*l*63.8%
*-commutative63.8%
Applied egg-rr63.8%
associate-/r/63.9%
Simplified63.9%
if 9.3999999999999997e-29 < b Initial program 7.3%
sqr-neg7.3%
sqr-neg7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in b around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification83.1%
(FPCore (a b c)
:precision binary64
(if (<= b -1.4e-82)
(/ (* a (+ (* (/ b a) -2.0) (* (/ c b) 1.5))) (* a 3.0))
(if (<= b 7.2e-29)
(/ (* (+ b (sqrt (* a (* c -3.0)))) 0.3333333333333333) a)
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.4e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 7.2e-29) {
tmp = ((b + sqrt((a * (c * -3.0)))) * 0.3333333333333333) / 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 <= (-1.4d-82)) then
tmp = (a * (((b / a) * (-2.0d0)) + ((c / b) * 1.5d0))) / (a * 3.0d0)
else if (b <= 7.2d-29) then
tmp = ((b + sqrt((a * (c * (-3.0d0))))) * 0.3333333333333333d0) / 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 <= -1.4e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 7.2e-29) {
tmp = ((b + Math.sqrt((a * (c * -3.0)))) * 0.3333333333333333) / a;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.4e-82: tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0) elif b <= 7.2e-29: tmp = ((b + math.sqrt((a * (c * -3.0)))) * 0.3333333333333333) / a else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.4e-82) tmp = Float64(Float64(a * Float64(Float64(Float64(b / a) * -2.0) + Float64(Float64(c / b) * 1.5))) / Float64(a * 3.0)); elseif (b <= 7.2e-29) tmp = Float64(Float64(Float64(b + sqrt(Float64(a * Float64(c * -3.0)))) * 0.3333333333333333) / 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 <= -1.4e-82) tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0); elseif (b <= 7.2e-29) tmp = ((b + sqrt((a * (c * -3.0)))) * 0.3333333333333333) / a; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.4e-82], N[(N[(a * N[(N[(N[(b / a), $MachinePrecision] * -2.0), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.2e-29], N[(N[(N[(b + N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / a), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.4 \cdot 10^{-82}:\\
\;\;\;\;\frac{a \cdot \left(\frac{b}{a} \cdot -2 + \frac{c}{b} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 7.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{\left(b + \sqrt{a \cdot \left(c \cdot -3\right)}\right) \cdot 0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -1.40000000000000012e-82Initial program 69.0%
sqr-neg69.0%
sqr-neg69.0%
associate-*l*69.0%
Simplified69.0%
Taylor expanded in b around -inf 83.9%
associate-*r*83.9%
mul-1-neg83.9%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in a around inf 89.2%
if -1.40000000000000012e-82 < b < 7.19999999999999948e-29Initial program 73.9%
sqr-neg73.9%
sqr-neg73.9%
associate-*l*73.8%
Simplified73.8%
Taylor expanded in b around 0 66.5%
*-commutative66.5%
associate-*r*66.6%
Simplified66.6%
*-un-lft-identity66.6%
+-commutative66.6%
sqrt-prod39.7%
fma-define39.7%
add-sqr-sqrt21.6%
sqrt-unprod39.8%
sqr-neg39.8%
sqrt-prod18.2%
add-sqr-sqrt39.2%
*-commutative39.2%
Applied egg-rr39.2%
associate-*r/39.2%
*-commutative39.2%
times-frac39.2%
metadata-eval39.2%
Simplified39.2%
metadata-eval39.2%
fma-undefine39.2%
sqrt-prod63.9%
*-commutative63.9%
associate-*l*63.9%
times-frac64.1%
*-un-lft-identity64.1%
associate-/r*64.0%
div-inv63.9%
+-commutative63.9%
associate-*l*63.9%
*-commutative63.9%
metadata-eval63.9%
Applied egg-rr63.9%
if 7.19999999999999948e-29 < b Initial program 7.3%
sqr-neg7.3%
sqr-neg7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in b around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification83.1%
(FPCore (a b c)
:precision binary64
(if (<= b -4e-82)
(/ (* a (+ (* (/ b a) -2.0) (* (/ c b) 1.5))) (* a 3.0))
(if (<= b 7e-26)
(/ (+ b (sqrt (* c (* a -3.0)))) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 7e-26) {
tmp = (b + sqrt((c * (a * -3.0)))) / (a * 3.0);
} 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 <= (-4d-82)) then
tmp = (a * (((b / a) * (-2.0d0)) + ((c / b) * 1.5d0))) / (a * 3.0d0)
else if (b <= 7d-26) then
tmp = (b + sqrt((c * (a * (-3.0d0))))) / (a * 3.0d0)
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 <= -4e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 7e-26) {
tmp = (b + Math.sqrt((c * (a * -3.0)))) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-82: tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0) elif b <= 7e-26: tmp = (b + math.sqrt((c * (a * -3.0)))) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-82) tmp = Float64(Float64(a * Float64(Float64(Float64(b / a) * -2.0) + Float64(Float64(c / b) * 1.5))) / Float64(a * 3.0)); elseif (b <= 7e-26) tmp = Float64(Float64(b + sqrt(Float64(c * Float64(a * -3.0)))) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-82) tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0); elseif (b <= 7e-26) tmp = (b + sqrt((c * (a * -3.0)))) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-82], N[(N[(a * N[(N[(N[(b / a), $MachinePrecision] * -2.0), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e-26], N[(N[(b + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-82}:\\
\;\;\;\;\frac{a \cdot \left(\frac{b}{a} \cdot -2 + \frac{c}{b} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 7 \cdot 10^{-26}:\\
\;\;\;\;\frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4e-82Initial program 69.0%
sqr-neg69.0%
sqr-neg69.0%
associate-*l*69.0%
Simplified69.0%
Taylor expanded in b around -inf 83.9%
associate-*r*83.9%
mul-1-neg83.9%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in a around inf 89.2%
if -4e-82 < b < 6.9999999999999997e-26Initial program 73.9%
sqr-neg73.9%
sqr-neg73.9%
associate-*l*73.8%
Simplified73.8%
Taylor expanded in b around 0 66.5%
*-commutative66.5%
associate-*r*66.6%
Simplified66.6%
+-commutative66.6%
*-un-lft-identity66.6%
fma-define66.6%
add-sqr-sqrt33.8%
sqrt-unprod66.1%
sqr-neg66.1%
sqrt-prod32.7%
add-sqr-sqrt64.0%
Applied egg-rr64.0%
fma-undefine64.0%
*-lft-identity64.0%
associate-*r*63.9%
*-commutative63.9%
associate-*r*64.1%
*-commutative64.1%
Simplified64.1%
if 6.9999999999999997e-26 < b Initial program 7.3%
sqr-neg7.3%
sqr-neg7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in b around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification83.2%
(FPCore (a b c)
:precision binary64
(if (<= b -4.6e-82)
(/ (* a (+ (* (/ b a) -2.0) (* (/ c b) 1.5))) (* a 3.0))
(if (<= b 3.7e-34)
(/ (- (sqrt (* (* a c) -3.0)) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.6e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 3.7e-34) {
tmp = (sqrt(((a * c) * -3.0)) - b) / (a * 3.0);
} 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 <= (-4.6d-82)) then
tmp = (a * (((b / a) * (-2.0d0)) + ((c / b) * 1.5d0))) / (a * 3.0d0)
else if (b <= 3.7d-34) then
tmp = (sqrt(((a * c) * (-3.0d0))) - b) / (a * 3.0d0)
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 <= -4.6e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 3.7e-34) {
tmp = (Math.sqrt(((a * c) * -3.0)) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.6e-82: tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0) elif b <= 3.7e-34: tmp = (math.sqrt(((a * c) * -3.0)) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.6e-82) tmp = Float64(Float64(a * Float64(Float64(Float64(b / a) * -2.0) + Float64(Float64(c / b) * 1.5))) / Float64(a * 3.0)); elseif (b <= 3.7e-34) tmp = Float64(Float64(sqrt(Float64(Float64(a * c) * -3.0)) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.6e-82) tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0); elseif (b <= 3.7e-34) tmp = (sqrt(((a * c) * -3.0)) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.6e-82], N[(N[(a * N[(N[(N[(b / a), $MachinePrecision] * -2.0), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.7e-34], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{-82}:\\
\;\;\;\;\frac{a \cdot \left(\frac{b}{a} \cdot -2 + \frac{c}{b} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{-34}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4.59999999999999994e-82Initial program 69.0%
sqr-neg69.0%
sqr-neg69.0%
associate-*l*69.0%
Simplified69.0%
Taylor expanded in b around -inf 83.9%
associate-*r*83.9%
mul-1-neg83.9%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in a around inf 89.2%
if -4.59999999999999994e-82 < b < 3.69999999999999988e-34Initial program 73.9%
sqr-neg73.9%
sqr-neg73.9%
associate-*l*73.8%
Simplified73.8%
Taylor expanded in b around 0 66.5%
if 3.69999999999999988e-34 < b Initial program 7.3%
sqr-neg7.3%
sqr-neg7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in b around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification83.9%
(FPCore (a b c)
:precision binary64
(if (<= b -1.45e-82)
(/ (* a (+ (* (/ b a) -2.0) (* (/ c b) 1.5))) (* a 3.0))
(if (<= b 3.1e-34)
(/ (- (sqrt (* a (* c -3.0))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.45e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 3.1e-34) {
tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0);
} 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 <= (-1.45d-82)) then
tmp = (a * (((b / a) * (-2.0d0)) + ((c / b) * 1.5d0))) / (a * 3.0d0)
else if (b <= 3.1d-34) then
tmp = (sqrt((a * (c * (-3.0d0)))) - b) / (a * 3.0d0)
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 <= -1.45e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 3.1e-34) {
tmp = (Math.sqrt((a * (c * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.45e-82: tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0) elif b <= 3.1e-34: tmp = (math.sqrt((a * (c * -3.0))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.45e-82) tmp = Float64(Float64(a * Float64(Float64(Float64(b / a) * -2.0) + Float64(Float64(c / b) * 1.5))) / Float64(a * 3.0)); elseif (b <= 3.1e-34) tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.45e-82) tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0); elseif (b <= 3.1e-34) tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.45e-82], N[(N[(a * N[(N[(N[(b / a), $MachinePrecision] * -2.0), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.1e-34], N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{-82}:\\
\;\;\;\;\frac{a \cdot \left(\frac{b}{a} \cdot -2 + \frac{c}{b} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{-34}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -1.44999999999999989e-82Initial program 69.0%
sqr-neg69.0%
sqr-neg69.0%
associate-*l*69.0%
Simplified69.0%
Taylor expanded in b around -inf 83.9%
associate-*r*83.9%
mul-1-neg83.9%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in a around inf 89.2%
if -1.44999999999999989e-82 < b < 3.0999999999999998e-34Initial program 73.9%
sqr-neg73.9%
sqr-neg73.9%
associate-*l*73.8%
Simplified73.8%
Taylor expanded in b around 0 66.5%
*-commutative66.5%
associate-*r*66.6%
Simplified66.6%
if 3.0999999999999998e-34 < b Initial program 7.3%
sqr-neg7.3%
sqr-neg7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in b around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification83.9%
(FPCore (a b c)
:precision binary64
(if (<= b -2.5e-82)
(/ (* a (+ (* (/ b a) -2.0) (* (/ c b) 1.5))) (* a 3.0))
(if (<= b 7.8e-34)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.5e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 7.8e-34) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} 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 <= (-2.5d-82)) then
tmp = (a * (((b / a) * (-2.0d0)) + ((c / b) * 1.5d0))) / (a * 3.0d0)
else if (b <= 7.8d-34) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
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 <= -2.5e-82) {
tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0);
} else if (b <= 7.8e-34) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.5e-82: tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0) elif b <= 7.8e-34: tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.5e-82) tmp = Float64(Float64(a * Float64(Float64(Float64(b / a) * -2.0) + Float64(Float64(c / b) * 1.5))) / Float64(a * 3.0)); elseif (b <= 7.8e-34) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.5e-82) tmp = (a * (((b / a) * -2.0) + ((c / b) * 1.5))) / (a * 3.0); elseif (b <= 7.8e-34) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.5e-82], N[(N[(a * N[(N[(N[(b / a), $MachinePrecision] * -2.0), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.8e-34], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.5 \cdot 10^{-82}:\\
\;\;\;\;\frac{a \cdot \left(\frac{b}{a} \cdot -2 + \frac{c}{b} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{-34}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -2.4999999999999999e-82Initial program 69.0%
sqr-neg69.0%
sqr-neg69.0%
associate-*l*69.0%
Simplified69.0%
Taylor expanded in b around -inf 83.9%
associate-*r*83.9%
mul-1-neg83.9%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in a around inf 89.2%
if -2.4999999999999999e-82 < b < 7.79999999999999982e-34Initial program 73.9%
sqr-neg73.9%
sqr-neg73.9%
associate-*l*73.8%
Simplified73.8%
Taylor expanded in b around 0 66.5%
*-commutative66.5%
*-commutative66.5%
associate-*r*66.7%
Simplified66.7%
if 7.79999999999999982e-34 < b Initial program 7.3%
sqr-neg7.3%
sqr-neg7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in b around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification84.0%
(FPCore (a b c)
:precision binary64
(if (<= b -4.6e-82)
(/ 1.0 (/ 3.0 (fma (/ b a) -2.0 (* (/ c b) 1.5))))
(if (<= b 6.6e-34)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.6e-82) {
tmp = 1.0 / (3.0 / fma((b / a), -2.0, ((c / b) * 1.5)));
} else if (b <= 6.6e-34) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -4.6e-82) tmp = Float64(1.0 / Float64(3.0 / fma(Float64(b / a), -2.0, Float64(Float64(c / b) * 1.5)))); elseif (b <= 6.6e-34) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -4.6e-82], N[(1.0 / N[(3.0 / N[(N[(b / a), $MachinePrecision] * -2.0 + N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.6e-34], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{-82}:\\
\;\;\;\;\frac{1}{\frac{3}{\mathsf{fma}\left(\frac{b}{a}, -2, \frac{c}{b} \cdot 1.5\right)}}\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{-34}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4.59999999999999994e-82Initial program 69.0%
sqr-neg69.0%
sqr-neg69.0%
associate-*l*69.0%
Simplified69.0%
Taylor expanded in b around -inf 83.9%
associate-*r*83.9%
mul-1-neg83.9%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in a around inf 89.2%
clear-num89.1%
inv-pow89.1%
*-commutative89.1%
times-frac89.3%
fma-define89.3%
associate-*r/89.3%
Applied egg-rr89.3%
unpow-189.3%
*-inverses89.3%
*-lft-identity89.3%
fma-undefine89.3%
*-commutative89.3%
fma-undefine89.3%
associate-*r/89.3%
*-commutative89.3%
Simplified89.3%
if -4.59999999999999994e-82 < b < 6.59999999999999965e-34Initial program 73.9%
sqr-neg73.9%
sqr-neg73.9%
associate-*l*73.8%
Simplified73.8%
Taylor expanded in b around 0 66.5%
*-commutative66.5%
*-commutative66.5%
associate-*r*66.7%
Simplified66.7%
if 6.59999999999999965e-34 < b Initial program 7.3%
sqr-neg7.3%
sqr-neg7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in b around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification84.0%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5)) (* (/ c b) -0.5)))
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 = (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)) + ((c / b) * 0.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 <= -5e-310) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) else: tmp = (c / b) * -0.5 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(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)) + ((c / b) * 0.5); else tmp = (c / b) * -0.5; 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[(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} + \frac{c}{b} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 71.4%
sqr-neg71.4%
sqr-neg71.4%
associate-*l*71.3%
Simplified71.3%
Taylor expanded in b around -inf 64.3%
associate-*r*64.3%
mul-1-neg64.3%
associate-/l*68.1%
Simplified68.1%
Taylor expanded in a around inf 69.3%
if -4.999999999999985e-310 < b Initial program 26.4%
sqr-neg26.4%
sqr-neg26.4%
associate-*l*26.4%
Simplified26.4%
Taylor expanded in b around inf 73.8%
*-commutative73.8%
Simplified73.8%
Final simplification71.4%
(FPCore (a b c) :precision binary64 (if (<= b 1.15e-20) (* b (/ -0.6666666666666666 a)) (* (/ c b) 0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.15e-20) {
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 <= 1.15d-20) 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 <= 1.15e-20) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = (c / b) * 0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.15e-20: tmp = b * (-0.6666666666666666 / a) else: tmp = (c / b) * 0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.15e-20) 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 <= 1.15e-20) tmp = b * (-0.6666666666666666 / a); else tmp = (c / b) * 0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.15e-20], 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 1.15 \cdot 10^{-20}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5\\
\end{array}
\end{array}
if b < 1.15e-20Initial program 70.4%
sqr-neg70.4%
sqr-neg70.4%
associate-*l*70.4%
Simplified70.4%
Applied egg-rr62.3%
Taylor expanded in b around -inf 54.4%
associate-*r/54.4%
*-commutative54.4%
associate-/l*54.5%
Simplified54.5%
if 1.15e-20 < b Initial program 7.4%
sqr-neg7.4%
sqr-neg7.4%
associate-*l*7.4%
Simplified7.4%
Taylor expanded in b around -inf 2.3%
associate-*r*2.3%
mul-1-neg2.3%
associate-/l*2.6%
Simplified2.6%
Taylor expanded in b around 0 21.2%
Final simplification44.0%
(FPCore (a b c) :precision binary64 (if (<= b 5e-310) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 5e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 5d-310) then
tmp = b * ((-0.6666666666666666d0) / a)
else
tmp = c * ((-0.5d0) / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 5e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 5e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 5e-310) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 5e-310) tmp = b * (-0.6666666666666666 / a); else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 5e-310], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 4.999999999999985e-310Initial program 71.4%
sqr-neg71.4%
sqr-neg71.4%
associate-*l*71.3%
Simplified71.3%
Applied egg-rr61.1%
Taylor expanded in b around -inf 68.7%
associate-*r/68.7%
*-commutative68.7%
associate-/l*68.8%
Simplified68.8%
if 4.999999999999985e-310 < b Initial program 26.4%
sqr-neg26.4%
sqr-neg26.4%
associate-*l*26.4%
Simplified26.4%
Taylor expanded in b around inf 56.0%
associate-/l*63.9%
Simplified63.9%
*-un-lft-identity63.9%
times-frac63.8%
metadata-eval63.8%
Applied egg-rr63.8%
Taylor expanded in a around 0 73.8%
associate-*r/73.8%
*-commutative73.8%
metadata-eval73.8%
rem-square-sqrt0.0%
unpow20.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt73.6%
metadata-eval73.6%
Simplified73.6%
Final simplification71.0%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* b (/ -0.6666666666666666 a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
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-310)) 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-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) 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-310) tmp = b * (-0.6666666666666666 / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], 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^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 71.4%
sqr-neg71.4%
sqr-neg71.4%
associate-*l*71.3%
Simplified71.3%
Applied egg-rr61.1%
Taylor expanded in b around -inf 68.7%
associate-*r/68.7%
*-commutative68.7%
associate-/l*68.8%
Simplified68.8%
if -4.999999999999985e-310 < b Initial program 26.4%
sqr-neg26.4%
sqr-neg26.4%
associate-*l*26.4%
Simplified26.4%
Taylor expanded in b around inf 73.8%
*-commutative73.8%
Simplified73.8%
Final simplification71.1%
(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 50.5%
sqr-neg50.5%
sqr-neg50.5%
associate-*l*50.4%
Simplified50.4%
Taylor expanded in b around -inf 35.3%
associate-*r*35.3%
mul-1-neg35.3%
associate-/l*37.4%
Simplified37.4%
Taylor expanded in b around 0 9.0%
Final simplification9.0%
herbie shell --seed 2024080
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))