
(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 -7e+152)
(* (/ b a) -0.6666666666666666)
(if (<= b 9.8e-108)
(/ (- (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+152) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 9.8e-108) {
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+152)) then
tmp = (b / a) * (-0.6666666666666666d0)
else if (b <= 9.8d-108) 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+152) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 9.8e-108) {
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+152: tmp = (b / a) * -0.6666666666666666 elif b <= 9.8e-108: 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+152) tmp = Float64(Float64(b / a) * -0.6666666666666666); elseif (b <= 9.8e-108) 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+152) tmp = (b / a) * -0.6666666666666666; elseif (b <= 9.8e-108) 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+152], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 9.8e-108], 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^{+152}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 9.8 \cdot 10^{-108}:\\
\;\;\;\;\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.99999999999999963e152Initial program 43.4%
Taylor expanded in b around -inf 97.7%
*-commutative97.7%
Simplified97.7%
if -6.99999999999999963e152 < b < 9.7999999999999996e-108Initial program 84.5%
if 9.7999999999999996e-108 < b Initial program 22.9%
Taylor expanded in b around inf 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification86.7%
(FPCore (a b c)
:precision binary64
(if (<= b -4.4e-63)
(* b (- (* 0.6666666666666666 (/ -1.0 a)) (* -0.5 (/ c (pow b 2.0)))))
(if (<= b 9.2e-108)
(/ (/ (- (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.4e-63) {
tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / pow(b, 2.0))));
} else if (b <= 9.2e-108) {
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.4d-63)) then
tmp = b * ((0.6666666666666666d0 * ((-1.0d0) / a)) - ((-0.5d0) * (c / (b ** 2.0d0))))
else if (b <= 9.2d-108) 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.4e-63) {
tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / Math.pow(b, 2.0))));
} else if (b <= 9.2e-108) {
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.4e-63: tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / math.pow(b, 2.0)))) elif b <= 9.2e-108: 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.4e-63) tmp = Float64(b * Float64(Float64(0.6666666666666666 * Float64(-1.0 / a)) - Float64(-0.5 * Float64(c / (b ^ 2.0))))); elseif (b <= 9.2e-108) tmp = Float64(Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) / 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.4e-63) tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / (b ^ 2.0)))); elseif (b <= 9.2e-108) 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.4e-63], N[(b * N[(N[(0.6666666666666666 * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * N[(c / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.2e-108], N[(N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] / 3.0), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{-63}:\\
\;\;\;\;b \cdot \left(0.6666666666666666 \cdot \frac{-1}{a} - -0.5 \cdot \frac{c}{{b}^{2}}\right)\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{-108}:\\
\;\;\;\;\frac{\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a}}{3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4.3999999999999999e-63Initial program 69.9%
Taylor expanded in b around -inf 84.8%
if -4.3999999999999999e-63 < b < 9.19999999999999983e-108Initial program 78.4%
Taylor expanded in b around 0 75.6%
+-commutative75.6%
unsub-neg75.6%
*-commutative75.6%
associate-*r*75.6%
Applied egg-rr75.6%
*-commutative75.6%
associate-*l*75.6%
*-commutative75.6%
Simplified75.6%
*-commutative75.6%
associate-/r*75.7%
*-commutative75.7%
associate-*r*75.6%
*-commutative75.6%
Applied egg-rr75.6%
if 9.19999999999999983e-108 < b Initial program 22.9%
Taylor expanded in b around inf 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification82.2%
(FPCore (a b c)
:precision binary64
(if (<= b -2.25e-69)
(/ b (* a -1.5))
(if (<= b 9.8e-108)
(/ (/ (- (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 <= -2.25e-69) {
tmp = b / (a * -1.5);
} else if (b <= 9.8e-108) {
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 <= (-2.25d-69)) then
tmp = b / (a * (-1.5d0))
else if (b <= 9.8d-108) 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 <= -2.25e-69) {
tmp = b / (a * -1.5);
} else if (b <= 9.8e-108) {
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 <= -2.25e-69: tmp = b / (a * -1.5) elif b <= 9.8e-108: 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 <= -2.25e-69) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 9.8e-108) tmp = Float64(Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) / 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.25e-69) tmp = b / (a * -1.5); elseif (b <= 9.8e-108) 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, -2.25e-69], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.8e-108], N[(N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] / 3.0), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.25 \cdot 10^{-69}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 9.8 \cdot 10^{-108}:\\
\;\;\;\;\frac{\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a}}{3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -2.25000000000000005e-69Initial program 69.2%
Taylor expanded in b around -inf 83.5%
*-commutative83.5%
Simplified83.5%
associate-*l/83.4%
*-un-lft-identity83.4%
times-frac83.5%
Applied egg-rr83.5%
/-rgt-identity83.5%
clear-num83.4%
un-div-inv83.5%
div-inv83.6%
metadata-eval83.6%
Applied egg-rr83.6%
if -2.25000000000000005e-69 < b < 9.7999999999999996e-108Initial program 79.6%
Taylor expanded in b around 0 76.7%
+-commutative76.7%
unsub-neg76.7%
*-commutative76.7%
associate-*r*76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-*l*76.7%
*-commutative76.7%
Simplified76.7%
*-commutative76.7%
associate-/r*76.8%
*-commutative76.8%
associate-*r*76.7%
*-commutative76.7%
Applied egg-rr76.7%
if 9.7999999999999996e-108 < b Initial program 22.9%
Taylor expanded in b around inf 84.2%
*-commutative84.2%
Simplified84.2%
(FPCore (a b c)
:precision binary64
(if (<= b -1.7e-79)
(/ b (* a -1.5))
(if (<= b 1.85e-108)
(/ (- (sqrt (* -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.7e-79) {
tmp = b / (a * -1.5);
} else if (b <= 1.85e-108) {
tmp = (sqrt((-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.7d-79)) then
tmp = b / (a * (-1.5d0))
else if (b <= 1.85d-108) then
tmp = (sqrt(((-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.7e-79) {
tmp = b / (a * -1.5);
} else if (b <= 1.85e-108) {
tmp = (Math.sqrt((-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.7e-79: tmp = b / (a * -1.5) elif b <= 1.85e-108: tmp = (math.sqrt((-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.7e-79) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 1.85e-108) tmp = Float64(Float64(sqrt(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.7e-79) tmp = b / (a * -1.5); elseif (b <= 1.85e-108) tmp = (sqrt((-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.7e-79], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e-108], N[(N[(N[Sqrt[N[(-3.0 * N[(a * 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 -1.7 \cdot 10^{-79}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-108}:\\
\;\;\;\;\frac{\sqrt{-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.69999999999999988e-79Initial program 69.2%
Taylor expanded in b around -inf 83.5%
*-commutative83.5%
Simplified83.5%
associate-*l/83.4%
*-un-lft-identity83.4%
times-frac83.5%
Applied egg-rr83.5%
/-rgt-identity83.5%
clear-num83.4%
un-div-inv83.5%
div-inv83.6%
metadata-eval83.6%
Applied egg-rr83.6%
if -1.69999999999999988e-79 < b < 1.85e-108Initial program 79.6%
Taylor expanded in b around 0 76.7%
+-commutative76.7%
unsub-neg76.7%
*-commutative76.7%
associate-*r*76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-*l*76.7%
*-commutative76.7%
Simplified76.7%
*-un-lft-identity76.7%
*-commutative76.7%
associate-*r*76.7%
*-commutative76.7%
Applied egg-rr76.7%
*-lft-identity76.7%
associate-*r*76.7%
Simplified76.7%
if 1.85e-108 < b Initial program 22.9%
Taylor expanded in b around inf 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification82.1%
(FPCore (a b c)
:precision binary64
(if (<= b -7.5e-69)
(/ b (* a -1.5))
(if (<= b 9.8e-108)
(/ (- (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 <= -7.5e-69) {
tmp = b / (a * -1.5);
} else if (b <= 9.8e-108) {
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 <= (-7.5d-69)) then
tmp = b / (a * (-1.5d0))
else if (b <= 9.8d-108) 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 <= -7.5e-69) {
tmp = b / (a * -1.5);
} else if (b <= 9.8e-108) {
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 <= -7.5e-69: tmp = b / (a * -1.5) elif b <= 9.8e-108: 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 <= -7.5e-69) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 9.8e-108) 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 <= -7.5e-69) tmp = b / (a * -1.5); elseif (b <= 9.8e-108) 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, -7.5e-69], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.8e-108], 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 -7.5 \cdot 10^{-69}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 9.8 \cdot 10^{-108}:\\
\;\;\;\;\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 < -7.5e-69Initial program 69.2%
Taylor expanded in b around -inf 83.5%
*-commutative83.5%
Simplified83.5%
associate-*l/83.4%
*-un-lft-identity83.4%
times-frac83.5%
Applied egg-rr83.5%
/-rgt-identity83.5%
clear-num83.4%
un-div-inv83.5%
div-inv83.6%
metadata-eval83.6%
Applied egg-rr83.6%
if -7.5e-69 < b < 9.7999999999999996e-108Initial program 79.6%
Taylor expanded in b around 0 76.7%
+-commutative76.7%
unsub-neg76.7%
*-commutative76.7%
associate-*r*76.7%
Applied egg-rr76.7%
if 9.7999999999999996e-108 < b Initial program 22.9%
Taylor expanded in b around inf 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification82.1%
(FPCore (a b c)
:precision binary64
(if (<= b -1.35e-68)
(/ b (* a -1.5))
(if (<= b 6.1e-108)
(/ (* (- (sqrt (* -3.0 (* a c))) b) 0.3333333333333333) a)
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.35e-68) {
tmp = b / (a * -1.5);
} else if (b <= 6.1e-108) {
tmp = ((sqrt((-3.0 * (a * c))) - b) * 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.35d-68)) then
tmp = b / (a * (-1.5d0))
else if (b <= 6.1d-108) then
tmp = ((sqrt(((-3.0d0) * (a * c))) - b) * 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.35e-68) {
tmp = b / (a * -1.5);
} else if (b <= 6.1e-108) {
tmp = ((Math.sqrt((-3.0 * (a * c))) - b) * 0.3333333333333333) / a;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.35e-68: tmp = b / (a * -1.5) elif b <= 6.1e-108: tmp = ((math.sqrt((-3.0 * (a * c))) - b) * 0.3333333333333333) / a else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.35e-68) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 6.1e-108) tmp = Float64(Float64(Float64(sqrt(Float64(-3.0 * Float64(a * c))) - b) * 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.35e-68) tmp = b / (a * -1.5); elseif (b <= 6.1e-108) tmp = ((sqrt((-3.0 * (a * c))) - b) * 0.3333333333333333) / a; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.35e-68], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.1e-108], N[(N[(N[(N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $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.35 \cdot 10^{-68}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 6.1 \cdot 10^{-108}:\\
\;\;\;\;\frac{\left(\sqrt{-3 \cdot \left(a \cdot c\right)} - b\right) \cdot 0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -1.3500000000000001e-68Initial program 69.2%
Taylor expanded in b around -inf 83.5%
*-commutative83.5%
Simplified83.5%
associate-*l/83.4%
*-un-lft-identity83.4%
times-frac83.5%
Applied egg-rr83.5%
/-rgt-identity83.5%
clear-num83.4%
un-div-inv83.5%
div-inv83.6%
metadata-eval83.6%
Applied egg-rr83.6%
if -1.3500000000000001e-68 < b < 6.10000000000000007e-108Initial program 79.6%
Taylor expanded in b around 0 76.7%
+-commutative76.7%
unsub-neg76.7%
*-commutative76.7%
associate-*r*76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-*l*76.7%
*-commutative76.7%
Simplified76.7%
associate-/r*76.7%
div-inv76.6%
*-commutative76.6%
associate-*r*76.7%
*-commutative76.7%
metadata-eval76.7%
Applied egg-rr76.7%
associate-*r*76.7%
Applied egg-rr76.7%
if 6.10000000000000007e-108 < b Initial program 22.9%
Taylor expanded in b around inf 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification82.1%
(FPCore (a b c)
:precision binary64
(if (<= b -1.85e-72)
(/ b (* a -1.5))
(if (<= b 9.8e-108)
(/ (* (- (sqrt (* a (* c -3.0))) b) 0.3333333333333333) a)
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.85e-72) {
tmp = b / (a * -1.5);
} else if (b <= 9.8e-108) {
tmp = ((sqrt((a * (c * -3.0))) - b) * 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.85d-72)) then
tmp = b / (a * (-1.5d0))
else if (b <= 9.8d-108) then
tmp = ((sqrt((a * (c * (-3.0d0)))) - b) * 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.85e-72) {
tmp = b / (a * -1.5);
} else if (b <= 9.8e-108) {
tmp = ((Math.sqrt((a * (c * -3.0))) - b) * 0.3333333333333333) / a;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.85e-72: tmp = b / (a * -1.5) elif b <= 9.8e-108: tmp = ((math.sqrt((a * (c * -3.0))) - b) * 0.3333333333333333) / a else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.85e-72) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 9.8e-108) tmp = Float64(Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) * 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.85e-72) tmp = b / (a * -1.5); elseif (b <= 9.8e-108) tmp = ((sqrt((a * (c * -3.0))) - b) * 0.3333333333333333) / a; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.85e-72], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.8e-108], N[(N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $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.85 \cdot 10^{-72}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 9.8 \cdot 10^{-108}:\\
\;\;\;\;\frac{\left(\sqrt{a \cdot \left(c \cdot -3\right)} - b\right) \cdot 0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -1.8499999999999999e-72Initial program 69.2%
Taylor expanded in b around -inf 83.5%
*-commutative83.5%
Simplified83.5%
associate-*l/83.4%
*-un-lft-identity83.4%
times-frac83.5%
Applied egg-rr83.5%
/-rgt-identity83.5%
clear-num83.4%
un-div-inv83.5%
div-inv83.6%
metadata-eval83.6%
Applied egg-rr83.6%
if -1.8499999999999999e-72 < b < 9.7999999999999996e-108Initial program 79.6%
Taylor expanded in b around 0 76.7%
+-commutative76.7%
unsub-neg76.7%
*-commutative76.7%
associate-*r*76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-*l*76.7%
*-commutative76.7%
Simplified76.7%
associate-/r*76.7%
div-inv76.6%
*-commutative76.6%
associate-*r*76.7%
*-commutative76.7%
metadata-eval76.7%
Applied egg-rr76.7%
if 9.7999999999999996e-108 < b Initial program 22.9%
Taylor expanded in b around inf 84.2%
*-commutative84.2%
Simplified84.2%
(FPCore (a b c)
:precision binary64
(if (<= b -6.6e-72)
(/ b (* a -1.5))
(if (<= b 9.5e-108)
(* 0.3333333333333333 (/ (- (sqrt (* c (* a -3.0))) b) a))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -6.6e-72) {
tmp = b / (a * -1.5);
} else if (b <= 9.5e-108) {
tmp = 0.3333333333333333 * ((sqrt((c * (a * -3.0))) - b) / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-6.6d-72)) then
tmp = b / (a * (-1.5d0))
else if (b <= 9.5d-108) then
tmp = 0.3333333333333333d0 * ((sqrt((c * (a * (-3.0d0)))) - b) / a)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -6.6e-72) {
tmp = b / (a * -1.5);
} else if (b <= 9.5e-108) {
tmp = 0.3333333333333333 * ((Math.sqrt((c * (a * -3.0))) - b) / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -6.6e-72: tmp = b / (a * -1.5) elif b <= 9.5e-108: tmp = 0.3333333333333333 * ((math.sqrt((c * (a * -3.0))) - b) / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -6.6e-72) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 9.5e-108) tmp = Float64(0.3333333333333333 * Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -6.6e-72) tmp = b / (a * -1.5); elseif (b <= 9.5e-108) tmp = 0.3333333333333333 * ((sqrt((c * (a * -3.0))) - b) / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -6.6e-72], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.5e-108], N[(0.3333333333333333 * N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{-72}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{-108}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -6.6e-72Initial program 69.2%
Taylor expanded in b around -inf 83.5%
*-commutative83.5%
Simplified83.5%
associate-*l/83.4%
*-un-lft-identity83.4%
times-frac83.5%
Applied egg-rr83.5%
/-rgt-identity83.5%
clear-num83.4%
un-div-inv83.5%
div-inv83.6%
metadata-eval83.6%
Applied egg-rr83.6%
if -6.6e-72 < b < 9.5000000000000005e-108Initial program 79.6%
Taylor expanded in b around 0 76.7%
+-commutative76.7%
unsub-neg76.7%
*-commutative76.7%
associate-*r*76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-*l*76.7%
*-commutative76.7%
Simplified76.7%
associate-/r*76.7%
div-inv76.6%
*-commutative76.6%
associate-*r*76.7%
*-commutative76.7%
metadata-eval76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-/l*76.6%
*-commutative76.6%
associate-*l*76.5%
Applied egg-rr76.5%
*-commutative76.5%
Simplified76.5%
if 9.5000000000000005e-108 < b Initial program 22.9%
Taylor expanded in b around inf 84.2%
*-commutative84.2%
Simplified84.2%
(FPCore (a b c) :precision binary64 (if (<= b 8.2e-306) (/ b (* a -1.5)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 8.2e-306) {
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 <= 8.2d-306) 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 <= 8.2e-306) {
tmp = b / (a * -1.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 8.2e-306: tmp = b / (a * -1.5) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 8.2e-306) 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 <= 8.2e-306) tmp = b / (a * -1.5); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 8.2e-306], 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 8.2 \cdot 10^{-306}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 8.19999999999999969e-306Initial program 73.2%
Taylor expanded in b around -inf 61.7%
*-commutative61.7%
Simplified61.7%
associate-*l/61.7%
*-un-lft-identity61.7%
times-frac61.7%
Applied egg-rr61.7%
/-rgt-identity61.7%
clear-num61.7%
un-div-inv61.7%
div-inv61.8%
metadata-eval61.8%
Applied egg-rr61.8%
if 8.19999999999999969e-306 < b Initial program 34.4%
Taylor expanded in b around inf 67.1%
*-commutative67.1%
Simplified67.1%
(FPCore (a b c) :precision binary64 (if (<= b 1.5e-305) (* (/ b a) -0.6666666666666666) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.5e-305) {
tmp = (b / a) * -0.6666666666666666;
} 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-305) then
tmp = (b / a) * (-0.6666666666666666d0)
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-305) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.5e-305: tmp = (b / a) * -0.6666666666666666 else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.5e-305) tmp = Float64(Float64(b / a) * -0.6666666666666666); 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-305) tmp = (b / a) * -0.6666666666666666; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.5e-305], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.5 \cdot 10^{-305}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 1.5000000000000001e-305Initial program 73.2%
Taylor expanded in b around -inf 61.7%
*-commutative61.7%
Simplified61.7%
if 1.5000000000000001e-305 < b Initial program 34.4%
Taylor expanded in b around inf 67.1%
*-commutative67.1%
Simplified67.1%
(FPCore (a b c) :precision binary64 (if (<= b 3.8e-74) (* (/ b a) -0.6666666666666666) (* (/ c b) 0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.8e-74) {
tmp = (b / a) * -0.6666666666666666;
} 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 <= 3.8d-74) then
tmp = (b / a) * (-0.6666666666666666d0)
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 <= 3.8e-74) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = (c / b) * 0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.8e-74: tmp = (b / a) * -0.6666666666666666 else: tmp = (c / b) * 0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.8e-74) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(Float64(c / b) * 0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3.8e-74) tmp = (b / a) * -0.6666666666666666; else tmp = (c / b) * 0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.8e-74], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5\\
\end{array}
\end{array}
if b < 3.7999999999999996e-74Initial program 71.9%
Taylor expanded in b around -inf 50.5%
*-commutative50.5%
Simplified50.5%
if 3.7999999999999996e-74 < b Initial program 22.9%
Applied egg-rr12.2%
Taylor expanded in b around -inf 26.1%
Final simplification42.0%
(FPCore (a b c) :precision binary64 (if (<= b 3.8e-74) (* b (/ -0.6666666666666666 a)) (* (/ c b) 0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.8e-74) {
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 <= 3.8d-74) 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 <= 3.8e-74) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = (c / b) * 0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.8e-74: tmp = b * (-0.6666666666666666 / a) else: tmp = (c / b) * 0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.8e-74) 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 <= 3.8e-74) tmp = b * (-0.6666666666666666 / a); else tmp = (c / b) * 0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.8e-74], 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 3.8 \cdot 10^{-74}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5\\
\end{array}
\end{array}
if b < 3.7999999999999996e-74Initial program 71.9%
Taylor expanded in b around -inf 50.5%
*-commutative50.5%
Simplified50.5%
associate-*l/50.4%
*-un-lft-identity50.4%
times-frac50.4%
Applied egg-rr50.4%
/-rgt-identity50.4%
*-commutative50.4%
Applied egg-rr50.4%
if 3.7999999999999996e-74 < b Initial program 22.9%
Applied egg-rr12.2%
Taylor expanded in b around -inf 26.1%
Final simplification42.0%
(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 54.8%
Applied egg-rr35.2%
Taylor expanded in b around -inf 11.4%
Final simplification11.4%
herbie shell --seed 2024096
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))