
(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 -7e+153)
(/ b (* a -1.5))
(if (<= b 2.4e-8)
(/ (- (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 <= -7e+153) {
tmp = b / (a * -1.5);
} else if (b <= 2.4e-8) {
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 <= (-7d+153)) then
tmp = b / (a * (-1.5d0))
else if (b <= 2.4d-8) 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 <= -7e+153) {
tmp = b / (a * -1.5);
} else if (b <= 2.4e-8) {
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 <= -7e+153: tmp = b / (a * -1.5) elif b <= 2.4e-8: 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 <= -7e+153) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 2.4e-8) 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 <= -7e+153) tmp = b / (a * -1.5); elseif (b <= 2.4e-8) 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, -7e+153], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.4e-8], 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 -7 \cdot 10^{+153}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;\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 < -6.9999999999999998e153Initial program 29.7%
sqr-neg29.7%
sqr-neg29.7%
associate-*l*29.7%
Simplified29.7%
Taylor expanded in b around -inf 95.0%
*-commutative95.0%
Simplified95.0%
*-commutative95.0%
clear-num95.1%
un-div-inv95.2%
Applied egg-rr95.2%
associate-/r/95.2%
Simplified95.2%
*-commutative95.2%
clear-num95.0%
un-div-inv95.1%
div-inv95.3%
metadata-eval95.3%
Applied egg-rr95.3%
if -6.9999999999999998e153 < b < 2.39999999999999998e-8Initial program 80.7%
if 2.39999999999999998e-8 < b Initial program 14.8%
sqr-neg14.8%
sqr-neg14.8%
associate-*l*14.7%
Simplified14.7%
Taylor expanded in b around inf 88.0%
*-commutative88.0%
Simplified88.0%
Final simplification85.2%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))))
(if (<= b -1.1e-28)
(/ (/ b (- a)) 1.5)
(if (<= b -3.35e-90)
t_0
(if (<= b -5.4e-130)
(/ b (* a -1.5))
(if (<= b 6.6e-105)
t_0
(if (<= b 8.8e-25)
(* c (- (* -0.375 (* a (/ c (pow b 3.0)))) (/ 0.5 b)))
(if (<= b 2.4e-8)
(/ (- (sqrt (* (* a c) -3.0)) b) (* a 3.0))
(* (/ c b) -0.5)))))))))
double code(double a, double b, double c) {
double t_0 = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
double tmp;
if (b <= -1.1e-28) {
tmp = (b / -a) / 1.5;
} else if (b <= -3.35e-90) {
tmp = t_0;
} else if (b <= -5.4e-130) {
tmp = b / (a * -1.5);
} else if (b <= 6.6e-105) {
tmp = t_0;
} else if (b <= 8.8e-25) {
tmp = c * ((-0.375 * (a * (c / pow(b, 3.0)))) - (0.5 / b));
} else if (b <= 2.4e-8) {
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) :: t_0
real(8) :: tmp
t_0 = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
if (b <= (-1.1d-28)) then
tmp = (b / -a) / 1.5d0
else if (b <= (-3.35d-90)) then
tmp = t_0
else if (b <= (-5.4d-130)) then
tmp = b / (a * (-1.5d0))
else if (b <= 6.6d-105) then
tmp = t_0
else if (b <= 8.8d-25) then
tmp = c * (((-0.375d0) * (a * (c / (b ** 3.0d0)))) - (0.5d0 / b))
else if (b <= 2.4d-8) 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 t_0 = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
double tmp;
if (b <= -1.1e-28) {
tmp = (b / -a) / 1.5;
} else if (b <= -3.35e-90) {
tmp = t_0;
} else if (b <= -5.4e-130) {
tmp = b / (a * -1.5);
} else if (b <= 6.6e-105) {
tmp = t_0;
} else if (b <= 8.8e-25) {
tmp = c * ((-0.375 * (a * (c / Math.pow(b, 3.0)))) - (0.5 / b));
} else if (b <= 2.4e-8) {
tmp = (Math.sqrt(((a * c) * -3.0)) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): t_0 = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) tmp = 0 if b <= -1.1e-28: tmp = (b / -a) / 1.5 elif b <= -3.35e-90: tmp = t_0 elif b <= -5.4e-130: tmp = b / (a * -1.5) elif b <= 6.6e-105: tmp = t_0 elif b <= 8.8e-25: tmp = c * ((-0.375 * (a * (c / math.pow(b, 3.0)))) - (0.5 / b)) elif b <= 2.4e-8: tmp = (math.sqrt(((a * c) * -3.0)) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) t_0 = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)) tmp = 0.0 if (b <= -1.1e-28) tmp = Float64(Float64(b / Float64(-a)) / 1.5); elseif (b <= -3.35e-90) tmp = t_0; elseif (b <= -5.4e-130) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 6.6e-105) tmp = t_0; elseif (b <= 8.8e-25) tmp = Float64(c * Float64(Float64(-0.375 * Float64(a * Float64(c / (b ^ 3.0)))) - Float64(0.5 / b))); elseif (b <= 2.4e-8) 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) t_0 = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); tmp = 0.0; if (b <= -1.1e-28) tmp = (b / -a) / 1.5; elseif (b <= -3.35e-90) tmp = t_0; elseif (b <= -5.4e-130) tmp = b / (a * -1.5); elseif (b <= 6.6e-105) tmp = t_0; elseif (b <= 8.8e-25) tmp = c * ((-0.375 * (a * (c / (b ^ 3.0)))) - (0.5 / b)); elseif (b <= 2.4e-8) 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_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.1e-28], N[(N[(b / (-a)), $MachinePrecision] / 1.5), $MachinePrecision], If[LessEqual[b, -3.35e-90], t$95$0, If[LessEqual[b, -5.4e-130], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.6e-105], t$95$0, If[LessEqual[b, 8.8e-25], N[(c * N[(N[(-0.375 * N[(a * N[(c / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.5 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.4e-8], 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}
t_0 := \frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{if}\;b \leq -1.1 \cdot 10^{-28}:\\
\;\;\;\;\frac{\frac{b}{-a}}{1.5}\\
\mathbf{elif}\;b \leq -3.35 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq -5.4 \cdot 10^{-130}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{-105}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 8.8 \cdot 10^{-25}:\\
\;\;\;\;c \cdot \left(-0.375 \cdot \left(a \cdot \frac{c}{{b}^{3}}\right) - \frac{0.5}{b}\right)\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;\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 < -1.09999999999999998e-28Initial program 60.8%
sqr-neg60.8%
sqr-neg60.8%
associate-*l*60.7%
Simplified60.7%
Taylor expanded in b around -inf 85.6%
*-commutative85.6%
Simplified85.6%
*-commutative85.6%
clear-num85.5%
un-div-inv85.6%
Applied egg-rr85.6%
associate-/r/85.6%
Simplified85.6%
associate-/r/85.6%
metadata-eval85.6%
associate-/r*85.7%
*-commutative85.7%
associate-*l/85.6%
Applied egg-rr85.6%
*-commutative85.6%
associate-/l*85.7%
metadata-eval85.7%
distribute-lft-neg-in85.7%
*-commutative85.7%
distribute-frac-neg285.7%
associate-/r*85.6%
distribute-neg-frac85.6%
distribute-frac-neg285.6%
distribute-frac-neg285.6%
associate-/r/85.7%
distribute-rgt-neg-in85.7%
associate-*l/85.7%
*-lft-identity85.7%
distribute-frac-neg285.7%
Simplified85.7%
if -1.09999999999999998e-28 < b < -3.3500000000000002e-90 or -5.39999999999999982e-130 < b < 6.5999999999999997e-105Initial program 83.0%
sqr-neg83.0%
sqr-neg83.0%
associate-*l*82.8%
Simplified82.8%
Taylor expanded in b around 0 73.7%
*-commutative73.7%
*-commutative73.7%
associate-*r*73.9%
Simplified73.9%
+-commutative73.9%
unsub-neg73.9%
Applied egg-rr73.9%
if -3.3500000000000002e-90 < b < -5.39999999999999982e-130Initial program 99.7%
sqr-neg99.7%
sqr-neg99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in b around -inf 99.5%
*-commutative99.5%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.0%
Applied egg-rr99.0%
associate-/r/98.7%
Simplified98.7%
*-commutative98.7%
clear-num99.0%
un-div-inv99.5%
div-inv99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 6.5999999999999997e-105 < b < 8.8000000000000008e-25Initial program 36.9%
sqr-neg36.9%
sqr-neg36.9%
associate-*l*36.9%
Simplified36.9%
Taylor expanded in c around 0 57.0%
associate-/l*57.0%
associate-*r/57.0%
metadata-eval57.0%
Simplified57.0%
if 8.8000000000000008e-25 < b < 2.39999999999999998e-8Initial program 83.7%
sqr-neg83.7%
sqr-neg83.7%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in b around 0 83.3%
if 2.39999999999999998e-8 < b Initial program 14.8%
sqr-neg14.8%
sqr-neg14.8%
associate-*l*14.7%
Simplified14.7%
Taylor expanded in b around inf 88.0%
*-commutative88.0%
Simplified88.0%
Final simplification82.3%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (* (- b (sqrt (* (* a c) -3.0))) (/ -0.3333333333333333 a))))
(if (<= b -9.2e-31)
(/ (/ b (- a)) 1.5)
(if (<= b -4.8e-89)
t_0
(if (<= b -2e-129)
(/ b (* a -1.5))
(if (<= b 3.7e-113) t_0 (* (/ c b) -0.5)))))))
double code(double a, double b, double c) {
double t_0 = (b - sqrt(((a * c) * -3.0))) * (-0.3333333333333333 / a);
double tmp;
if (b <= -9.2e-31) {
tmp = (b / -a) / 1.5;
} else if (b <= -4.8e-89) {
tmp = t_0;
} else if (b <= -2e-129) {
tmp = b / (a * -1.5);
} else if (b <= 3.7e-113) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (b - sqrt(((a * c) * (-3.0d0)))) * ((-0.3333333333333333d0) / a)
if (b <= (-9.2d-31)) then
tmp = (b / -a) / 1.5d0
else if (b <= (-4.8d-89)) then
tmp = t_0
else if (b <= (-2d-129)) then
tmp = b / (a * (-1.5d0))
else if (b <= 3.7d-113) then
tmp = t_0
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = (b - Math.sqrt(((a * c) * -3.0))) * (-0.3333333333333333 / a);
double tmp;
if (b <= -9.2e-31) {
tmp = (b / -a) / 1.5;
} else if (b <= -4.8e-89) {
tmp = t_0;
} else if (b <= -2e-129) {
tmp = b / (a * -1.5);
} else if (b <= 3.7e-113) {
tmp = t_0;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): t_0 = (b - math.sqrt(((a * c) * -3.0))) * (-0.3333333333333333 / a) tmp = 0 if b <= -9.2e-31: tmp = (b / -a) / 1.5 elif b <= -4.8e-89: tmp = t_0 elif b <= -2e-129: tmp = b / (a * -1.5) elif b <= 3.7e-113: tmp = t_0 else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) t_0 = Float64(Float64(b - sqrt(Float64(Float64(a * c) * -3.0))) * Float64(-0.3333333333333333 / a)) tmp = 0.0 if (b <= -9.2e-31) tmp = Float64(Float64(b / Float64(-a)) / 1.5); elseif (b <= -4.8e-89) tmp = t_0; elseif (b <= -2e-129) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 3.7e-113) tmp = t_0; else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) t_0 = (b - sqrt(((a * c) * -3.0))) * (-0.3333333333333333 / a); tmp = 0.0; if (b <= -9.2e-31) tmp = (b / -a) / 1.5; elseif (b <= -4.8e-89) tmp = t_0; elseif (b <= -2e-129) tmp = b / (a * -1.5); elseif (b <= 3.7e-113) tmp = t_0; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(b - N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9.2e-31], N[(N[(b / (-a)), $MachinePrecision] / 1.5), $MachinePrecision], If[LessEqual[b, -4.8e-89], t$95$0, If[LessEqual[b, -2e-129], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.7e-113], t$95$0, N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(b - \sqrt{\left(a \cdot c\right) \cdot -3}\right) \cdot \frac{-0.3333333333333333}{a}\\
\mathbf{if}\;b \leq -9.2 \cdot 10^{-31}:\\
\;\;\;\;\frac{\frac{b}{-a}}{1.5}\\
\mathbf{elif}\;b \leq -4.8 \cdot 10^{-89}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq -2 \cdot 10^{-129}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{-113}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -9.1999999999999994e-31Initial program 60.8%
sqr-neg60.8%
sqr-neg60.8%
associate-*l*60.7%
Simplified60.7%
Taylor expanded in b around -inf 85.6%
*-commutative85.6%
Simplified85.6%
*-commutative85.6%
clear-num85.5%
un-div-inv85.6%
Applied egg-rr85.6%
associate-/r/85.6%
Simplified85.6%
associate-/r/85.6%
metadata-eval85.6%
associate-/r*85.7%
*-commutative85.7%
associate-*l/85.6%
Applied egg-rr85.6%
*-commutative85.6%
associate-/l*85.7%
metadata-eval85.7%
distribute-lft-neg-in85.7%
*-commutative85.7%
distribute-frac-neg285.7%
associate-/r*85.6%
distribute-neg-frac85.6%
distribute-frac-neg285.6%
distribute-frac-neg285.6%
associate-/r/85.7%
distribute-rgt-neg-in85.7%
associate-*l/85.7%
*-lft-identity85.7%
distribute-frac-neg285.7%
Simplified85.7%
if -9.1999999999999994e-31 < b < -4.80000000000000032e-89 or -1.9999999999999999e-129 < b < 3.6999999999999998e-113Initial program 83.0%
sqr-neg83.0%
sqr-neg83.0%
associate-*l*82.8%
Simplified82.8%
frac-2neg82.8%
div-inv82.8%
Applied egg-rr82.9%
Taylor expanded in a around 0 82.7%
Taylor expanded in b around 0 73.6%
if -4.80000000000000032e-89 < b < -1.9999999999999999e-129Initial program 99.7%
sqr-neg99.7%
sqr-neg99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in b around -inf 99.5%
*-commutative99.5%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.0%
Applied egg-rr99.0%
associate-/r/98.7%
Simplified98.7%
*-commutative98.7%
clear-num99.0%
un-div-inv99.5%
div-inv99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 3.6999999999999998e-113 < b Initial program 22.2%
sqr-neg22.2%
sqr-neg22.2%
associate-*l*22.1%
Simplified22.1%
Taylor expanded in b around inf 78.7%
*-commutative78.7%
Simplified78.7%
Final simplification80.5%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))))
(if (<= b -2.5e-30)
(/ (/ b (- a)) 1.5)
(if (<= b -2.9e-90)
t_0
(if (<= b -2e-129)
(/ b (* a -1.5))
(if (<= b 1.3e-106) t_0 (* (/ c b) -0.5)))))))
double code(double a, double b, double c) {
double t_0 = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
double tmp;
if (b <= -2.5e-30) {
tmp = (b / -a) / 1.5;
} else if (b <= -2.9e-90) {
tmp = t_0;
} else if (b <= -2e-129) {
tmp = b / (a * -1.5);
} else if (b <= 1.3e-106) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
if (b <= (-2.5d-30)) then
tmp = (b / -a) / 1.5d0
else if (b <= (-2.9d-90)) then
tmp = t_0
else if (b <= (-2d-129)) then
tmp = b / (a * (-1.5d0))
else if (b <= 1.3d-106) then
tmp = t_0
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
double tmp;
if (b <= -2.5e-30) {
tmp = (b / -a) / 1.5;
} else if (b <= -2.9e-90) {
tmp = t_0;
} else if (b <= -2e-129) {
tmp = b / (a * -1.5);
} else if (b <= 1.3e-106) {
tmp = t_0;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): t_0 = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) tmp = 0 if b <= -2.5e-30: tmp = (b / -a) / 1.5 elif b <= -2.9e-90: tmp = t_0 elif b <= -2e-129: tmp = b / (a * -1.5) elif b <= 1.3e-106: tmp = t_0 else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) t_0 = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)) tmp = 0.0 if (b <= -2.5e-30) tmp = Float64(Float64(b / Float64(-a)) / 1.5); elseif (b <= -2.9e-90) tmp = t_0; elseif (b <= -2e-129) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 1.3e-106) tmp = t_0; else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) t_0 = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); tmp = 0.0; if (b <= -2.5e-30) tmp = (b / -a) / 1.5; elseif (b <= -2.9e-90) tmp = t_0; elseif (b <= -2e-129) tmp = b / (a * -1.5); elseif (b <= 1.3e-106) tmp = t_0; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.5e-30], N[(N[(b / (-a)), $MachinePrecision] / 1.5), $MachinePrecision], If[LessEqual[b, -2.9e-90], t$95$0, If[LessEqual[b, -2e-129], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.3e-106], t$95$0, N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{if}\;b \leq -2.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{\frac{b}{-a}}{1.5}\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq -2 \cdot 10^{-129}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{-106}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -2.49999999999999986e-30Initial program 60.8%
sqr-neg60.8%
sqr-neg60.8%
associate-*l*60.7%
Simplified60.7%
Taylor expanded in b around -inf 85.6%
*-commutative85.6%
Simplified85.6%
*-commutative85.6%
clear-num85.5%
un-div-inv85.6%
Applied egg-rr85.6%
associate-/r/85.6%
Simplified85.6%
associate-/r/85.6%
metadata-eval85.6%
associate-/r*85.7%
*-commutative85.7%
associate-*l/85.6%
Applied egg-rr85.6%
*-commutative85.6%
associate-/l*85.7%
metadata-eval85.7%
distribute-lft-neg-in85.7%
*-commutative85.7%
distribute-frac-neg285.7%
associate-/r*85.6%
distribute-neg-frac85.6%
distribute-frac-neg285.6%
distribute-frac-neg285.6%
associate-/r/85.7%
distribute-rgt-neg-in85.7%
associate-*l/85.7%
*-lft-identity85.7%
distribute-frac-neg285.7%
Simplified85.7%
if -2.49999999999999986e-30 < b < -2.89999999999999983e-90 or -1.9999999999999999e-129 < b < 1.3e-106Initial program 83.0%
sqr-neg83.0%
sqr-neg83.0%
associate-*l*82.8%
Simplified82.8%
Taylor expanded in b around 0 73.7%
*-commutative73.7%
*-commutative73.7%
associate-*r*73.9%
Simplified73.9%
+-commutative73.9%
unsub-neg73.9%
Applied egg-rr73.9%
if -2.89999999999999983e-90 < b < -1.9999999999999999e-129Initial program 99.7%
sqr-neg99.7%
sqr-neg99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in b around -inf 99.5%
*-commutative99.5%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.0%
Applied egg-rr99.0%
associate-/r/98.7%
Simplified98.7%
*-commutative98.7%
clear-num99.0%
un-div-inv99.5%
div-inv99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 1.3e-106 < b Initial program 22.2%
sqr-neg22.2%
sqr-neg22.2%
associate-*l*22.1%
Simplified22.1%
Taylor expanded in b around inf 78.7%
*-commutative78.7%
Simplified78.7%
Final simplification80.6%
(FPCore (a b c)
:precision binary64
(if (<= b -1.5e+154)
(/ b (* a -1.5))
(if (<= b 2.4e-8)
(/ (- (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 <= -1.5e+154) {
tmp = b / (a * -1.5);
} else if (b <= 2.4e-8) {
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 <= (-1.5d+154)) then
tmp = b / (a * (-1.5d0))
else if (b <= 2.4d-8) 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 <= -1.5e+154) {
tmp = b / (a * -1.5);
} else if (b <= 2.4e-8) {
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 <= -1.5e+154: tmp = b / (a * -1.5) elif b <= 2.4e-8: 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 <= -1.5e+154) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 2.4e-8) 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 <= -1.5e+154) tmp = b / (a * -1.5); elseif (b <= 2.4e-8) 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, -1.5e+154], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.4e-8], 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 -1.5 \cdot 10^{+154}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;\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 < -1.50000000000000013e154Initial program 29.7%
sqr-neg29.7%
sqr-neg29.7%
associate-*l*29.7%
Simplified29.7%
Taylor expanded in b around -inf 95.0%
*-commutative95.0%
Simplified95.0%
*-commutative95.0%
clear-num95.1%
un-div-inv95.2%
Applied egg-rr95.2%
associate-/r/95.2%
Simplified95.2%
*-commutative95.2%
clear-num95.0%
un-div-inv95.1%
div-inv95.3%
metadata-eval95.3%
Applied egg-rr95.3%
if -1.50000000000000013e154 < b < 2.39999999999999998e-8Initial program 80.7%
sqr-neg80.7%
sqr-neg80.7%
associate-*l*80.6%
Simplified80.6%
if 2.39999999999999998e-8 < b Initial program 14.8%
sqr-neg14.8%
sqr-neg14.8%
associate-*l*14.7%
Simplified14.7%
Taylor expanded in b around inf 88.0%
*-commutative88.0%
Simplified88.0%
Final simplification85.2%
(FPCore (a b c)
:precision binary64
(if (<= b -9.2e-134)
(/ (/ b (- a)) 1.5)
(if (<= b 1.55e-108)
(* 0.3333333333333333 (/ (+ b (sqrt (* c (* a -3.0)))) a))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -9.2e-134) {
tmp = (b / -a) / 1.5;
} else if (b <= 1.55e-108) {
tmp = 0.3333333333333333 * ((b + sqrt((c * (a * -3.0)))) / 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 <= (-9.2d-134)) then
tmp = (b / -a) / 1.5d0
else if (b <= 1.55d-108) then
tmp = 0.3333333333333333d0 * ((b + sqrt((c * (a * (-3.0d0))))) / 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 <= -9.2e-134) {
tmp = (b / -a) / 1.5;
} else if (b <= 1.55e-108) {
tmp = 0.3333333333333333 * ((b + Math.sqrt((c * (a * -3.0)))) / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -9.2e-134: tmp = (b / -a) / 1.5 elif b <= 1.55e-108: tmp = 0.3333333333333333 * ((b + math.sqrt((c * (a * -3.0)))) / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -9.2e-134) tmp = Float64(Float64(b / Float64(-a)) / 1.5); elseif (b <= 1.55e-108) tmp = Float64(0.3333333333333333 * Float64(Float64(b + sqrt(Float64(c * Float64(a * -3.0)))) / 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 <= -9.2e-134) tmp = (b / -a) / 1.5; elseif (b <= 1.55e-108) tmp = 0.3333333333333333 * ((b + sqrt((c * (a * -3.0)))) / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -9.2e-134], N[(N[(b / (-a)), $MachinePrecision] / 1.5), $MachinePrecision], If[LessEqual[b, 1.55e-108], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.2 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{b}{-a}}{1.5}\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{-108}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -9.2000000000000001e-134Initial program 67.7%
sqr-neg67.7%
sqr-neg67.7%
associate-*l*67.6%
Simplified67.6%
Taylor expanded in b around -inf 79.5%
*-commutative79.5%
Simplified79.5%
*-commutative79.5%
clear-num79.4%
un-div-inv79.5%
Applied egg-rr79.5%
associate-/r/79.5%
Simplified79.5%
associate-/r/79.5%
metadata-eval79.5%
associate-/r*79.6%
*-commutative79.6%
associate-*l/79.5%
Applied egg-rr79.5%
*-commutative79.5%
associate-/l*79.6%
metadata-eval79.6%
distribute-lft-neg-in79.6%
*-commutative79.6%
distribute-frac-neg279.6%
associate-/r*79.5%
distribute-neg-frac79.5%
distribute-frac-neg279.5%
distribute-frac-neg279.5%
associate-/r/79.6%
distribute-rgt-neg-in79.6%
associate-*l/79.7%
*-lft-identity79.7%
distribute-frac-neg279.7%
Simplified79.7%
if -9.2000000000000001e-134 < b < 1.55000000000000007e-108Initial program 78.8%
sqr-neg78.8%
sqr-neg78.8%
associate-*l*78.6%
Simplified78.6%
Taylor expanded in b around 0 76.8%
*-commutative76.8%
*-commutative76.8%
associate-*r*77.0%
Simplified77.0%
*-un-lft-identity77.0%
times-frac76.9%
metadata-eval76.9%
add-sqr-sqrt36.7%
sqrt-unprod76.4%
sqr-neg76.4%
sqrt-unprod40.3%
add-sqr-sqrt75.9%
Applied egg-rr75.9%
if 1.55000000000000007e-108 < b Initial program 22.2%
sqr-neg22.2%
sqr-neg22.2%
associate-*l*22.1%
Simplified22.1%
Taylor expanded in b around inf 78.7%
*-commutative78.7%
Simplified78.7%
Final simplification78.6%
(FPCore (a b c) :precision binary64 (if (<= b 4.4e-254) (/ (/ b (- a)) 1.5) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 4.4e-254) {
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 <= 4.4d-254) 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 <= 4.4e-254) {
tmp = (b / -a) / 1.5;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 4.4e-254: tmp = (b / -a) / 1.5 else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 4.4e-254) tmp = Float64(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 <= 4.4e-254) tmp = (b / -a) / 1.5; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 4.4e-254], N[(N[(b / (-a)), $MachinePrecision] / 1.5), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.4 \cdot 10^{-254}:\\
\;\;\;\;\frac{\frac{b}{-a}}{1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 4.4000000000000002e-254Initial program 70.5%
sqr-neg70.5%
sqr-neg70.5%
associate-*l*70.4%
Simplified70.4%
Taylor expanded in b around -inf 66.7%
*-commutative66.7%
Simplified66.7%
*-commutative66.7%
clear-num66.6%
un-div-inv66.7%
Applied egg-rr66.7%
associate-/r/66.7%
Simplified66.7%
associate-/r/66.7%
metadata-eval66.7%
associate-/r*66.7%
*-commutative66.7%
associate-*l/66.7%
Applied egg-rr66.7%
*-commutative66.7%
associate-/l*66.7%
metadata-eval66.7%
distribute-lft-neg-in66.7%
*-commutative66.7%
distribute-frac-neg266.7%
associate-/r*66.7%
distribute-neg-frac66.7%
distribute-frac-neg266.7%
distribute-frac-neg266.7%
associate-/r/66.8%
distribute-rgt-neg-in66.8%
associate-*l/66.8%
*-lft-identity66.8%
distribute-frac-neg266.8%
Simplified66.8%
if 4.4000000000000002e-254 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.2%
Simplified30.2%
Taylor expanded in b around inf 69.4%
*-commutative69.4%
Simplified69.4%
Final simplification67.9%
(FPCore (a b c) :precision binary64 (if (<= b 7200000.0) (* b (/ -0.6666666666666666 a)) (* (/ c b) 0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 7200000.0) {
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 <= 7200000.0d0) 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 <= 7200000.0) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = (c / b) * 0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 7200000.0: tmp = b * (-0.6666666666666666 / a) else: tmp = (c / b) * 0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 7200000.0) 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 <= 7200000.0) tmp = b * (-0.6666666666666666 / a); else tmp = (c / b) * 0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 7200000.0], 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 7200000:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5\\
\end{array}
\end{array}
if b < 7.2e6Initial program 68.0%
sqr-neg68.0%
sqr-neg68.0%
associate-*l*68.0%
Simplified68.0%
Taylor expanded in b around -inf 53.2%
*-commutative53.2%
Simplified53.2%
*-commutative53.2%
clear-num53.2%
un-div-inv53.2%
Applied egg-rr53.2%
associate-/r/53.2%
Simplified53.2%
if 7.2e6 < b Initial program 15.1%
sqr-neg15.1%
sqr-neg15.1%
associate-*l*15.1%
Simplified15.1%
*-un-lft-identity15.1%
times-frac15.1%
metadata-eval15.1%
add-sqr-sqrt0.0%
sqrt-unprod8.8%
sqr-neg8.8%
sqrt-prod8.8%
add-sqr-sqrt8.8%
fma-neg8.8%
associate-*r*8.8%
*-commutative8.8%
distribute-rgt-neg-in8.8%
*-commutative8.8%
distribute-rgt-neg-in8.8%
metadata-eval8.8%
Applied egg-rr8.8%
Taylor expanded in b around -inf 23.0%
Final simplification44.5%
(FPCore (a b c) :precision binary64 (if (<= b 4.4e-254) (* b (/ -0.6666666666666666 a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 4.4e-254) {
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 <= 4.4d-254) 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 <= 4.4e-254) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 4.4e-254: tmp = b * (-0.6666666666666666 / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 4.4e-254) 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 <= 4.4e-254) tmp = b * (-0.6666666666666666 / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 4.4e-254], 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 4.4 \cdot 10^{-254}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 4.4000000000000002e-254Initial program 70.5%
sqr-neg70.5%
sqr-neg70.5%
associate-*l*70.4%
Simplified70.4%
Taylor expanded in b around -inf 66.7%
*-commutative66.7%
Simplified66.7%
*-commutative66.7%
clear-num66.6%
un-div-inv66.7%
Applied egg-rr66.7%
associate-/r/66.7%
Simplified66.7%
if 4.4000000000000002e-254 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.2%
Simplified30.2%
Taylor expanded in b around inf 69.4%
*-commutative69.4%
Simplified69.4%
Final simplification67.9%
(FPCore (a b c) :precision binary64 (if (<= b 4.4e-254) (/ -0.6666666666666666 (/ a b)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 4.4e-254) {
tmp = -0.6666666666666666 / (a / b);
} 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.4d-254) then
tmp = (-0.6666666666666666d0) / (a / b)
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.4e-254) {
tmp = -0.6666666666666666 / (a / b);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 4.4e-254: tmp = -0.6666666666666666 / (a / b) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 4.4e-254) tmp = Float64(-0.6666666666666666 / Float64(a / b)); 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.4e-254) tmp = -0.6666666666666666 / (a / b); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 4.4e-254], N[(-0.6666666666666666 / N[(a / b), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.4 \cdot 10^{-254}:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 4.4000000000000002e-254Initial program 70.5%
sqr-neg70.5%
sqr-neg70.5%
associate-*l*70.4%
Simplified70.4%
Taylor expanded in b around -inf 66.7%
*-commutative66.7%
Simplified66.7%
*-commutative66.7%
clear-num66.6%
un-div-inv66.7%
Applied egg-rr66.7%
if 4.4000000000000002e-254 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.2%
Simplified30.2%
Taylor expanded in b around inf 69.4%
*-commutative69.4%
Simplified69.4%
Final simplification67.9%
(FPCore (a b c) :precision binary64 (if (<= b 4.4e-254) (/ b (* a -1.5)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 4.4e-254) {
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 <= 4.4d-254) 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 <= 4.4e-254) {
tmp = b / (a * -1.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 4.4e-254: tmp = b / (a * -1.5) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 4.4e-254) 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 <= 4.4e-254) tmp = b / (a * -1.5); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 4.4e-254], 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 4.4 \cdot 10^{-254}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 4.4000000000000002e-254Initial program 70.5%
sqr-neg70.5%
sqr-neg70.5%
associate-*l*70.4%
Simplified70.4%
Taylor expanded in b around -inf 66.7%
*-commutative66.7%
Simplified66.7%
*-commutative66.7%
clear-num66.6%
un-div-inv66.7%
Applied egg-rr66.7%
associate-/r/66.7%
Simplified66.7%
*-commutative66.7%
clear-num66.6%
un-div-inv66.7%
div-inv66.8%
metadata-eval66.8%
Applied egg-rr66.8%
if 4.4000000000000002e-254 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.2%
Simplified30.2%
Taylor expanded in b around inf 69.4%
*-commutative69.4%
Simplified69.4%
Final simplification67.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 52.7%
sqr-neg52.7%
sqr-neg52.7%
associate-*l*52.7%
Simplified52.7%
*-un-lft-identity52.7%
times-frac52.6%
metadata-eval52.6%
add-sqr-sqrt37.3%
sqrt-unprod49.7%
sqr-neg49.7%
sqrt-prod12.5%
add-sqr-sqrt29.3%
fma-neg29.3%
associate-*r*29.4%
*-commutative29.4%
distribute-rgt-neg-in29.4%
*-commutative29.4%
distribute-rgt-neg-in29.4%
metadata-eval29.4%
Applied egg-rr29.4%
Taylor expanded in b around -inf 9.0%
Final simplification9.0%
herbie shell --seed 2024072
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))