
(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.35e+67)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 1.28e-73)
(/ (- (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 <= -2.35e+67) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.28e-73) {
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 <= (-2.35d+67)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 1.28d-73) 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 <= -2.35e+67) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.28e-73) {
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 <= -2.35e+67: tmp = ((b * 2.0) / a) / -3.0 elif b <= 1.28e-73: 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 <= -2.35e+67) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 1.28e-73) 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 <= -2.35e+67) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 1.28e-73) 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, -2.35e+67], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 1.28e-73], 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 -2.35 \cdot 10^{+67}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 1.28 \cdot 10^{-73}:\\
\;\;\;\;\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 < -2.35000000000000009e67Initial program 46.8%
Applied egg-rr47.0%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.8%
Simplified96.8%
if -2.35000000000000009e67 < b < 1.2799999999999999e-73Initial program 90.2%
if 1.2799999999999999e-73 < b Initial program 16.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.4%
Simplified90.4%
Final simplification91.8%
(FPCore (a b c)
:precision binary64
(if (<= b -7.5e+74)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 2.6e-73)
(/ (/ (- b (sqrt (+ (* b b) (* -3.0 (* a c))))) -3.0) a)
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7.5e+74) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 2.6e-73) {
tmp = ((b - sqrt(((b * b) + (-3.0 * (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 <= (-7.5d+74)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 2.6d-73) then
tmp = ((b - sqrt(((b * b) + ((-3.0d0) * (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 <= -7.5e+74) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 2.6e-73) {
tmp = ((b - Math.sqrt(((b * b) + (-3.0 * (a * c))))) / -3.0) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7.5e+74: tmp = ((b * 2.0) / a) / -3.0 elif b <= 2.6e-73: tmp = ((b - math.sqrt(((b * b) + (-3.0 * (a * c))))) / -3.0) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -7.5e+74) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 2.6e-73) tmp = Float64(Float64(Float64(b - sqrt(Float64(Float64(b * b) + Float64(-3.0 * Float64(a * 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 <= -7.5e+74) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 2.6e-73) tmp = ((b - sqrt(((b * b) + (-3.0 * (a * c))))) / -3.0) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7.5e+74], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 2.6e-73], N[(N[(N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.5 \cdot 10^{+74}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-73}:\\
\;\;\;\;\frac{\frac{b - \sqrt{b \cdot b + -3 \cdot \left(a \cdot c\right)}}{-3}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -7.5e74Initial program 45.9%
Applied egg-rr46.0%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.7%
Simplified96.7%
if -7.5e74 < b < 2.6000000000000001e-73Initial program 90.3%
Applied egg-rr90.1%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6490.3%
Applied egg-rr90.3%
if 2.6000000000000001e-73 < b Initial program 16.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.4%
Simplified90.4%
(FPCore (a b c)
:precision binary64
(if (<= b -4.2e+89)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 4e-76)
(* (/ (- b (sqrt (+ (* b b) (* -3.0 (* a c))))) a) -0.3333333333333333)
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.2e+89) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 4e-76) {
tmp = ((b - sqrt(((b * b) + (-3.0 * (a * c))))) / a) * -0.3333333333333333;
} 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 <= (-4.2d+89)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 4d-76) then
tmp = ((b - sqrt(((b * b) + ((-3.0d0) * (a * c))))) / a) * (-0.3333333333333333d0)
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 <= -4.2e+89) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 4e-76) {
tmp = ((b - Math.sqrt(((b * b) + (-3.0 * (a * c))))) / a) * -0.3333333333333333;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.2e+89: tmp = ((b * 2.0) / a) / -3.0 elif b <= 4e-76: tmp = ((b - math.sqrt(((b * b) + (-3.0 * (a * c))))) / a) * -0.3333333333333333 else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.2e+89) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 4e-76) tmp = Float64(Float64(Float64(b - sqrt(Float64(Float64(b * b) + Float64(-3.0 * Float64(a * c))))) / a) * -0.3333333333333333); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.2e+89) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 4e-76) tmp = ((b - sqrt(((b * b) + (-3.0 * (a * c))))) / a) * -0.3333333333333333; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.2e+89], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 4e-76], N[(N[(N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.2 \cdot 10^{+89}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 4 \cdot 10^{-76}:\\
\;\;\;\;\frac{b - \sqrt{b \cdot b + -3 \cdot \left(a \cdot c\right)}}{a} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.19999999999999972e89Initial program 43.0%
Applied egg-rr43.1%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.5%
Simplified96.5%
if -4.19999999999999972e89 < b < 3.99999999999999971e-76Initial program 90.5%
Applied egg-rr90.4%
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval90.2%
Applied egg-rr90.2%
if 3.99999999999999971e-76 < b Initial program 16.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.4%
Simplified90.4%
(FPCore (a b c)
:precision binary64
(if (<= b -6.8e-44)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 1.4e-74)
(/ (- (sqrt (* a (* -3.0 c))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -6.8e-44) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.4e-74) {
tmp = (sqrt((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 <= (-6.8d-44)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 1.4d-74) then
tmp = (sqrt((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 <= -6.8e-44) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.4e-74) {
tmp = (Math.sqrt((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 <= -6.8e-44: tmp = ((b * 2.0) / a) / -3.0 elif b <= 1.4e-74: tmp = (math.sqrt((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 <= -6.8e-44) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 1.4e-74) tmp = Float64(Float64(sqrt(Float64(a * Float64(-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 <= -6.8e-44) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 1.4e-74) tmp = (sqrt((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, -6.8e-44], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 1.4e-74], N[(N[(N[Sqrt[N[(a * N[(-3.0 * 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 -6.8 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{-74}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(-3 \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -6.80000000000000033e-44Initial program 60.2%
Applied egg-rr60.3%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.5%
Simplified90.5%
if -6.80000000000000033e-44 < b < 1.39999999999999994e-74Initial program 87.7%
Taylor expanded in b around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.5%
Simplified84.5%
if 1.39999999999999994e-74 < b Initial program 16.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.4%
Simplified90.4%
Final simplification88.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5e-44)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 5.8e-79)
(/ (/ (- b (sqrt (* c (* a -3.0)))) a) -3.0)
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-44) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 5.8e-79) {
tmp = ((b - sqrt((c * (a * -3.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 <= (-5d-44)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 5.8d-79) then
tmp = ((b - sqrt((c * (a * (-3.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 <= -5e-44) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 5.8e-79) {
tmp = ((b - Math.sqrt((c * (a * -3.0)))) / a) / -3.0;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-44: tmp = ((b * 2.0) / a) / -3.0 elif b <= 5.8e-79: tmp = ((b - math.sqrt((c * (a * -3.0)))) / a) / -3.0 else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-44) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 5.8e-79) tmp = Float64(Float64(Float64(b - sqrt(Float64(c * Float64(a * -3.0)))) / 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 <= -5e-44) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 5.8e-79) tmp = ((b - sqrt((c * (a * -3.0)))) / a) / -3.0; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-44], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 5.8e-79], N[(N[(N[(b - N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -5.00000000000000039e-44Initial program 60.2%
Applied egg-rr60.3%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.5%
Simplified90.5%
if -5.00000000000000039e-44 < b < 5.8000000000000001e-79Initial program 87.7%
Applied egg-rr87.6%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.4%
Simplified84.4%
if 5.8000000000000001e-79 < b Initial program 16.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.4%
Simplified90.4%
(FPCore (a b c)
:precision binary64
(if (<= b -3.7e-44)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 1.26e-73)
(/ (- b (sqrt (* -3.0 (* a c)))) (* a -3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.7e-44) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.26e-73) {
tmp = (b - sqrt((-3.0 * (a * c)))) / (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.7d-44)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 1.26d-73) then
tmp = (b - sqrt(((-3.0d0) * (a * c)))) / (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.7e-44) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.26e-73) {
tmp = (b - Math.sqrt((-3.0 * (a * c)))) / (a * -3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.7e-44: tmp = ((b * 2.0) / a) / -3.0 elif b <= 1.26e-73: tmp = (b - math.sqrt((-3.0 * (a * c)))) / (a * -3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.7e-44) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 1.26e-73) tmp = Float64(Float64(b - sqrt(Float64(-3.0 * Float64(a * c)))) / 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.7e-44) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 1.26e-73) tmp = (b - sqrt((-3.0 * (a * c)))) / (a * -3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.7e-44], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 1.26e-73], N[(N[(b - N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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.7 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 1.26 \cdot 10^{-73}:\\
\;\;\;\;\frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{a \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -3.7e-44Initial program 60.2%
Applied egg-rr60.3%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.5%
Simplified90.5%
if -3.7e-44 < b < 1.26000000000000001e-73Initial program 87.7%
Applied egg-rr87.6%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.4%
Simplified84.4%
associate-/r*N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.4%
Applied egg-rr84.4%
if 1.26000000000000001e-73 < b Initial program 16.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.4%
Simplified90.4%
Final simplification88.6%
(FPCore (a b c)
:precision binary64
(if (<= b -1.8e-43)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 1.28e-73)
(/ (* -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 <= -1.8e-43) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.28e-73) {
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 <= (-1.8d-43)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 1.28d-73) 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 <= -1.8e-43) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.28e-73) {
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 <= -1.8e-43: tmp = ((b * 2.0) / a) / -3.0 elif b <= 1.28e-73: 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 <= -1.8e-43) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 1.28e-73) tmp = Float64(Float64(-0.3333333333333333 * 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 <= -1.8e-43) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 1.28e-73) 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, -1.8e-43], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 1.28e-73], N[(N[(-0.3333333333333333 * N[(b - N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 1.28 \cdot 10^{-73}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.7999999999999999e-43Initial program 60.2%
Applied egg-rr60.3%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.5%
Simplified90.5%
if -1.7999999999999999e-43 < b < 1.2799999999999999e-73Initial program 87.7%
Applied egg-rr87.6%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.4%
Simplified84.4%
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval84.2%
Applied egg-rr84.2%
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.4%
Applied egg-rr84.4%
if 1.2799999999999999e-73 < b Initial program 16.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.4%
Simplified90.4%
Final simplification88.6%
(FPCore (a b c)
:precision binary64
(if (<= b -6.6e-44)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 3.05e-75)
(/ -0.3333333333333333 (/ a (- b (sqrt (* -3.0 (* a c))))))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -6.6e-44) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 3.05e-75) {
tmp = -0.3333333333333333 / (a / (b - sqrt((-3.0 * (a * c)))));
} 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 <= (-6.6d-44)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 3.05d-75) then
tmp = (-0.3333333333333333d0) / (a / (b - sqrt(((-3.0d0) * (a * c)))))
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 <= -6.6e-44) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 3.05e-75) {
tmp = -0.3333333333333333 / (a / (b - Math.sqrt((-3.0 * (a * c)))));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -6.6e-44: tmp = ((b * 2.0) / a) / -3.0 elif b <= 3.05e-75: tmp = -0.3333333333333333 / (a / (b - math.sqrt((-3.0 * (a * c))))) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -6.6e-44) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 3.05e-75) tmp = Float64(-0.3333333333333333 / Float64(a / Float64(b - sqrt(Float64(-3.0 * Float64(a * c)))))); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -6.6e-44) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 3.05e-75) tmp = -0.3333333333333333 / (a / (b - sqrt((-3.0 * (a * c))))); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -6.6e-44], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 3.05e-75], N[(-0.3333333333333333 / N[(a / N[(b - N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 3.05 \cdot 10^{-75}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{a}{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -6.60000000000000011e-44Initial program 60.2%
Applied egg-rr60.3%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.5%
Simplified90.5%
if -6.60000000000000011e-44 < b < 3.05000000000000021e-75Initial program 87.7%
Applied egg-rr87.6%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.4%
Simplified84.4%
div-invN/A
*-commutativeN/A
clear-numN/A
div-invN/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6484.3%
Applied egg-rr84.3%
if 3.05000000000000021e-75 < b Initial program 16.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.4%
Simplified90.4%
(FPCore (a b c)
:precision binary64
(if (<= b -1.15e-43)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 2.6e-73)
(* -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 <= -1.15e-43) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 2.6e-73) {
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 <= (-1.15d-43)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 2.6d-73) 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 <= -1.15e-43) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 2.6e-73) {
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 <= -1.15e-43: tmp = ((b * 2.0) / a) / -3.0 elif b <= 2.6e-73: 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 <= -1.15e-43) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 2.6e-73) 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 <= -1.15e-43) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 2.6e-73) 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, -1.15e-43], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 2.6e-73], 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 -1.15 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-73}:\\
\;\;\;\;-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 < -1.1499999999999999e-43Initial program 60.2%
Applied egg-rr60.3%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.5%
Simplified90.5%
if -1.1499999999999999e-43 < b < 2.6000000000000001e-73Initial program 87.7%
Applied egg-rr87.6%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.4%
Simplified84.4%
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval84.2%
Applied egg-rr84.2%
if 2.6000000000000001e-73 < b Initial program 16.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6490.4%
Simplified90.4%
Final simplification88.6%
(FPCore (a b c) :precision binary64 (if (<= b 1.7e-299) (/ (/ (* b 2.0) a) -3.0) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.7e-299) {
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 <= 1.7d-299) 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 <= 1.7e-299) {
tmp = ((b * 2.0) / a) / -3.0;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.7e-299: 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 <= 1.7e-299) tmp = Float64(Float64(Float64(b * 2.0) / 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 <= 1.7e-299) 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, 1.7e-299], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.7 \cdot 10^{-299}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 1.6999999999999999e-299Initial program 71.6%
Applied egg-rr71.5%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6463.1%
Simplified63.1%
if 1.6999999999999999e-299 < b Initial program 33.1%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.5%
Simplified70.5%
(FPCore (a b c) :precision binary64 (if (<= b 1.55e-299) (* (/ b a) -0.6666666666666666) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.55e-299) {
tmp = (b / a) * -0.6666666666666666;
} 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 <= 1.55d-299) then
tmp = (b / a) * (-0.6666666666666666d0)
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 <= 1.55e-299) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.55e-299: tmp = (b / a) * -0.6666666666666666 else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.55e-299) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.55e-299) tmp = (b / a) * -0.6666666666666666; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.55e-299], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.55 \cdot 10^{-299}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 1.55e-299Initial program 71.6%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6463.0%
Simplified63.0%
if 1.55e-299 < b Initial program 33.1%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.5%
Simplified70.5%
(FPCore (a b c) :precision binary64 (if (<= b 1.4e-299) (* (/ b a) -0.6666666666666666) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.4e-299) {
tmp = (b / a) * -0.6666666666666666;
} 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 <= 1.4d-299) then
tmp = (b / a) * (-0.6666666666666666d0)
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 <= 1.4e-299) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.4e-299: tmp = (b / a) * -0.6666666666666666 else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.4e-299) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.4e-299) tmp = (b / a) * -0.6666666666666666; else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.4e-299], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.4 \cdot 10^{-299}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 1.4000000000000001e-299Initial program 71.6%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6463.0%
Simplified63.0%
if 1.4000000000000001e-299 < b Initial program 33.1%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.5%
Simplified70.5%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6470.3%
Applied egg-rr70.3%
Final simplification66.9%
(FPCore (a b c) :precision binary64 (if (<= b 1.55e-299) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.55e-299) {
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 <= 1.55d-299) 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 <= 1.55e-299) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.55e-299: tmp = b * (-0.6666666666666666 / a) else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.55e-299) 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 <= 1.55e-299) tmp = b * (-0.6666666666666666 / a); else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.55e-299], 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 1.55 \cdot 10^{-299}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 1.55e-299Initial program 71.6%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6463.0%
Simplified63.0%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6462.9%
Applied egg-rr62.9%
if 1.55e-299 < b Initial program 33.1%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.5%
Simplified70.5%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6470.3%
Applied egg-rr70.3%
Final simplification66.8%
(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 51.3%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6431.2%
Simplified31.2%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6431.2%
Applied egg-rr31.2%
herbie shell --seed 2024192
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))