
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\end{array}
(FPCore (a b c)
:precision binary64
(if (<= b -2.3e+154)
(/ 1.0 (* -1.5 (/ a b)))
(if (<= b 2.35e-84)
(/ (- (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 <= -2.3e+154) {
tmp = 1.0 / (-1.5 * (a / b));
} else if (b <= 2.35e-84) {
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 <= (-2.3d+154)) then
tmp = 1.0d0 / ((-1.5d0) * (a / b))
else if (b <= 2.35d-84) 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 <= -2.3e+154) {
tmp = 1.0 / (-1.5 * (a / b));
} else if (b <= 2.35e-84) {
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 <= -2.3e+154: tmp = 1.0 / (-1.5 * (a / b)) elif b <= 2.35e-84: 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 <= -2.3e+154) tmp = Float64(1.0 / Float64(-1.5 * Float64(a / b))); elseif (b <= 2.35e-84) 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 <= -2.3e+154) tmp = 1.0 / (-1.5 * (a / b)); elseif (b <= 2.35e-84) 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, -2.3e+154], N[(1.0 / N[(-1.5 * N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.35e-84], 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 -2.3 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{-1.5 \cdot \frac{a}{b}}\\
\mathbf{elif}\;b \leq 2.35 \cdot 10^{-84}:\\
\;\;\;\;\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 < -2.3e154Initial program 54.9%
sqr-neg54.9%
sqr-neg54.9%
associate-*l*54.9%
Simplified54.9%
Taylor expanded in b around -inf 95.2%
*-commutative95.2%
Simplified95.2%
associate-*l/95.2%
Applied egg-rr95.2%
clear-num95.3%
inv-pow95.3%
*-un-lft-identity95.3%
*-commutative95.3%
times-frac95.4%
metadata-eval95.4%
Applied egg-rr95.4%
unpow-195.4%
Simplified95.4%
if -2.3e154 < b < 2.35e-84Initial program 87.1%
if 2.35e-84 < b Initial program 12.3%
sqr-neg12.3%
sqr-neg12.3%
associate-*l*12.3%
Simplified12.3%
Taylor expanded in b around inf 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification89.9%
(FPCore (a b c)
:precision binary64
(if (<= b -2.3e+154)
(/ 1.0 (* -1.5 (/ a b)))
(if (<= b 1.02e-81)
(/ (- (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 <= -2.3e+154) {
tmp = 1.0 / (-1.5 * (a / b));
} else if (b <= 1.02e-81) {
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 <= (-2.3d+154)) then
tmp = 1.0d0 / ((-1.5d0) * (a / b))
else if (b <= 1.02d-81) 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 <= -2.3e+154) {
tmp = 1.0 / (-1.5 * (a / b));
} else if (b <= 1.02e-81) {
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 <= -2.3e+154: tmp = 1.0 / (-1.5 * (a / b)) elif b <= 1.02e-81: 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 <= -2.3e+154) tmp = Float64(1.0 / Float64(-1.5 * Float64(a / b))); elseif (b <= 1.02e-81) 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 <= -2.3e+154) tmp = 1.0 / (-1.5 * (a / b)); elseif (b <= 1.02e-81) 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, -2.3e+154], N[(1.0 / N[(-1.5 * N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.02e-81], 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 -2.3 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{-1.5 \cdot \frac{a}{b}}\\
\mathbf{elif}\;b \leq 1.02 \cdot 10^{-81}:\\
\;\;\;\;\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 < -2.3e154Initial program 54.9%
sqr-neg54.9%
sqr-neg54.9%
associate-*l*54.9%
Simplified54.9%
Taylor expanded in b around -inf 95.2%
*-commutative95.2%
Simplified95.2%
associate-*l/95.2%
Applied egg-rr95.2%
clear-num95.3%
inv-pow95.3%
*-un-lft-identity95.3%
*-commutative95.3%
times-frac95.4%
metadata-eval95.4%
Applied egg-rr95.4%
unpow-195.4%
Simplified95.4%
if -2.3e154 < b < 1.01999999999999998e-81Initial program 87.1%
sqr-neg87.1%
sqr-neg87.1%
associate-*l*87.1%
Simplified87.1%
if 1.01999999999999998e-81 < b Initial program 12.3%
sqr-neg12.3%
sqr-neg12.3%
associate-*l*12.3%
Simplified12.3%
Taylor expanded in b around inf 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification89.9%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-114)
(+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5))
(if (<= b 1.08e-83)
(* (- b (sqrt (* a (* c (- 3.0))))) (/ (/ 1.0 a) -3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1.08e-83) {
tmp = (b - sqrt((a * (c * -3.0)))) * ((1.0 / a) / -3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-8.2d-114)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
else if (b <= 1.08d-83) then
tmp = (b - sqrt((a * (c * -3.0d0)))) * ((1.0d0 / a) / (-3.0d0))
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1.08e-83) {
tmp = (b - Math.sqrt((a * (c * -3.0)))) * ((1.0 / a) / -3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e-114: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) elif b <= 1.08e-83: tmp = (b - math.sqrt((a * (c * -3.0)))) * ((1.0 / a) / -3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-114) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5)); elseif (b <= 1.08e-83) tmp = Float64(Float64(b - sqrt(Float64(a * Float64(c * Float64(-3.0))))) * Float64(Float64(1.0 / 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 <= -8.2e-114) tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5); elseif (b <= 1.08e-83) tmp = (b - sqrt((a * (c * -3.0)))) * ((1.0 / a) / -3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-114], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.08e-83], N[(N[(b - N[Sqrt[N[(a * N[(c * (-3.0)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-114}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{elif}\;b \leq 1.08 \cdot 10^{-83}:\\
\;\;\;\;\left(b - \sqrt{a \cdot \left(c \cdot \left(-3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.1999999999999993e-114Initial program 78.8%
sqr-neg78.8%
sqr-neg78.8%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in b around -inf 90.2%
mul-1-neg90.2%
*-commutative90.2%
distribute-rgt-neg-in90.2%
fma-define90.2%
associate-*r/90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in c around 0 90.2%
if -8.1999999999999993e-114 < b < 1.08e-83Initial program 78.6%
sqr-neg78.6%
sqr-neg78.6%
associate-*l*78.6%
Simplified78.6%
frac-2neg78.6%
div-inv78.5%
Applied egg-rr78.4%
*-commutative78.4%
*-commutative78.4%
associate-/r*78.5%
Simplified78.5%
add-cube-cbrt78.0%
pow378.1%
*-commutative78.1%
Applied egg-rr78.1%
Taylor expanded in c around -inf 76.4%
associate-*r*76.4%
neg-mul-176.4%
rem-cube-cbrt76.5%
Simplified76.5%
if 1.08e-83 < b Initial program 12.3%
sqr-neg12.3%
sqr-neg12.3%
associate-*l*12.3%
Simplified12.3%
Taylor expanded in b around inf 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification87.5%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-114)
(+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5))
(if (<= b 1e-82)
(* (sqrt (* (* a c) -3.0)) (/ (/ -1.0 a) -3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1e-82) {
tmp = sqrt(((a * c) * -3.0)) * ((-1.0 / a) / -3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-8.2d-114)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
else if (b <= 1d-82) then
tmp = sqrt(((a * c) * (-3.0d0))) * (((-1.0d0) / a) / (-3.0d0))
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1e-82) {
tmp = Math.sqrt(((a * c) * -3.0)) * ((-1.0 / a) / -3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e-114: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) elif b <= 1e-82: tmp = math.sqrt(((a * c) * -3.0)) * ((-1.0 / a) / -3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-114) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5)); elseif (b <= 1e-82) tmp = Float64(sqrt(Float64(Float64(a * c) * -3.0)) * Float64(Float64(-1.0 / 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 <= -8.2e-114) tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5); elseif (b <= 1e-82) tmp = sqrt(((a * c) * -3.0)) * ((-1.0 / a) / -3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-114], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-82], N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] * N[(N[(-1.0 / a), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-114}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{elif}\;b \leq 10^{-82}:\\
\;\;\;\;\sqrt{\left(a \cdot c\right) \cdot -3} \cdot \frac{\frac{-1}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.1999999999999993e-114Initial program 78.8%
sqr-neg78.8%
sqr-neg78.8%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in b around -inf 90.2%
mul-1-neg90.2%
*-commutative90.2%
distribute-rgt-neg-in90.2%
fma-define90.2%
associate-*r/90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in c around 0 90.2%
if -8.1999999999999993e-114 < b < 1e-82Initial program 78.6%
sqr-neg78.6%
sqr-neg78.6%
associate-*l*78.6%
Simplified78.6%
frac-2neg78.6%
div-inv78.5%
Applied egg-rr78.4%
*-commutative78.4%
*-commutative78.4%
associate-/r*78.5%
Simplified78.5%
add-cube-cbrt78.0%
pow378.1%
*-commutative78.1%
Applied egg-rr78.1%
Taylor expanded in b around 0 75.8%
mul-1-neg75.8%
rem-cube-cbrt75.9%
associate-*r*75.9%
*-commutative75.9%
*-commutative75.9%
Simplified75.9%
if 1e-82 < b Initial program 12.3%
sqr-neg12.3%
sqr-neg12.3%
associate-*l*12.3%
Simplified12.3%
Taylor expanded in b around inf 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification87.4%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-114)
(+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5))
(if (<= b 3.15e-83)
(* (sqrt (* (* a c) -3.0)) (/ -0.3333333333333333 (- a)))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 3.15e-83) {
tmp = sqrt(((a * c) * -3.0)) * (-0.3333333333333333 / -a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-8.2d-114)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
else if (b <= 3.15d-83) then
tmp = sqrt(((a * c) * (-3.0d0))) * ((-0.3333333333333333d0) / -a)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 3.15e-83) {
tmp = Math.sqrt(((a * c) * -3.0)) * (-0.3333333333333333 / -a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e-114: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) elif b <= 3.15e-83: tmp = math.sqrt(((a * c) * -3.0)) * (-0.3333333333333333 / -a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-114) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5)); elseif (b <= 3.15e-83) tmp = Float64(sqrt(Float64(Float64(a * c) * -3.0)) * Float64(-0.3333333333333333 / Float64(-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 <= -8.2e-114) tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5); elseif (b <= 3.15e-83) tmp = sqrt(((a * c) * -3.0)) * (-0.3333333333333333 / -a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-114], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.15e-83], N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] * N[(-0.3333333333333333 / (-a)), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-114}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{elif}\;b \leq 3.15 \cdot 10^{-83}:\\
\;\;\;\;\sqrt{\left(a \cdot c\right) \cdot -3} \cdot \frac{-0.3333333333333333}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.1999999999999993e-114Initial program 78.8%
sqr-neg78.8%
sqr-neg78.8%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in b around -inf 90.2%
mul-1-neg90.2%
*-commutative90.2%
distribute-rgt-neg-in90.2%
fma-define90.2%
associate-*r/90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in c around 0 90.2%
if -8.1999999999999993e-114 < b < 3.14999999999999983e-83Initial program 78.6%
sqr-neg78.6%
sqr-neg78.6%
associate-*l*78.6%
Simplified78.6%
frac-2neg78.6%
div-inv78.5%
Applied egg-rr78.4%
*-commutative78.4%
*-commutative78.4%
associate-/r*78.5%
Simplified78.5%
add-cube-cbrt78.0%
pow378.1%
*-commutative78.1%
Applied egg-rr78.1%
Taylor expanded in b around 0 75.8%
mul-1-neg75.8%
rem-cube-cbrt75.9%
associate-*r*75.9%
*-commutative75.9%
*-commutative75.9%
Simplified75.9%
Taylor expanded in a around 0 75.9%
if 3.14999999999999983e-83 < b Initial program 12.3%
sqr-neg12.3%
sqr-neg12.3%
associate-*l*12.3%
Simplified12.3%
Taylor expanded in b around inf 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification87.3%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-114)
(+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5))
(if (<= b 1.55e-84)
(/ (/ (sqrt (* a (* c -3.0))) a) 3.0)
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1.55e-84) {
tmp = (sqrt((a * (c * -3.0))) / a) / 3.0;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-8.2d-114)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
else if (b <= 1.55d-84) then
tmp = (sqrt((a * (c * (-3.0d0)))) / a) / 3.0d0
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1.55e-84) {
tmp = (Math.sqrt((a * (c * -3.0))) / a) / 3.0;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e-114: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) elif b <= 1.55e-84: tmp = (math.sqrt((a * (c * -3.0))) / a) / 3.0 else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-114) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5)); elseif (b <= 1.55e-84) tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) / 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 <= -8.2e-114) tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5); elseif (b <= 1.55e-84) tmp = (sqrt((a * (c * -3.0))) / a) / 3.0; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-114], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.55e-84], N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision] / 3.0), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-114}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{-84}:\\
\;\;\;\;\frac{\frac{\sqrt{a \cdot \left(c \cdot -3\right)}}{a}}{3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.1999999999999993e-114Initial program 78.8%
sqr-neg78.8%
sqr-neg78.8%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in b around -inf 90.2%
mul-1-neg90.2%
*-commutative90.2%
distribute-rgt-neg-in90.2%
fma-define90.2%
associate-*r/90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in c around 0 90.2%
if -8.1999999999999993e-114 < b < 1.55000000000000001e-84Initial program 78.6%
sqr-neg78.6%
sqr-neg78.6%
associate-*l*78.6%
Simplified78.6%
frac-2neg78.6%
div-inv78.5%
Applied egg-rr78.4%
*-commutative78.4%
*-commutative78.4%
associate-/r*78.5%
Simplified78.5%
add-cube-cbrt78.0%
pow378.1%
*-commutative78.1%
Applied egg-rr78.1%
Taylor expanded in b around 0 75.8%
mul-1-neg75.8%
rem-cube-cbrt75.9%
associate-*r*75.9%
*-commutative75.9%
*-commutative75.9%
Simplified75.9%
associate-*r/75.9%
frac-2neg75.9%
Applied egg-rr75.8%
if 1.55000000000000001e-84 < b Initial program 12.3%
sqr-neg12.3%
sqr-neg12.3%
associate-*l*12.3%
Simplified12.3%
Taylor expanded in b around inf 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification87.3%
(FPCore (a b c) :precision binary64 (if (<= b -8.2e-114) (+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5)) (if (<= b 1.7e-82) (/ (sqrt (* a (* c -3.0))) (* a 3.0)) (* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1.7e-82) {
tmp = sqrt((a * (c * -3.0))) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-8.2d-114)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
else if (b <= 1.7d-82) then
tmp = sqrt((a * (c * (-3.0d0)))) / (a * 3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1.7e-82) {
tmp = Math.sqrt((a * (c * -3.0))) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e-114: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) elif b <= 1.7e-82: tmp = math.sqrt((a * (c * -3.0))) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-114) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5)); elseif (b <= 1.7e-82) tmp = Float64(sqrt(Float64(a * Float64(c * -3.0))) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -8.2e-114) tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5); elseif (b <= 1.7e-82) tmp = sqrt((a * (c * -3.0))) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-114], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.7e-82], N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-114}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{-82}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)}}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.1999999999999993e-114Initial program 78.8%
sqr-neg78.8%
sqr-neg78.8%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in b around -inf 90.2%
mul-1-neg90.2%
*-commutative90.2%
distribute-rgt-neg-in90.2%
fma-define90.2%
associate-*r/90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in c around 0 90.2%
if -8.1999999999999993e-114 < b < 1.69999999999999988e-82Initial program 78.6%
sqr-neg78.6%
sqr-neg78.6%
associate-*l*78.6%
Simplified78.6%
frac-2neg78.6%
div-inv78.5%
Applied egg-rr78.4%
*-commutative78.4%
*-commutative78.4%
associate-/r*78.5%
Simplified78.5%
add-cube-cbrt78.0%
pow378.1%
*-commutative78.1%
Applied egg-rr78.1%
Taylor expanded in b around 0 75.8%
mul-1-neg75.8%
rem-cube-cbrt75.9%
associate-*r*75.9%
*-commutative75.9%
*-commutative75.9%
Simplified75.9%
distribute-lft-neg-out75.9%
neg-sub075.9%
associate-/l/75.8%
*-commutative75.8%
un-div-inv75.9%
*-commutative75.9%
associate-*r*75.9%
*-commutative75.9%
associate-*l*75.8%
Applied egg-rr75.8%
neg-sub075.8%
distribute-neg-frac275.8%
*-commutative75.8%
distribute-rgt-neg-in75.8%
metadata-eval75.8%
Simplified75.8%
if 1.69999999999999988e-82 < b Initial program 12.3%
sqr-neg12.3%
sqr-neg12.3%
associate-*l*12.3%
Simplified12.3%
Taylor expanded in b around inf 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification87.3%
(FPCore (a b c)
:precision binary64
(if (<= b -7.2e-114)
(+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5))
(if (<= b 1.3e-227)
(* 0.3333333333333333 (sqrt (/ (* c -3.0) a)))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1.3e-227) {
tmp = 0.3333333333333333 * sqrt(((c * -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 <= (-7.2d-114)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
else if (b <= 1.3d-227) then
tmp = 0.3333333333333333d0 * sqrt(((c * (-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 <= -7.2e-114) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else if (b <= 1.3e-227) {
tmp = 0.3333333333333333 * Math.sqrt(((c * -3.0) / a));
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7.2e-114: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) elif b <= 1.3e-227: tmp = 0.3333333333333333 * math.sqrt(((c * -3.0) / a)) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -7.2e-114) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5)); elseif (b <= 1.3e-227) tmp = Float64(0.3333333333333333 * sqrt(Float64(Float64(c * -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 <= -7.2e-114) tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5); elseif (b <= 1.3e-227) tmp = 0.3333333333333333 * sqrt(((c * -3.0) / a)); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7.2e-114], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.3e-227], N[(0.3333333333333333 * N[Sqrt[N[(N[(c * -3.0), $MachinePrecision] / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{-114}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{-227}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt{\frac{c \cdot -3}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -7.20000000000000036e-114Initial program 78.8%
sqr-neg78.8%
sqr-neg78.8%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in b around -inf 90.2%
mul-1-neg90.2%
*-commutative90.2%
distribute-rgt-neg-in90.2%
fma-define90.2%
associate-*r/90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in c around 0 90.2%
if -7.20000000000000036e-114 < b < 1.30000000000000006e-227Initial program 78.5%
sqr-neg78.5%
sqr-neg78.5%
associate-*l*78.5%
Simplified78.5%
frac-2neg78.5%
div-inv78.4%
Applied egg-rr78.5%
*-commutative78.5%
*-commutative78.5%
associate-/r*78.5%
Simplified78.5%
add-cube-cbrt78.0%
pow378.1%
*-commutative78.1%
Applied egg-rr78.1%
Taylor expanded in b around 0 38.4%
rem-cube-cbrt38.4%
Simplified38.4%
if 1.30000000000000006e-227 < b Initial program 20.8%
sqr-neg20.8%
sqr-neg20.8%
associate-*l*20.8%
Simplified20.8%
Taylor expanded in b around inf 81.7%
*-commutative81.7%
Simplified81.7%
Final simplification77.9%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-4d-310)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-310) tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 79.3%
sqr-neg79.3%
sqr-neg79.3%
associate-*l*79.3%
Simplified79.3%
Taylor expanded in b around -inf 73.3%
mul-1-neg73.3%
*-commutative73.3%
distribute-rgt-neg-in73.3%
fma-define73.3%
associate-*r/73.4%
metadata-eval73.4%
Simplified73.4%
Taylor expanded in c around 0 74.2%
if -3.999999999999988e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in b around inf 72.5%
*-commutative72.5%
Simplified72.5%
Final simplification73.3%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (/ (* (/ b a) 2.0) -3.0) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = ((b / a) * 2.0) / -3.0;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-4d-310)) then
tmp = ((b / a) * 2.0d0) / (-3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = ((b / a) * 2.0) / -3.0;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = ((b / a) * 2.0) / -3.0 else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(Float64(Float64(b / a) * 2.0) / -3.0); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-310) tmp = ((b / a) * 2.0) / -3.0; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(N[(N[(b / a), $MachinePrecision] * 2.0), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b}{a} \cdot 2}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 79.3%
sqr-neg79.3%
sqr-neg79.3%
associate-*l*79.3%
Simplified79.3%
frac-2neg79.3%
div-inv79.2%
Applied egg-rr79.2%
*-commutative79.2%
*-commutative79.2%
associate-/r*79.2%
Simplified79.2%
associate-*r/79.2%
fma-undefine79.2%
add-sqr-sqrt54.5%
hypot-define60.2%
*-commutative60.2%
Applied egg-rr60.2%
Taylor expanded in b around -inf 73.3%
*-commutative73.3%
Simplified73.3%
if -3.999999999999988e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in b around inf 72.5%
*-commutative72.5%
Simplified72.5%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (/ b (* -1.5 a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = b / (-1.5 * 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 <= (-4d-310)) then
tmp = b / ((-1.5d0) * 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 <= -4e-310) {
tmp = b / (-1.5 * a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = b / (-1.5 * a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(b / Float64(-1.5 * 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 <= -4e-310) tmp = b / (-1.5 * a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(b / N[(-1.5 * a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{-1.5 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 79.3%
sqr-neg79.3%
sqr-neg79.3%
associate-*l*79.3%
Simplified79.3%
frac-2neg79.3%
div-inv79.2%
Applied egg-rr79.2%
*-commutative79.2%
*-commutative79.2%
associate-/r*79.2%
Simplified79.2%
add-cube-cbrt79.0%
pow379.1%
*-commutative79.1%
Applied egg-rr79.1%
Taylor expanded in b around -inf 73.1%
associate-*r/73.2%
*-commutative73.2%
associate-*r/73.3%
Simplified73.3%
clear-num73.1%
un-div-inv73.2%
div-inv73.3%
metadata-eval73.3%
Applied egg-rr73.3%
if -3.999999999999988e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in b around inf 72.5%
*-commutative72.5%
Simplified72.5%
Final simplification72.9%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (* b (/ -0.6666666666666666 a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-4d-310)) then
tmp = b * ((-0.6666666666666666d0) / a)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-310) tmp = b * (-0.6666666666666666 / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 79.3%
sqr-neg79.3%
sqr-neg79.3%
associate-*l*79.3%
Simplified79.3%
frac-2neg79.3%
div-inv79.2%
Applied egg-rr79.2%
*-commutative79.2%
*-commutative79.2%
associate-/r*79.2%
Simplified79.2%
add-cube-cbrt79.0%
pow379.1%
*-commutative79.1%
Applied egg-rr79.1%
Taylor expanded in b around -inf 73.1%
associate-*r/73.2%
*-commutative73.2%
associate-*r/73.3%
Simplified73.3%
if -3.999999999999988e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in b around inf 72.5%
*-commutative72.5%
Simplified72.5%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-4d-310)) then
tmp = b * ((-0.6666666666666666d0) / a)
else
tmp = c * ((-0.5d0) / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-310) tmp = b * (-0.6666666666666666 / a); else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 79.3%
sqr-neg79.3%
sqr-neg79.3%
associate-*l*79.3%
Simplified79.3%
frac-2neg79.3%
div-inv79.2%
Applied egg-rr79.2%
*-commutative79.2%
*-commutative79.2%
associate-/r*79.2%
Simplified79.2%
add-cube-cbrt79.0%
pow379.1%
*-commutative79.1%
Applied egg-rr79.1%
Taylor expanded in b around -inf 73.1%
associate-*r/73.2%
*-commutative73.2%
associate-*r/73.3%
Simplified73.3%
if -3.999999999999988e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in b around inf 56.7%
clear-num56.3%
inv-pow56.3%
times-frac56.4%
metadata-eval56.4%
associate-/l*60.9%
Applied egg-rr60.9%
unpow-160.9%
associate-/r*72.0%
*-inverses72.0%
Simplified72.0%
*-un-lft-identity72.0%
associate-/r*72.0%
metadata-eval72.0%
clear-num71.9%
Applied egg-rr71.9%
*-lft-identity71.9%
associate-/r/72.2%
Simplified72.2%
Final simplification72.7%
(FPCore (a b c) :precision binary64 (* b (/ -0.6666666666666666 a)))
double code(double a, double b, double c) {
return b * (-0.6666666666666666 / 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 * ((-0.6666666666666666d0) / a)
end function
public static double code(double a, double b, double c) {
return b * (-0.6666666666666666 / a);
}
def code(a, b, c): return b * (-0.6666666666666666 / a)
function code(a, b, c) return Float64(b * Float64(-0.6666666666666666 / a)) end
function tmp = code(a, b, c) tmp = b * (-0.6666666666666666 / a); end
code[a_, b_, c_] := N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \frac{-0.6666666666666666}{a}
\end{array}
Initial program 54.1%
sqr-neg54.1%
sqr-neg54.1%
associate-*l*54.1%
Simplified54.1%
frac-2neg54.1%
div-inv54.0%
Applied egg-rr54.0%
*-commutative54.0%
*-commutative54.0%
associate-/r*54.0%
Simplified54.0%
add-cube-cbrt53.8%
pow353.9%
*-commutative53.9%
Applied egg-rr53.9%
Taylor expanded in b around -inf 39.0%
associate-*r/39.0%
*-commutative39.0%
associate-*r/39.0%
Simplified39.0%
herbie shell --seed 2024172
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))