
(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 -3.2e+143)
(/ -2.0 (/ (* a 3.0) b))
(if (<= b 1.95e-62)
(/ (- (sqrt (- (* b b) (* (* a 3.0) c))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.2e+143) {
tmp = -2.0 / ((a * 3.0) / b);
} else if (b <= 1.95e-62) {
tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
} 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 <= (-3.2d+143)) then
tmp = (-2.0d0) / ((a * 3.0d0) / b)
else if (b <= 1.95d-62) then
tmp = (sqrt(((b * b) - ((a * 3.0d0) * c))) - b) / (a * 3.0d0)
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 <= -3.2e+143) {
tmp = -2.0 / ((a * 3.0) / b);
} else if (b <= 1.95e-62) {
tmp = (Math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.2e+143: tmp = -2.0 / ((a * 3.0) / b) elif b <= 1.95e-62: tmp = (math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.2e+143) tmp = Float64(-2.0 / Float64(Float64(a * 3.0) / b)); elseif (b <= 1.95e-62) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 3.0) * c))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.2e+143) tmp = -2.0 / ((a * 3.0) / b); elseif (b <= 1.95e-62) tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.2e+143], N[(-2.0 / N[(N[(a * 3.0), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.95e-62], 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 * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.2 \cdot 10^{+143}:\\
\;\;\;\;\frac{-2}{\frac{a \cdot 3}{b}}\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{-62}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -3.20000000000000016e143Initial program 48.7%
Applied egg-rr56.9%
associate-/r*57.0%
Simplified57.0%
Taylor expanded in b around -inf 94.8%
add-exp-log46.0%
*-commutative46.0%
div-inv46.0%
metadata-eval46.0%
Applied egg-rr46.0%
rem-exp-log94.5%
associate-*r*94.4%
metadata-eval94.4%
distribute-rgt-neg-in94.4%
distribute-lft-neg-in94.4%
div-inv94.6%
metadata-eval94.6%
div-inv94.8%
metadata-eval94.8%
frac-2neg94.8%
associate-/l/94.8%
*-commutative94.8%
associate-/l*94.8%
*-commutative94.8%
Applied egg-rr94.8%
if -3.20000000000000016e143 < b < 1.9500000000000002e-62Initial program 85.5%
if 1.9500000000000002e-62 < b Initial program 20.1%
fma-neg20.1%
associate-*l*20.1%
distribute-lft-neg-in20.1%
metadata-eval20.1%
*-commutative20.1%
associate-*r*20.1%
add-cube-cbrt14.7%
pow315.7%
associate-*r*15.7%
*-commutative15.7%
metadata-eval15.7%
distribute-lft-neg-in15.7%
associate-*l*15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
metadata-eval15.7%
Applied egg-rr15.7%
Taylor expanded in b around inf 83.0%
associate-*r/83.0%
Simplified83.0%
Final simplification85.9%
(FPCore (a b c)
:precision binary64
(if (<= b -2.9e-58)
(/ (- (- (* (/ a (/ b c)) 1.5) b) b) (* a 3.0))
(if (<= b 3.6e-62)
(* 0.3333333333333333 (/ (+ b (sqrt (* -3.0 (* a c)))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.9e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 3.6e-62) {
tmp = 0.3333333333333333 * ((b + sqrt((-3.0 * (a * c)))) / 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 <= (-2.9d-58)) then
tmp = ((((a / (b / c)) * 1.5d0) - b) - b) / (a * 3.0d0)
else if (b <= 3.6d-62) then
tmp = 0.3333333333333333d0 * ((b + sqrt(((-3.0d0) * (a * c)))) / 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 <= -2.9e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 3.6e-62) {
tmp = 0.3333333333333333 * ((b + Math.sqrt((-3.0 * (a * c)))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.9e-58: tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0) elif b <= 3.6e-62: tmp = 0.3333333333333333 * ((b + math.sqrt((-3.0 * (a * c)))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.9e-58) tmp = Float64(Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) - b) - b) / Float64(a * 3.0)); elseif (b <= 3.6e-62) tmp = Float64(0.3333333333333333 * Float64(Float64(b + sqrt(Float64(-3.0 * Float64(a * c)))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.9e-58) tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0); elseif (b <= 3.6e-62) tmp = 0.3333333333333333 * ((b + sqrt((-3.0 * (a * c)))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.9e-58], N[(N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.6e-62], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.9 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{-62}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{-3 \cdot \left(a \cdot c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.8999999999999999e-58Initial program 73.5%
fma-neg73.5%
associate-*l*73.5%
distribute-lft-neg-in73.5%
metadata-eval73.5%
*-commutative73.5%
associate-*r*73.5%
add-cube-cbrt73.3%
pow373.4%
associate-*r*73.4%
*-commutative73.4%
metadata-eval73.4%
distribute-lft-neg-in73.4%
associate-*l*73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
metadata-eval73.4%
Applied egg-rr73.4%
Taylor expanded in b around -inf 84.6%
+-commutative84.6%
mul-1-neg84.6%
unsub-neg84.6%
*-commutative84.6%
associate-/l*85.8%
Simplified85.8%
if -2.8999999999999999e-58 < b < 3.6e-62Initial program 80.9%
Taylor expanded in b around 0 72.1%
associate-*r*72.3%
*-commutative72.3%
*-commutative72.3%
Simplified72.3%
sqrt-prod37.8%
Applied egg-rr37.8%
*-commutative37.8%
Simplified37.8%
expm1-log1p-u21.6%
expm1-udef1.0%
add-sqr-sqrt0.5%
sqrt-unprod1.0%
sqr-neg1.0%
sqrt-unprod0.5%
add-sqr-sqrt1.0%
sqrt-unprod19.3%
*-commutative19.3%
Applied egg-rr19.3%
expm1-def56.9%
expm1-log1p71.0%
*-rgt-identity71.0%
times-frac70.7%
metadata-eval70.7%
*-commutative70.7%
associate-*l*70.7%
*-commutative70.7%
Simplified70.7%
Taylor expanded in a around 0 70.6%
if 3.6e-62 < b Initial program 20.1%
fma-neg20.1%
associate-*l*20.1%
distribute-lft-neg-in20.1%
metadata-eval20.1%
*-commutative20.1%
associate-*r*20.1%
add-cube-cbrt14.7%
pow315.7%
associate-*r*15.7%
*-commutative15.7%
metadata-eval15.7%
distribute-lft-neg-in15.7%
associate-*l*15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
metadata-eval15.7%
Applied egg-rr15.7%
Taylor expanded in b around inf 83.0%
associate-*r/83.0%
Simplified83.0%
Final simplification80.6%
(FPCore (a b c)
:precision binary64
(if (<= b -2.6e-58)
(/ (- (- (* (/ a (/ b c)) 1.5) b) b) (* a 3.0))
(if (<= b 1e-59)
(* 0.3333333333333333 (/ (+ b (sqrt (* a (* c -3.0)))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.6e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 1e-59) {
tmp = 0.3333333333333333 * ((b + sqrt((a * (c * -3.0)))) / 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 <= (-2.6d-58)) then
tmp = ((((a / (b / c)) * 1.5d0) - b) - b) / (a * 3.0d0)
else if (b <= 1d-59) then
tmp = 0.3333333333333333d0 * ((b + sqrt((a * (c * (-3.0d0))))) / 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 <= -2.6e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 1e-59) {
tmp = 0.3333333333333333 * ((b + Math.sqrt((a * (c * -3.0)))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.6e-58: tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0) elif b <= 1e-59: tmp = 0.3333333333333333 * ((b + math.sqrt((a * (c * -3.0)))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.6e-58) tmp = Float64(Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) - b) - b) / Float64(a * 3.0)); elseif (b <= 1e-59) tmp = Float64(0.3333333333333333 * Float64(Float64(b + sqrt(Float64(a * Float64(c * -3.0)))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.6e-58) tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0); elseif (b <= 1e-59) tmp = 0.3333333333333333 * ((b + sqrt((a * (c * -3.0)))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.6e-58], N[(N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-59], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.6 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 10^{-59}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.60000000000000007e-58Initial program 73.5%
fma-neg73.5%
associate-*l*73.5%
distribute-lft-neg-in73.5%
metadata-eval73.5%
*-commutative73.5%
associate-*r*73.5%
add-cube-cbrt73.3%
pow373.4%
associate-*r*73.4%
*-commutative73.4%
metadata-eval73.4%
distribute-lft-neg-in73.4%
associate-*l*73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
metadata-eval73.4%
Applied egg-rr73.4%
Taylor expanded in b around -inf 84.6%
+-commutative84.6%
mul-1-neg84.6%
unsub-neg84.6%
*-commutative84.6%
associate-/l*85.8%
Simplified85.8%
if -2.60000000000000007e-58 < b < 1e-59Initial program 80.9%
Taylor expanded in b around 0 72.1%
associate-*r*72.3%
*-commutative72.3%
*-commutative72.3%
Simplified72.3%
sqrt-prod37.8%
Applied egg-rr37.8%
*-commutative37.8%
Simplified37.8%
expm1-log1p-u21.6%
expm1-udef1.0%
add-sqr-sqrt0.5%
sqrt-unprod1.0%
sqr-neg1.0%
sqrt-unprod0.5%
add-sqr-sqrt1.0%
sqrt-unprod19.3%
*-commutative19.3%
Applied egg-rr19.3%
expm1-def56.9%
expm1-log1p71.0%
*-rgt-identity71.0%
times-frac70.7%
metadata-eval70.7%
*-commutative70.7%
associate-*l*70.7%
*-commutative70.7%
Simplified70.7%
if 1e-59 < b Initial program 20.1%
fma-neg20.1%
associate-*l*20.1%
distribute-lft-neg-in20.1%
metadata-eval20.1%
*-commutative20.1%
associate-*r*20.1%
add-cube-cbrt14.7%
pow315.7%
associate-*r*15.7%
*-commutative15.7%
metadata-eval15.7%
distribute-lft-neg-in15.7%
associate-*l*15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
metadata-eval15.7%
Applied egg-rr15.7%
Taylor expanded in b around inf 83.0%
associate-*r/83.0%
Simplified83.0%
Final simplification80.7%
(FPCore (a b c)
:precision binary64
(if (<= b -2.8e-58)
(/ (- (- (* (/ a (/ b c)) 1.5) b) b) (* a 3.0))
(if (<= b 7e-60)
(* 0.3333333333333333 (/ (+ b (sqrt (* c (* a -3.0)))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.8e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 7e-60) {
tmp = 0.3333333333333333 * ((b + sqrt((c * (a * -3.0)))) / 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 <= (-2.8d-58)) then
tmp = ((((a / (b / c)) * 1.5d0) - b) - b) / (a * 3.0d0)
else if (b <= 7d-60) then
tmp = 0.3333333333333333d0 * ((b + sqrt((c * (a * (-3.0d0))))) / 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 <= -2.8e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 7e-60) {
tmp = 0.3333333333333333 * ((b + Math.sqrt((c * (a * -3.0)))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.8e-58: tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0) elif b <= 7e-60: tmp = 0.3333333333333333 * ((b + math.sqrt((c * (a * -3.0)))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.8e-58) tmp = Float64(Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) - b) - b) / Float64(a * 3.0)); elseif (b <= 7e-60) tmp = Float64(0.3333333333333333 * Float64(Float64(b + sqrt(Float64(c * Float64(a * -3.0)))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.8e-58) tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0); elseif (b <= 7e-60) tmp = 0.3333333333333333 * ((b + sqrt((c * (a * -3.0)))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.8e-58], N[(N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e-60], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 7 \cdot 10^{-60}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.8000000000000001e-58Initial program 73.5%
fma-neg73.5%
associate-*l*73.5%
distribute-lft-neg-in73.5%
metadata-eval73.5%
*-commutative73.5%
associate-*r*73.5%
add-cube-cbrt73.3%
pow373.4%
associate-*r*73.4%
*-commutative73.4%
metadata-eval73.4%
distribute-lft-neg-in73.4%
associate-*l*73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
metadata-eval73.4%
Applied egg-rr73.4%
Taylor expanded in b around -inf 84.6%
+-commutative84.6%
mul-1-neg84.6%
unsub-neg84.6%
*-commutative84.6%
associate-/l*85.8%
Simplified85.8%
if -2.8000000000000001e-58 < b < 6.99999999999999952e-60Initial program 80.9%
Taylor expanded in b around 0 72.1%
associate-*r*72.3%
*-commutative72.3%
*-commutative72.3%
Simplified72.3%
sqrt-prod37.8%
Applied egg-rr37.8%
*-commutative37.8%
Simplified37.8%
*-un-lft-identity37.8%
times-frac37.6%
metadata-eval37.6%
add-sqr-sqrt20.4%
sqrt-unprod37.8%
sqr-neg37.8%
sqrt-unprod17.5%
add-sqr-sqrt37.6%
sqrt-unprod70.7%
Applied egg-rr70.7%
if 6.99999999999999952e-60 < b Initial program 20.1%
fma-neg20.1%
associate-*l*20.1%
distribute-lft-neg-in20.1%
metadata-eval20.1%
*-commutative20.1%
associate-*r*20.1%
add-cube-cbrt14.7%
pow315.7%
associate-*r*15.7%
*-commutative15.7%
metadata-eval15.7%
distribute-lft-neg-in15.7%
associate-*l*15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
metadata-eval15.7%
Applied egg-rr15.7%
Taylor expanded in b around inf 83.0%
associate-*r/83.0%
Simplified83.0%
Final simplification80.7%
(FPCore (a b c)
:precision binary64
(if (<= b -2.9e-58)
(/ (- (- (* (/ a (/ b c)) 1.5) b) b) (* a 3.0))
(if (<= b 5.5e-61)
(/ (- (sqrt (* a (* c -3.0))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.9e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 5.5e-61) {
tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0);
} 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 <= (-2.9d-58)) then
tmp = ((((a / (b / c)) * 1.5d0) - b) - b) / (a * 3.0d0)
else if (b <= 5.5d-61) then
tmp = (sqrt((a * (c * (-3.0d0)))) - b) / (a * 3.0d0)
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 <= -2.9e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 5.5e-61) {
tmp = (Math.sqrt((a * (c * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.9e-58: tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0) elif b <= 5.5e-61: tmp = (math.sqrt((a * (c * -3.0))) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.9e-58) tmp = Float64(Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) - b) - b) / Float64(a * 3.0)); elseif (b <= 5.5e-61) tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.9e-58) tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0); elseif (b <= 5.5e-61) tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.9e-58], N[(N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.5e-61], N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.9 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.8999999999999999e-58Initial program 73.5%
fma-neg73.5%
associate-*l*73.5%
distribute-lft-neg-in73.5%
metadata-eval73.5%
*-commutative73.5%
associate-*r*73.5%
add-cube-cbrt73.3%
pow373.4%
associate-*r*73.4%
*-commutative73.4%
metadata-eval73.4%
distribute-lft-neg-in73.4%
associate-*l*73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
metadata-eval73.4%
Applied egg-rr73.4%
Taylor expanded in b around -inf 84.6%
+-commutative84.6%
mul-1-neg84.6%
unsub-neg84.6%
*-commutative84.6%
associate-/l*85.8%
Simplified85.8%
if -2.8999999999999999e-58 < b < 5.4999999999999997e-61Initial program 80.9%
Taylor expanded in b around 0 72.1%
associate-*r*72.3%
*-commutative72.3%
*-commutative72.3%
Simplified72.3%
+-commutative72.3%
unsub-neg72.3%
Applied egg-rr72.3%
associate-*r*72.1%
*-commutative72.1%
rem-square-sqrt0.0%
unpow20.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt72.2%
Simplified72.2%
if 5.4999999999999997e-61 < b Initial program 20.1%
fma-neg20.1%
associate-*l*20.1%
distribute-lft-neg-in20.1%
metadata-eval20.1%
*-commutative20.1%
associate-*r*20.1%
add-cube-cbrt14.7%
pow315.7%
associate-*r*15.7%
*-commutative15.7%
metadata-eval15.7%
distribute-lft-neg-in15.7%
associate-*l*15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
metadata-eval15.7%
Applied egg-rr15.7%
Taylor expanded in b around inf 83.0%
associate-*r/83.0%
Simplified83.0%
Final simplification81.1%
(FPCore (a b c)
:precision binary64
(if (<= b -2.4e-58)
(/ (- (- (* (/ a (/ b c)) 1.5) b) b) (* a 3.0))
(if (<= b 7.8e-62)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.4e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 7.8e-62) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} 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 <= (-2.4d-58)) then
tmp = ((((a / (b / c)) * 1.5d0) - b) - b) / (a * 3.0d0)
else if (b <= 7.8d-62) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
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 <= -2.4e-58) {
tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
} else if (b <= 7.8e-62) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.4e-58: tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0) elif b <= 7.8e-62: tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.4e-58) tmp = Float64(Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) - b) - b) / Float64(a * 3.0)); elseif (b <= 7.8e-62) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.4e-58) tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0); elseif (b <= 7.8e-62) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.4e-58], N[(N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.8e-62], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{-62}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.4000000000000001e-58Initial program 73.5%
fma-neg73.5%
associate-*l*73.5%
distribute-lft-neg-in73.5%
metadata-eval73.5%
*-commutative73.5%
associate-*r*73.5%
add-cube-cbrt73.3%
pow373.4%
associate-*r*73.4%
*-commutative73.4%
metadata-eval73.4%
distribute-lft-neg-in73.4%
associate-*l*73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
metadata-eval73.4%
Applied egg-rr73.4%
Taylor expanded in b around -inf 84.6%
+-commutative84.6%
mul-1-neg84.6%
unsub-neg84.6%
*-commutative84.6%
associate-/l*85.8%
Simplified85.8%
if -2.4000000000000001e-58 < b < 7.8000000000000007e-62Initial program 80.9%
Taylor expanded in b around 0 72.1%
associate-*r*72.3%
*-commutative72.3%
*-commutative72.3%
Simplified72.3%
+-commutative72.3%
unsub-neg72.3%
Applied egg-rr72.3%
if 7.8000000000000007e-62 < b Initial program 20.1%
fma-neg20.1%
associate-*l*20.1%
distribute-lft-neg-in20.1%
metadata-eval20.1%
*-commutative20.1%
associate-*r*20.1%
add-cube-cbrt14.7%
pow315.7%
associate-*r*15.7%
*-commutative15.7%
metadata-eval15.7%
distribute-lft-neg-in15.7%
associate-*l*15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
metadata-eval15.7%
Applied egg-rr15.7%
Taylor expanded in b around inf 83.0%
associate-*r/83.0%
Simplified83.0%
Final simplification81.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ -2.0 (/ (* a 3.0) b)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -2.0 / ((a * 3.0) / b);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5d-310)) then
tmp = (-2.0d0) / ((a * 3.0d0) / b)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -2.0 / ((a * 3.0) / b);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = -2.0 / ((a * 3.0) / b) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(-2.0 / Float64(Float64(a * 3.0) / b)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = -2.0 / ((a * 3.0) / b); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(-2.0 / N[(N[(a * 3.0), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-2}{\frac{a \cdot 3}{b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 78.4%
Applied egg-rr64.8%
associate-/r*64.8%
Simplified64.8%
Taylor expanded in b around -inf 66.3%
add-exp-log28.0%
*-commutative28.0%
div-inv28.0%
metadata-eval28.0%
Applied egg-rr28.0%
rem-exp-log66.2%
associate-*r*66.2%
metadata-eval66.2%
distribute-rgt-neg-in66.2%
distribute-lft-neg-in66.2%
div-inv66.2%
metadata-eval66.2%
div-inv66.4%
metadata-eval66.4%
frac-2neg66.4%
associate-/l/66.4%
*-commutative66.4%
associate-/l*66.4%
*-commutative66.4%
Applied egg-rr66.4%
if -4.999999999999985e-310 < b Initial program 31.9%
fma-neg31.9%
associate-*l*31.9%
distribute-lft-neg-in31.9%
metadata-eval31.9%
*-commutative31.9%
associate-*r*31.9%
add-cube-cbrt27.6%
pow328.4%
associate-*r*28.3%
*-commutative28.3%
metadata-eval28.3%
distribute-lft-neg-in28.3%
associate-*l*28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
metadata-eval28.4%
Applied egg-rr28.4%
Taylor expanded in b around inf 68.0%
associate-*r/68.0%
Simplified68.0%
Final simplification67.2%
(FPCore (a b c) :precision binary64 (if (<= b 2e-309) (/ (* b -2.0) (* a 3.0)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 2e-309) {
tmp = (b * -2.0) / (a * 3.0);
} 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 <= 2d-309) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
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 <= 2e-309) {
tmp = (b * -2.0) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 2e-309: tmp = (b * -2.0) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 2e-309) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 2e-309) tmp = (b * -2.0) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 2e-309], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2 \cdot 10^{-309}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 1.9999999999999988e-309Initial program 78.4%
Taylor expanded in b around -inf 66.4%
*-commutative66.4%
Simplified66.4%
if 1.9999999999999988e-309 < b Initial program 31.9%
fma-neg31.9%
associate-*l*31.9%
distribute-lft-neg-in31.9%
metadata-eval31.9%
*-commutative31.9%
associate-*r*31.9%
add-cube-cbrt27.6%
pow328.4%
associate-*r*28.3%
*-commutative28.3%
metadata-eval28.3%
distribute-lft-neg-in28.3%
associate-*l*28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
metadata-eval28.4%
Applied egg-rr28.4%
Taylor expanded in b around inf 68.0%
associate-*r/68.0%
Simplified68.0%
Final simplification67.2%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* (/ b a) -0.3333333333333333) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (b / a) * -0.3333333333333333;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5d-310)) then
tmp = (b / a) * (-0.3333333333333333d0)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (b / a) * -0.3333333333333333;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (b / a) * -0.3333333333333333 else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(b / a) * -0.3333333333333333); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (b / a) * -0.3333333333333333; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(b / a), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{a} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 78.4%
Taylor expanded in b around 0 44.1%
associate-*r*44.2%
*-commutative44.2%
*-commutative44.2%
Simplified44.2%
Taylor expanded in b around inf 27.7%
if -4.999999999999985e-310 < b Initial program 31.9%
Taylor expanded in b around inf 68.0%
Final simplification48.3%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* b (/ -0.6666666666666666 a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5d-310)) then
tmp = b * ((-0.6666666666666666d0) / a)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = b * (-0.6666666666666666 / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 78.4%
Applied egg-rr64.8%
associate-/r*64.8%
Simplified64.8%
Taylor expanded in b around -inf 66.3%
expm1-log1p-u35.0%
expm1-udef26.7%
*-commutative26.7%
div-inv26.7%
metadata-eval26.7%
Applied egg-rr26.7%
expm1-def35.0%
expm1-log1p66.2%
associate-*l*66.2%
associate-*l/66.2%
metadata-eval66.2%
associate-*r/66.2%
metadata-eval66.2%
Simplified66.2%
if -4.999999999999985e-310 < b Initial program 31.9%
Taylor expanded in b around inf 68.0%
Final simplification67.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* -0.6666666666666666 (/ b a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5d-310)) then
tmp = (-0.6666666666666666d0) * (b / a)
else
tmp = (-0.5d0) * (c / b)
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.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = -0.6666666666666666 * (b / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(-0.6666666666666666 * Float64(b / a)); else tmp = Float64(-0.5 * Float64(c / b)); 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.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 78.4%
Taylor expanded in b around -inf 66.2%
*-commutative66.2%
Simplified66.2%
if -4.999999999999985e-310 < b Initial program 31.9%
Taylor expanded in b around inf 68.0%
Final simplification67.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* -0.6666666666666666 (/ b a)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5d-310)) then
tmp = (-0.6666666666666666d0) * (b / a)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = -0.6666666666666666 * (b / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(-0.6666666666666666 * Float64(b / a)); else tmp = Float64(Float64(c * -0.5) / b); 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 = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 78.4%
Taylor expanded in b around -inf 66.2%
*-commutative66.2%
Simplified66.2%
if -4.999999999999985e-310 < b Initial program 31.9%
fma-neg31.9%
associate-*l*31.9%
distribute-lft-neg-in31.9%
metadata-eval31.9%
*-commutative31.9%
associate-*r*31.9%
add-cube-cbrt27.6%
pow328.4%
associate-*r*28.3%
*-commutative28.3%
metadata-eval28.3%
distribute-lft-neg-in28.3%
associate-*l*28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
metadata-eval28.4%
Applied egg-rr28.4%
Taylor expanded in b around inf 68.0%
associate-*r/68.0%
Simplified68.0%
Final simplification67.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (* b -0.6666666666666666) a) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5d-310)) then
tmp = (b * (-0.6666666666666666d0)) / a
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (b * -0.6666666666666666) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(b * -0.6666666666666666) / a); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (b * -0.6666666666666666) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 78.4%
Taylor expanded in b around -inf 66.2%
*-commutative66.2%
associate-*l/66.3%
Simplified66.3%
if -4.999999999999985e-310 < b Initial program 31.9%
fma-neg31.9%
associate-*l*31.9%
distribute-lft-neg-in31.9%
metadata-eval31.9%
*-commutative31.9%
associate-*r*31.9%
add-cube-cbrt27.6%
pow328.4%
associate-*r*28.3%
*-commutative28.3%
metadata-eval28.3%
distribute-lft-neg-in28.3%
associate-*l*28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
metadata-eval28.4%
Applied egg-rr28.4%
Taylor expanded in b around inf 68.0%
associate-*r/68.0%
Simplified68.0%
Final simplification67.2%
(FPCore (a b c) :precision binary64 (* -0.5 (/ c b)))
double code(double a, double b, double c) {
return -0.5 * (c / b);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-0.5d0) * (c / b)
end function
public static double code(double a, double b, double c) {
return -0.5 * (c / b);
}
def code(a, b, c): return -0.5 * (c / b)
function code(a, b, c) return Float64(-0.5 * Float64(c / b)) end
function tmp = code(a, b, c) tmp = -0.5 * (c / b); end
code[a_, b_, c_] := N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.5 \cdot \frac{c}{b}
\end{array}
Initial program 54.6%
Taylor expanded in b around inf 35.9%
Final simplification35.9%
herbie shell --seed 2024010
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))