
(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 16 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 (<= c 2.65e+234) (* (- b (hypot b (sqrt (fabs (* c (* a -3.0)))))) (/ (/ 1.0 a) -3.0)) (/ (/ (- b (hypot b (* (sqrt (* a -3.0)) (sqrt c)))) a) -3.0)))
double code(double a, double b, double c) {
double tmp;
if (c <= 2.65e+234) {
tmp = (b - hypot(b, sqrt(fabs((c * (a * -3.0)))))) * ((1.0 / a) / -3.0);
} else {
tmp = ((b - hypot(b, (sqrt((a * -3.0)) * sqrt(c)))) / a) / -3.0;
}
return tmp;
}
public static double code(double a, double b, double c) {
double tmp;
if (c <= 2.65e+234) {
tmp = (b - Math.hypot(b, Math.sqrt(Math.abs((c * (a * -3.0)))))) * ((1.0 / a) / -3.0);
} else {
tmp = ((b - Math.hypot(b, (Math.sqrt((a * -3.0)) * Math.sqrt(c)))) / a) / -3.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if c <= 2.65e+234: tmp = (b - math.hypot(b, math.sqrt(math.fabs((c * (a * -3.0)))))) * ((1.0 / a) / -3.0) else: tmp = ((b - math.hypot(b, (math.sqrt((a * -3.0)) * math.sqrt(c)))) / a) / -3.0 return tmp
function code(a, b, c) tmp = 0.0 if (c <= 2.65e+234) tmp = Float64(Float64(b - hypot(b, sqrt(abs(Float64(c * Float64(a * -3.0)))))) * Float64(Float64(1.0 / a) / -3.0)); else tmp = Float64(Float64(Float64(b - hypot(b, Float64(sqrt(Float64(a * -3.0)) * sqrt(c)))) / a) / -3.0); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (c <= 2.65e+234) tmp = (b - hypot(b, sqrt(abs((c * (a * -3.0)))))) * ((1.0 / a) / -3.0); else tmp = ((b - hypot(b, (sqrt((a * -3.0)) * sqrt(c)))) / a) / -3.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[c, 2.65e+234], N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[Abs[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - N[Sqrt[b ^ 2 + N[(N[Sqrt[N[(a * -3.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[c], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 2.65 \cdot 10^{+234}:\\
\;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{\left|c \cdot \left(a \cdot -3\right)\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot -3} \cdot \sqrt{c}\right)}{a}}{-3}\\
\end{array}
\end{array}
if c < 2.64999999999999999e234Initial program 67.9%
sqr-neg67.9%
sqr-neg67.9%
associate-*l*67.8%
Simplified67.8%
Applied egg-rr64.6%
associate-/r*64.6%
Simplified64.6%
associate-*r*64.6%
*-commutative64.6%
add-sqr-sqrt64.6%
pow1/264.6%
pow1/264.6%
pow-prod-down77.9%
pow277.9%
*-commutative77.9%
associate-*r*77.9%
Applied egg-rr77.9%
unpow1/277.9%
unpow277.9%
rem-sqrt-square91.6%
associate-*r*91.6%
*-commutative91.6%
associate-*l*91.5%
Simplified91.5%
if 2.64999999999999999e234 < c Initial program 22.5%
sqr-neg22.5%
sqr-neg22.5%
associate-*l*22.5%
Simplified22.5%
Applied egg-rr22.3%
associate-/r*22.5%
Simplified22.5%
associate-*r/22.5%
Applied egg-rr22.5%
associate-*r/22.6%
*-rgt-identity22.6%
associate-*r*22.5%
*-commutative22.5%
associate-*l*22.5%
Simplified22.5%
Taylor expanded in c around 0 22.5%
pow1/223.1%
associate-*r*23.1%
unpow-prod-down89.5%
pow1/289.5%
Applied egg-rr89.5%
unpow1/289.5%
*-commutative89.5%
Simplified89.5%
Final simplification91.4%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (* 0.3333333333333333 (/ (sqrt (* c (* a -3.0))) a))))
(if (<= b -1.1e-19)
(/ (/ 2.0 a) (/ -3.0 b))
(if (<= b -3.2e-39)
t_0
(if (<= b -1.65e-99)
(/ (* b (/ 2.0 a)) -3.0)
(if (<= b 8.5e-88)
t_0
(/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0))))))))
double code(double a, double b, double c) {
double t_0 = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a);
double tmp;
if (b <= -1.1e-19) {
tmp = (2.0 / a) / (-3.0 / b);
} else if (b <= -3.2e-39) {
tmp = t_0;
} else if (b <= -1.65e-99) {
tmp = (b * (2.0 / a)) / -3.0;
} else if (b <= 8.5e-88) {
tmp = t_0;
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
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 = 0.3333333333333333d0 * (sqrt((c * (a * (-3.0d0)))) / a)
if (b <= (-1.1d-19)) then
tmp = (2.0d0 / a) / ((-3.0d0) / b)
else if (b <= (-3.2d-39)) then
tmp = t_0
else if (b <= (-1.65d-99)) then
tmp = (b * (2.0d0 / a)) / (-3.0d0)
else if (b <= 8.5d-88) then
tmp = t_0
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = 0.3333333333333333 * (Math.sqrt((c * (a * -3.0))) / a);
double tmp;
if (b <= -1.1e-19) {
tmp = (2.0 / a) / (-3.0 / b);
} else if (b <= -3.2e-39) {
tmp = t_0;
} else if (b <= -1.65e-99) {
tmp = (b * (2.0 / a)) / -3.0;
} else if (b <= 8.5e-88) {
tmp = t_0;
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): t_0 = 0.3333333333333333 * (math.sqrt((c * (a * -3.0))) / a) tmp = 0 if b <= -1.1e-19: tmp = (2.0 / a) / (-3.0 / b) elif b <= -3.2e-39: tmp = t_0 elif b <= -1.65e-99: tmp = (b * (2.0 / a)) / -3.0 elif b <= 8.5e-88: tmp = t_0 else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) t_0 = Float64(0.3333333333333333 * Float64(sqrt(Float64(c * Float64(a * -3.0))) / a)) tmp = 0.0 if (b <= -1.1e-19) tmp = Float64(Float64(2.0 / a) / Float64(-3.0 / b)); elseif (b <= -3.2e-39) tmp = t_0; elseif (b <= -1.65e-99) tmp = Float64(Float64(b * Float64(2.0 / a)) / -3.0); elseif (b <= 8.5e-88) tmp = t_0; else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) t_0 = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a); tmp = 0.0; if (b <= -1.1e-19) tmp = (2.0 / a) / (-3.0 / b); elseif (b <= -3.2e-39) tmp = t_0; elseif (b <= -1.65e-99) tmp = (b * (2.0 / a)) / -3.0; elseif (b <= 8.5e-88) tmp = t_0; else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.1e-19], N[(N[(2.0 / a), $MachinePrecision] / N[(-3.0 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.2e-39], t$95$0, If[LessEqual[b, -1.65e-99], N[(N[(b * N[(2.0 / a), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 8.5e-88], t$95$0, N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\
\mathbf{if}\;b \leq -1.1 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\
\mathbf{elif}\;b \leq -3.2 \cdot 10^{-39}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq -1.65 \cdot 10^{-99}:\\
\;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{-88}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -1.0999999999999999e-19Initial program 69.3%
sqr-neg69.3%
sqr-neg69.3%
associate-*l*69.3%
Simplified69.3%
Taylor expanded in b around -inf 89.6%
mul-1-neg89.6%
Simplified89.6%
count-289.6%
*-commutative89.6%
times-frac89.6%
add-sqr-sqrt89.3%
sqrt-unprod64.8%
sqr-neg64.8%
sqrt-unprod0.0%
add-sqr-sqrt1.0%
Applied egg-rr1.0%
associate-*l/1.0%
associate-/l*1.0%
Simplified1.0%
clear-num1.0%
un-div-inv1.0%
div-inv1.0%
clear-num1.0%
frac-2neg1.0%
metadata-eval1.0%
add-sqr-sqrt1.0%
sqrt-unprod0.9%
sqr-neg0.9%
sqrt-unprod0.0%
add-sqr-sqrt89.6%
Applied egg-rr89.6%
associate-/r*89.7%
Simplified89.7%
if -1.0999999999999999e-19 < b < -3.1999999999999998e-39 or -1.64999999999999993e-99 < b < 8.4999999999999996e-88Initial program 85.2%
sqr-neg85.2%
sqr-neg85.2%
associate-*l*85.0%
Simplified85.0%
Applied egg-rr82.4%
associate-/r*82.5%
Simplified82.5%
associate-*r*82.5%
*-commutative82.5%
add-sqr-sqrt82.5%
pow1/282.5%
pow1/282.5%
pow-prod-down58.6%
pow258.6%
*-commutative58.6%
associate-*r*58.6%
Applied egg-rr58.6%
unpow1/258.6%
unpow258.6%
rem-sqrt-square84.4%
associate-*r*84.4%
*-commutative84.4%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in b around 0 82.0%
associate-*l/82.0%
*-lft-identity82.0%
associate-*r*81.9%
*-commutative81.9%
*-commutative81.9%
rem-cube-cbrt81.2%
sqr-pow81.1%
fabs-sqr81.1%
sqr-pow81.0%
rem-cube-cbrt81.6%
*-commutative81.6%
Simplified81.6%
if -3.1999999999999998e-39 < b < -1.64999999999999993e-99Initial program 99.6%
sqr-neg99.6%
sqr-neg99.6%
associate-*l*99.5%
Simplified99.5%
Applied egg-rr74.4%
associate-/r*74.5%
Simplified74.5%
associate-*r/74.7%
Applied egg-rr74.7%
associate-*r/74.7%
*-rgt-identity74.7%
associate-*r*74.9%
*-commutative74.9%
associate-*l*74.9%
Simplified74.9%
Taylor expanded in b around -inf 76.7%
associate-*r/76.7%
associate-*l/76.7%
*-commutative76.7%
Simplified76.7%
if 8.4999999999999996e-88 < b Initial program 39.4%
sqr-neg39.4%
sqr-neg39.4%
associate-*l*39.4%
Simplified39.4%
Taylor expanded in b around inf 88.2%
associate-/l*88.2%
Simplified88.2%
Final simplification86.3%
(FPCore (a b c)
:precision binary64
(if (<= b -1.1e-19)
(/ (/ 2.0 a) (/ -3.0 b))
(if (<= b -4.4e-44)
(/ (- (sqrt (* -3.0 (* c a))) b) (* a 3.0))
(if (<= b -1.9e-103)
(/ (* b (/ 2.0 a)) -3.0)
(if (<= b 8.2e-88)
(* 0.3333333333333333 (/ (sqrt (* c (* a -3.0))) a))
(/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0)))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.1e-19) {
tmp = (2.0 / a) / (-3.0 / b);
} else if (b <= -4.4e-44) {
tmp = (sqrt((-3.0 * (c * a))) - b) / (a * 3.0);
} else if (b <= -1.9e-103) {
tmp = (b * (2.0 / a)) / -3.0;
} else if (b <= 8.2e-88) {
tmp = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
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.1d-19)) then
tmp = (2.0d0 / a) / ((-3.0d0) / b)
else if (b <= (-4.4d-44)) then
tmp = (sqrt(((-3.0d0) * (c * a))) - b) / (a * 3.0d0)
else if (b <= (-1.9d-103)) then
tmp = (b * (2.0d0 / a)) / (-3.0d0)
else if (b <= 8.2d-88) then
tmp = 0.3333333333333333d0 * (sqrt((c * (a * (-3.0d0)))) / a)
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.1e-19) {
tmp = (2.0 / a) / (-3.0 / b);
} else if (b <= -4.4e-44) {
tmp = (Math.sqrt((-3.0 * (c * a))) - b) / (a * 3.0);
} else if (b <= -1.9e-103) {
tmp = (b * (2.0 / a)) / -3.0;
} else if (b <= 8.2e-88) {
tmp = 0.3333333333333333 * (Math.sqrt((c * (a * -3.0))) / a);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.1e-19: tmp = (2.0 / a) / (-3.0 / b) elif b <= -4.4e-44: tmp = (math.sqrt((-3.0 * (c * a))) - b) / (a * 3.0) elif b <= -1.9e-103: tmp = (b * (2.0 / a)) / -3.0 elif b <= 8.2e-88: tmp = 0.3333333333333333 * (math.sqrt((c * (a * -3.0))) / a) else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.1e-19) tmp = Float64(Float64(2.0 / a) / Float64(-3.0 / b)); elseif (b <= -4.4e-44) tmp = Float64(Float64(sqrt(Float64(-3.0 * Float64(c * a))) - b) / Float64(a * 3.0)); elseif (b <= -1.9e-103) tmp = Float64(Float64(b * Float64(2.0 / a)) / -3.0); elseif (b <= 8.2e-88) tmp = Float64(0.3333333333333333 * Float64(sqrt(Float64(c * Float64(a * -3.0))) / a)); else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.1e-19) tmp = (2.0 / a) / (-3.0 / b); elseif (b <= -4.4e-44) tmp = (sqrt((-3.0 * (c * a))) - b) / (a * 3.0); elseif (b <= -1.9e-103) tmp = (b * (2.0 / a)) / -3.0; elseif (b <= 8.2e-88) tmp = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a); else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.1e-19], N[(N[(2.0 / a), $MachinePrecision] / N[(-3.0 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.4e-44], N[(N[(N[Sqrt[N[(-3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.9e-103], N[(N[(b * N[(2.0 / a), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 8.2e-88], N[(0.3333333333333333 * N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\
\mathbf{elif}\;b \leq -4.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sqrt{-3 \cdot \left(c \cdot a\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq -1.9 \cdot 10^{-103}:\\
\;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{-88}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -1.0999999999999999e-19Initial program 69.3%
sqr-neg69.3%
sqr-neg69.3%
associate-*l*69.3%
Simplified69.3%
Taylor expanded in b around -inf 89.6%
mul-1-neg89.6%
Simplified89.6%
count-289.6%
*-commutative89.6%
times-frac89.6%
add-sqr-sqrt89.3%
sqrt-unprod64.8%
sqr-neg64.8%
sqrt-unprod0.0%
add-sqr-sqrt1.0%
Applied egg-rr1.0%
associate-*l/1.0%
associate-/l*1.0%
Simplified1.0%
clear-num1.0%
un-div-inv1.0%
div-inv1.0%
clear-num1.0%
frac-2neg1.0%
metadata-eval1.0%
add-sqr-sqrt1.0%
sqrt-unprod0.9%
sqr-neg0.9%
sqrt-unprod0.0%
add-sqr-sqrt89.6%
Applied egg-rr89.6%
associate-/r*89.7%
Simplified89.7%
if -1.0999999999999999e-19 < b < -4.40000000000000024e-44Initial program 99.4%
sqr-neg99.4%
sqr-neg99.4%
associate-*l*99.4%
Simplified99.4%
Taylor expanded in b around 0 99.4%
if -4.40000000000000024e-44 < b < -1.9e-103Initial program 99.6%
sqr-neg99.6%
sqr-neg99.6%
associate-*l*99.5%
Simplified99.5%
Applied egg-rr74.4%
associate-/r*74.5%
Simplified74.5%
associate-*r/74.7%
Applied egg-rr74.7%
associate-*r/74.7%
*-rgt-identity74.7%
associate-*r*74.9%
*-commutative74.9%
associate-*l*74.9%
Simplified74.9%
Taylor expanded in b around -inf 76.7%
associate-*r/76.7%
associate-*l/76.7%
*-commutative76.7%
Simplified76.7%
if -1.9e-103 < b < 8.2000000000000002e-88Initial program 84.1%
sqr-neg84.1%
sqr-neg84.1%
associate-*l*83.9%
Simplified83.9%
Applied egg-rr81.1%
associate-/r*81.3%
Simplified81.3%
associate-*r*81.3%
*-commutative81.3%
add-sqr-sqrt81.3%
pow1/281.3%
pow1/281.3%
pow-prod-down59.9%
pow259.9%
*-commutative59.9%
associate-*r*59.8%
Applied egg-rr59.8%
unpow1/259.8%
unpow259.8%
rem-sqrt-square83.3%
associate-*r*83.3%
*-commutative83.3%
associate-*l*83.2%
Simplified83.2%
Taylor expanded in b around 0 80.7%
associate-*l/80.8%
*-lft-identity80.8%
associate-*r*80.7%
*-commutative80.7%
*-commutative80.7%
rem-cube-cbrt80.0%
sqr-pow79.9%
fabs-sqr79.9%
sqr-pow79.7%
rem-cube-cbrt80.4%
*-commutative80.4%
Simplified80.4%
if 8.2000000000000002e-88 < b Initial program 39.4%
sqr-neg39.4%
sqr-neg39.4%
associate-*l*39.4%
Simplified39.4%
Taylor expanded in b around inf 88.2%
associate-/l*88.2%
Simplified88.2%
Final simplification86.3%
(FPCore (a b c)
:precision binary64
(if (<= b -2.4e-19)
(/ (/ 2.0 a) (/ -3.0 b))
(if (<= b -1.4e-54)
(/ (- (sqrt (* a (* c -3.0))) b) (* a 3.0))
(if (<= b -8.2e-102)
(/ (* b (/ 2.0 a)) -3.0)
(if (<= b 8.5e-88)
(* 0.3333333333333333 (/ (sqrt (* c (* a -3.0))) a))
(/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0)))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.4e-19) {
tmp = (2.0 / a) / (-3.0 / b);
} else if (b <= -1.4e-54) {
tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0);
} else if (b <= -8.2e-102) {
tmp = (b * (2.0 / a)) / -3.0;
} else if (b <= 8.5e-88) {
tmp = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
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.4d-19)) then
tmp = (2.0d0 / a) / ((-3.0d0) / b)
else if (b <= (-1.4d-54)) then
tmp = (sqrt((a * (c * (-3.0d0)))) - b) / (a * 3.0d0)
else if (b <= (-8.2d-102)) then
tmp = (b * (2.0d0 / a)) / (-3.0d0)
else if (b <= 8.5d-88) then
tmp = 0.3333333333333333d0 * (sqrt((c * (a * (-3.0d0)))) / a)
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.4e-19) {
tmp = (2.0 / a) / (-3.0 / b);
} else if (b <= -1.4e-54) {
tmp = (Math.sqrt((a * (c * -3.0))) - b) / (a * 3.0);
} else if (b <= -8.2e-102) {
tmp = (b * (2.0 / a)) / -3.0;
} else if (b <= 8.5e-88) {
tmp = 0.3333333333333333 * (Math.sqrt((c * (a * -3.0))) / a);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.4e-19: tmp = (2.0 / a) / (-3.0 / b) elif b <= -1.4e-54: tmp = (math.sqrt((a * (c * -3.0))) - b) / (a * 3.0) elif b <= -8.2e-102: tmp = (b * (2.0 / a)) / -3.0 elif b <= 8.5e-88: tmp = 0.3333333333333333 * (math.sqrt((c * (a * -3.0))) / a) else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.4e-19) tmp = Float64(Float64(2.0 / a) / Float64(-3.0 / b)); elseif (b <= -1.4e-54) tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) / Float64(a * 3.0)); elseif (b <= -8.2e-102) tmp = Float64(Float64(b * Float64(2.0 / a)) / -3.0); elseif (b <= 8.5e-88) tmp = Float64(0.3333333333333333 * Float64(sqrt(Float64(c * Float64(a * -3.0))) / a)); else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.4e-19) tmp = (2.0 / a) / (-3.0 / b); elseif (b <= -1.4e-54) tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0); elseif (b <= -8.2e-102) tmp = (b * (2.0 / a)) / -3.0; elseif (b <= 8.5e-88) tmp = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a); else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.4e-19], N[(N[(2.0 / a), $MachinePrecision] / N[(-3.0 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.4e-54], N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8.2e-102], N[(N[(b * N[(2.0 / a), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 8.5e-88], N[(0.3333333333333333 * N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\
\mathbf{elif}\;b \leq -1.4 \cdot 10^{-54}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq -8.2 \cdot 10^{-102}:\\
\;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{-88}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -2.40000000000000023e-19Initial program 69.3%
sqr-neg69.3%
sqr-neg69.3%
associate-*l*69.3%
Simplified69.3%
Taylor expanded in b around -inf 89.6%
mul-1-neg89.6%
Simplified89.6%
count-289.6%
*-commutative89.6%
times-frac89.6%
add-sqr-sqrt89.3%
sqrt-unprod64.8%
sqr-neg64.8%
sqrt-unprod0.0%
add-sqr-sqrt1.0%
Applied egg-rr1.0%
associate-*l/1.0%
associate-/l*1.0%
Simplified1.0%
clear-num1.0%
un-div-inv1.0%
div-inv1.0%
clear-num1.0%
frac-2neg1.0%
metadata-eval1.0%
add-sqr-sqrt1.0%
sqrt-unprod0.9%
sqr-neg0.9%
sqrt-unprod0.0%
add-sqr-sqrt89.6%
Applied egg-rr89.6%
associate-/r*89.7%
Simplified89.7%
if -2.40000000000000023e-19 < b < -1.4000000000000001e-54Initial program 99.4%
sqr-neg99.4%
sqr-neg99.4%
associate-*l*99.4%
Simplified99.4%
Taylor expanded in b around 0 99.4%
*-commutative99.4%
associate-*r*99.7%
Simplified99.7%
if -1.4000000000000001e-54 < b < -8.2000000000000005e-102Initial program 99.6%
sqr-neg99.6%
sqr-neg99.6%
associate-*l*99.5%
Simplified99.5%
Applied egg-rr74.4%
associate-/r*74.5%
Simplified74.5%
associate-*r/74.7%
Applied egg-rr74.7%
associate-*r/74.7%
*-rgt-identity74.7%
associate-*r*74.9%
*-commutative74.9%
associate-*l*74.9%
Simplified74.9%
Taylor expanded in b around -inf 76.7%
associate-*r/76.7%
associate-*l/76.7%
*-commutative76.7%
Simplified76.7%
if -8.2000000000000005e-102 < b < 8.4999999999999996e-88Initial program 84.1%
sqr-neg84.1%
sqr-neg84.1%
associate-*l*83.9%
Simplified83.9%
Applied egg-rr81.1%
associate-/r*81.3%
Simplified81.3%
associate-*r*81.3%
*-commutative81.3%
add-sqr-sqrt81.3%
pow1/281.3%
pow1/281.3%
pow-prod-down59.9%
pow259.9%
*-commutative59.9%
associate-*r*59.8%
Applied egg-rr59.8%
unpow1/259.8%
unpow259.8%
rem-sqrt-square83.3%
associate-*r*83.3%
*-commutative83.3%
associate-*l*83.2%
Simplified83.2%
Taylor expanded in b around 0 80.7%
associate-*l/80.8%
*-lft-identity80.8%
associate-*r*80.7%
*-commutative80.7%
*-commutative80.7%
rem-cube-cbrt80.0%
sqr-pow79.9%
fabs-sqr79.9%
sqr-pow79.7%
rem-cube-cbrt80.4%
*-commutative80.4%
Simplified80.4%
if 8.4999999999999996e-88 < b Initial program 39.4%
sqr-neg39.4%
sqr-neg39.4%
associate-*l*39.4%
Simplified39.4%
Taylor expanded in b around inf 88.2%
associate-/l*88.2%
Simplified88.2%
Final simplification86.3%
(FPCore (a b c)
:precision binary64
(if (<= b -7.2e+72)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 8.6e+32)
(/ (- (sqrt (- (* b b) (* 3.0 (* c a)))) b) (* a 3.0))
(/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7.2e+72) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 8.6e+32) {
tmp = (sqrt(((b * b) - (3.0 * (c * a)))) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
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.2d+72)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 8.6d+32) then
tmp = (sqrt(((b * b) - (3.0d0 * (c * a)))) - b) / (a * 3.0d0)
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -7.2e+72) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 8.6e+32) {
tmp = (Math.sqrt(((b * b) - (3.0 * (c * a)))) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7.2e+72: tmp = ((b * 2.0) / a) / -3.0 elif b <= 8.6e+32: tmp = (math.sqrt(((b * b) - (3.0 * (c * a)))) - b) / (a * 3.0) else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -7.2e+72) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 8.6e+32) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(c * a)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -7.2e+72) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 8.6e+32) tmp = (sqrt(((b * b) - (3.0 * (c * a)))) - b) / (a * 3.0); else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7.2e+72], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 8.6e+32], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 8.6 \cdot 10^{+32}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -7.20000000000000069e72Initial program 58.1%
sqr-neg58.1%
sqr-neg58.1%
associate-*l*58.1%
Simplified58.1%
Applied egg-rr50.0%
associate-/r*50.1%
Simplified50.1%
associate-*r/50.1%
Applied egg-rr50.1%
associate-*r/50.2%
*-rgt-identity50.2%
associate-*r*50.2%
*-commutative50.2%
associate-*l*50.2%
Simplified50.2%
Taylor expanded in b around -inf 94.0%
associate-*r/94.0%
Simplified94.0%
if -7.20000000000000069e72 < b < 8.5999999999999994e32Initial program 87.8%
sqr-neg87.8%
sqr-neg87.8%
associate-*l*87.7%
Simplified87.7%
if 8.5999999999999994e32 < b Initial program 29.8%
sqr-neg29.8%
sqr-neg29.8%
associate-*l*29.8%
Simplified29.8%
Taylor expanded in b around inf 93.9%
associate-/l*93.9%
Simplified93.9%
Final simplification90.8%
(FPCore (a b c)
:precision binary64
(if (<= b -1.85e+72)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 8.6e+32)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.85e+72) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 8.6e+32) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
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 * 2.0d0) / a) / (-3.0d0)
else if (b <= 8.6d+32) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
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 * 2.0) / a) / -3.0;
} else if (b <= 8.6e+32) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.85e+72: tmp = ((b * 2.0) / a) / -3.0 elif b <= 8.6e+32: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.85e+72) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 8.6e+32) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.85e+72) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 8.6e+32) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.85e+72], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 8.6e+32], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.85 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 8.6 \cdot 10^{+32}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -1.8500000000000001e72Initial program 58.1%
sqr-neg58.1%
sqr-neg58.1%
associate-*l*58.1%
Simplified58.1%
Applied egg-rr50.0%
associate-/r*50.1%
Simplified50.1%
associate-*r/50.1%
Applied egg-rr50.1%
associate-*r/50.2%
*-rgt-identity50.2%
associate-*r*50.2%
*-commutative50.2%
associate-*l*50.2%
Simplified50.2%
Taylor expanded in b around -inf 94.0%
associate-*r/94.0%
Simplified94.0%
if -1.8500000000000001e72 < b < 8.5999999999999994e32Initial program 87.8%
if 8.5999999999999994e32 < b Initial program 29.8%
sqr-neg29.8%
sqr-neg29.8%
associate-*l*29.8%
Simplified29.8%
Taylor expanded in b around inf 93.9%
associate-/l*93.9%
Simplified93.9%
Final simplification90.9%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (/ (* b 2.0) a) -3.0) (/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = ((b * 2.0) / a) / -3.0;
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
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 * 2.0d0) / a) / (-3.0d0)
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = ((b * 2.0) / a) / -3.0;
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = ((b * 2.0) / a) / -3.0 else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = ((b * 2.0) / a) / -3.0; else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 77.4%
sqr-neg77.4%
sqr-neg77.4%
associate-*l*77.4%
Simplified77.4%
Applied egg-rr63.8%
associate-/r*63.8%
Simplified63.8%
associate-*r/63.8%
Applied egg-rr63.8%
associate-*r/63.9%
*-rgt-identity63.9%
associate-*r*64.0%
*-commutative64.0%
associate-*l*63.9%
Simplified63.9%
Taylor expanded in b around -inf 69.7%
associate-*r/69.7%
Simplified69.7%
if -4.999999999999985e-310 < b Initial program 53.8%
sqr-neg53.8%
sqr-neg53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in b around inf 62.9%
associate-/l*63.4%
Simplified63.4%
Final simplification66.7%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (- (- (* (/ c b) (* a 1.5)) b) b) (* a 3.0)) (/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = ((((c / b) * (a * 1.5)) - b) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
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 = ((((c / b) * (a * 1.5d0)) - b) - b) / (a * 3.0d0)
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = ((((c / b) * (a * 1.5)) - b) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = ((((c / b) * (a * 1.5)) - b) - b) / (a * 3.0) else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(Float64(Float64(Float64(c / b) * Float64(a * 1.5)) - b) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = ((((c / b) * (a * 1.5)) - b) - b) / (a * 3.0); else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(N[(N[(c / b), $MachinePrecision] * N[(a * 1.5), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\left(\frac{c}{b} \cdot \left(a \cdot 1.5\right) - b\right) - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 77.4%
sqr-neg77.4%
sqr-neg77.4%
associate-*l*77.4%
Simplified77.4%
Taylor expanded in b around -inf 66.6%
+-commutative66.6%
mul-1-neg66.6%
unsub-neg66.6%
associate-/l*69.7%
associate-*r*69.7%
Simplified69.7%
if -4.999999999999985e-310 < b Initial program 53.8%
sqr-neg53.8%
sqr-neg53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in b around inf 62.9%
associate-/l*63.4%
Simplified63.4%
Final simplification66.7%
(FPCore (a b c) :precision binary64 (if (<= b -2.2e-231) (+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.2e-231) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else {
tmp = 0.0;
}
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.2d-231)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.2e-231) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.2e-231: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.2e-231) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.2e-231) tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.2e-231], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{-231}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -2.20000000000000009e-231Initial program 75.8%
sqr-neg75.8%
sqr-neg75.8%
associate-*l*75.8%
Simplified75.8%
Taylor expanded in b around -inf 74.4%
if -2.20000000000000009e-231 < b Initial program 56.9%
sqr-neg56.9%
sqr-neg56.9%
associate-*l*56.8%
Simplified56.8%
Taylor expanded in b around -inf 2.7%
mul-1-neg2.7%
Simplified2.7%
expm1-log1p-u2.1%
expm1-undefine8.0%
associate-/r*8.0%
unsub-neg8.0%
add-sqr-sqrt7.7%
sqrt-unprod4.9%
sqr-neg4.9%
sqrt-unprod0.3%
add-sqr-sqrt58.3%
+-inverses58.3%
metadata-eval58.3%
Applied egg-rr58.3%
log1p-undefine58.3%
div058.3%
metadata-eval58.3%
metadata-eval58.3%
1-exp58.3%
metadata-eval58.3%
Simplified58.3%
Final simplification66.1%
(FPCore (a b c) :precision binary64 (if (<= b -2e-304) (/ (/ 2.0 a) (/ -3.0 b)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e-304) {
tmp = (2.0 / a) / (-3.0 / b);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-2d-304)) then
tmp = (2.0d0 / a) / ((-3.0d0) / b)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2e-304) {
tmp = (2.0 / a) / (-3.0 / b);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2e-304: tmp = (2.0 / a) / (-3.0 / b) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2e-304) tmp = Float64(Float64(2.0 / a) / Float64(-3.0 / b)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2e-304) tmp = (2.0 / a) / (-3.0 / b); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2e-304], N[(N[(2.0 / a), $MachinePrecision] / N[(-3.0 / b), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{-304}:\\
\;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -1.99999999999999994e-304Initial program 77.4%
sqr-neg77.4%
sqr-neg77.4%
associate-*l*77.4%
Simplified77.4%
Taylor expanded in b around -inf 69.6%
mul-1-neg69.6%
Simplified69.6%
count-269.6%
*-commutative69.6%
times-frac69.6%
add-sqr-sqrt69.3%
sqrt-unprod52.4%
sqr-neg52.4%
sqrt-unprod0.0%
add-sqr-sqrt1.5%
Applied egg-rr1.5%
associate-*l/1.5%
associate-/l*1.5%
Simplified1.5%
clear-num1.5%
un-div-inv1.5%
div-inv1.5%
clear-num1.5%
frac-2neg1.5%
metadata-eval1.5%
add-sqr-sqrt1.5%
sqrt-unprod1.4%
sqr-neg1.4%
sqrt-unprod0.0%
add-sqr-sqrt69.6%
Applied egg-rr69.6%
associate-/r*69.6%
Simplified69.6%
if -1.99999999999999994e-304 < b Initial program 53.8%
sqr-neg53.8%
sqr-neg53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in b around -inf 2.5%
mul-1-neg2.5%
Simplified2.5%
expm1-log1p-u1.9%
expm1-undefine8.2%
associate-/r*8.2%
unsub-neg8.2%
add-sqr-sqrt8.2%
sqrt-unprod4.9%
sqr-neg4.9%
sqrt-unprod0.0%
add-sqr-sqrt62.3%
+-inverses62.3%
metadata-eval62.3%
Applied egg-rr62.3%
log1p-undefine62.3%
div062.3%
metadata-eval62.3%
metadata-eval62.3%
1-exp62.3%
metadata-eval62.3%
Simplified62.3%
Final simplification66.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (/ (* b 2.0) a) -3.0) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = ((b * 2.0) / a) / -3.0;
} else {
tmp = 0.0;
}
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 * 2.0d0) / a) / (-3.0d0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = ((b * 2.0) / a) / -3.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = ((b * 2.0) / a) / -3.0 else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = ((b * 2.0) / a) / -3.0; else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 77.4%
sqr-neg77.4%
sqr-neg77.4%
associate-*l*77.4%
Simplified77.4%
Applied egg-rr63.8%
associate-/r*63.8%
Simplified63.8%
associate-*r/63.8%
Applied egg-rr63.8%
associate-*r/63.9%
*-rgt-identity63.9%
associate-*r*64.0%
*-commutative64.0%
associate-*l*63.9%
Simplified63.9%
Taylor expanded in b around -inf 69.7%
associate-*r/69.7%
Simplified69.7%
if -4.999999999999985e-310 < b Initial program 53.8%
sqr-neg53.8%
sqr-neg53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in b around -inf 2.5%
mul-1-neg2.5%
Simplified2.5%
expm1-log1p-u1.9%
expm1-undefine8.2%
associate-/r*8.2%
unsub-neg8.2%
add-sqr-sqrt8.2%
sqrt-unprod4.9%
sqr-neg4.9%
sqrt-unprod0.0%
add-sqr-sqrt62.3%
+-inverses62.3%
metadata-eval62.3%
Applied egg-rr62.3%
log1p-undefine62.3%
div062.3%
metadata-eval62.3%
metadata-eval62.3%
1-exp62.3%
metadata-eval62.3%
Simplified62.3%
Final simplification66.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* b (/ -0.6666666666666666 a)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = 0.0;
}
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 = 0.0d0
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 = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = 0.0; 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 = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 77.4%
sqr-neg77.4%
sqr-neg77.4%
associate-*l*77.4%
Simplified77.4%
Applied egg-rr63.8%
associate-/r*63.8%
Simplified63.8%
associate-*r*63.8%
*-commutative63.8%
add-sqr-sqrt63.8%
pow1/263.8%
pow1/263.9%
pow-prod-down76.1%
pow276.1%
*-commutative76.1%
associate-*r*76.1%
Applied egg-rr76.1%
unpow1/276.1%
unpow276.1%
rem-sqrt-square91.1%
associate-*r*91.1%
*-commutative91.1%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in b around -inf 69.5%
*-commutative69.5%
associate-*l/69.6%
associate-/l*69.5%
Simplified69.5%
if -4.999999999999985e-310 < b Initial program 53.8%
sqr-neg53.8%
sqr-neg53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in b around -inf 2.5%
mul-1-neg2.5%
Simplified2.5%
expm1-log1p-u1.9%
expm1-undefine8.2%
associate-/r*8.2%
unsub-neg8.2%
add-sqr-sqrt8.2%
sqrt-unprod4.9%
sqr-neg4.9%
sqrt-unprod0.0%
add-sqr-sqrt62.3%
+-inverses62.3%
metadata-eval62.3%
Applied egg-rr62.3%
log1p-undefine62.3%
div062.3%
metadata-eval62.3%
metadata-eval62.3%
1-exp62.3%
metadata-eval62.3%
Simplified62.3%
Final simplification66.0%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* -0.6666666666666666 (/ b a)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5d-310)) then
tmp = (-0.6666666666666666d0) * (b / a)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = -0.6666666666666666 * (b / a) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(-0.6666666666666666 * Float64(b / a)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = -0.6666666666666666 * (b / a); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 77.4%
sqr-neg77.4%
sqr-neg77.4%
associate-*l*77.4%
Simplified77.4%
Taylor expanded in b around -inf 69.5%
*-commutative69.5%
Simplified69.5%
if -4.999999999999985e-310 < b Initial program 53.8%
sqr-neg53.8%
sqr-neg53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in b around -inf 2.5%
mul-1-neg2.5%
Simplified2.5%
expm1-log1p-u1.9%
expm1-undefine8.2%
associate-/r*8.2%
unsub-neg8.2%
add-sqr-sqrt8.2%
sqrt-unprod4.9%
sqr-neg4.9%
sqrt-unprod0.0%
add-sqr-sqrt62.3%
+-inverses62.3%
metadata-eval62.3%
Applied egg-rr62.3%
log1p-undefine62.3%
div062.3%
metadata-eval62.3%
metadata-eval62.3%
1-exp62.3%
metadata-eval62.3%
Simplified62.3%
Final simplification66.0%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ -0.6666666666666666 (/ a b)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -0.6666666666666666 / (a / b);
} else {
tmp = 0.0;
}
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) / (a / b)
else
tmp = 0.0d0
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 / (a / b);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = -0.6666666666666666 / (a / b) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(-0.6666666666666666 / Float64(a / b)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = -0.6666666666666666 / (a / b); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(-0.6666666666666666 / N[(a / b), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 77.4%
sqr-neg77.4%
sqr-neg77.4%
associate-*l*77.4%
Simplified77.4%
Taylor expanded in b around -inf 69.5%
*-commutative69.5%
Simplified69.5%
*-commutative69.5%
clear-num69.4%
un-div-inv69.5%
Applied egg-rr69.5%
if -4.999999999999985e-310 < b Initial program 53.8%
sqr-neg53.8%
sqr-neg53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in b around -inf 2.5%
mul-1-neg2.5%
Simplified2.5%
expm1-log1p-u1.9%
expm1-undefine8.2%
associate-/r*8.2%
unsub-neg8.2%
add-sqr-sqrt8.2%
sqrt-unprod4.9%
sqr-neg4.9%
sqrt-unprod0.0%
add-sqr-sqrt62.3%
+-inverses62.3%
metadata-eval62.3%
Applied egg-rr62.3%
log1p-undefine62.3%
div062.3%
metadata-eval62.3%
metadata-eval62.3%
1-exp62.3%
metadata-eval62.3%
Simplified62.3%
Final simplification66.0%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (* b -0.6666666666666666) a) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = 0.0;
}
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 = 0.0d0
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 = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (b * -0.6666666666666666) / a else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(b * -0.6666666666666666) / a); else tmp = 0.0; 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 = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 77.4%
sqr-neg77.4%
sqr-neg77.4%
associate-*l*77.4%
Simplified77.4%
Applied egg-rr63.8%
associate-/r*63.8%
Simplified63.8%
associate-*r*63.8%
*-commutative63.8%
add-sqr-sqrt63.8%
pow1/263.8%
pow1/263.9%
pow-prod-down76.1%
pow276.1%
*-commutative76.1%
associate-*r*76.1%
Applied egg-rr76.1%
unpow1/276.1%
unpow276.1%
rem-sqrt-square91.1%
associate-*r*91.1%
*-commutative91.1%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in b around -inf 69.5%
*-commutative69.5%
associate-*l/69.6%
Simplified69.6%
if -4.999999999999985e-310 < b Initial program 53.8%
sqr-neg53.8%
sqr-neg53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in b around -inf 2.5%
mul-1-neg2.5%
Simplified2.5%
expm1-log1p-u1.9%
expm1-undefine8.2%
associate-/r*8.2%
unsub-neg8.2%
add-sqr-sqrt8.2%
sqrt-unprod4.9%
sqr-neg4.9%
sqrt-unprod0.0%
add-sqr-sqrt62.3%
+-inverses62.3%
metadata-eval62.3%
Applied egg-rr62.3%
log1p-undefine62.3%
div062.3%
metadata-eval62.3%
metadata-eval62.3%
1-exp62.3%
metadata-eval62.3%
Simplified62.3%
Final simplification66.1%
(FPCore (a b c) :precision binary64 0.0)
double code(double a, double b, double c) {
return 0.0;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = 0.0d0
end function
public static double code(double a, double b, double c) {
return 0.0;
}
def code(a, b, c): return 0.0
function code(a, b, c) return 0.0 end
function tmp = code(a, b, c) tmp = 0.0; end
code[a_, b_, c_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 66.1%
sqr-neg66.1%
sqr-neg66.1%
associate-*l*66.0%
Simplified66.0%
Taylor expanded in b around -inf 37.4%
mul-1-neg37.4%
Simplified37.4%
expm1-log1p-u21.7%
expm1-undefine18.3%
associate-/r*18.3%
unsub-neg18.3%
add-sqr-sqrt4.0%
sqrt-unprod3.5%
sqr-neg3.5%
sqrt-unprod1.6%
add-sqr-sqrt31.4%
+-inverses31.4%
metadata-eval31.4%
Applied egg-rr31.4%
log1p-undefine31.4%
div031.4%
metadata-eval31.4%
metadata-eval31.4%
1-exp31.4%
metadata-eval31.4%
Simplified31.4%
Final simplification31.4%
herbie shell --seed 2024046
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))