
(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 12 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.4e+125)
(/ (/ (* b -2.0) a) 3.0)
(if (<= b 6.2e-103)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(/ (* c (+ -0.5 (* a (* (/ c (* b b)) -0.375)))) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.4e+125) {
tmp = ((b * -2.0) / a) / 3.0;
} else if (b <= 6.2e-103) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / 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+125)) then
tmp = ((b * (-2.0d0)) / a) / 3.0d0
else if (b <= 6.2d-103) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
else
tmp = (c * ((-0.5d0) + (a * ((c / (b * b)) * (-0.375d0))))) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.4e+125) {
tmp = ((b * -2.0) / a) / 3.0;
} else if (b <= 6.2e-103) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.4e+125: tmp = ((b * -2.0) / a) / 3.0 elif b <= 6.2e-103: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) else: tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.4e+125) tmp = Float64(Float64(Float64(b * -2.0) / a) / 3.0); elseif (b <= 6.2e-103) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * Float64(-0.5 + Float64(a * Float64(Float64(c / Float64(b * b)) * -0.375)))) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.4e+125) tmp = ((b * -2.0) / a) / 3.0; elseif (b <= 6.2e-103) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); else tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.4e+125], N[(N[(N[(b * -2.0), $MachinePrecision] / a), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[b, 6.2e-103], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * N[(-0.5 + N[(a * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{+125}:\\
\;\;\;\;\frac{\frac{b \cdot -2}{a}}{3}\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{-103}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{b \cdot b} \cdot -0.375\right)\right)}{b}\\
\end{array}
\end{array}
if b < -2.4e125Initial program 51.8%
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6451.8
Applied egg-rr51.8%
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6451.8
Applied egg-rr51.8%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-eval51.9
Applied egg-rr51.9%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.1
Simplified97.1%
if -2.4e125 < b < 6.2000000000000003e-103Initial program 81.9%
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.9
Applied egg-rr81.9%
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6481.9
Applied egg-rr81.9%
if 6.2000000000000003e-103 < b Initial program 11.9%
Taylor expanded in b around inf
/-lowering-/.f64N/A
Simplified92.1%
Taylor expanded in c around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6494.4
Simplified94.4%
Final simplification90.1%
(FPCore (a b c)
:precision binary64
(if (<= b -2.3e+119)
(/ (/ (* b -2.0) a) 3.0)
(if (<= b 2.2e-102)
(* (/ -0.3333333333333333 a) (- b (sqrt (+ (* b b) (* a (* c -3.0))))))
(/ (* c (+ -0.5 (* a (* (/ c (* b b)) -0.375)))) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.3e+119) {
tmp = ((b * -2.0) / a) / 3.0;
} else if (b <= 2.2e-102) {
tmp = (-0.3333333333333333 / a) * (b - sqrt(((b * b) + (a * (c * -3.0)))));
} else {
tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / 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.3d+119)) then
tmp = ((b * (-2.0d0)) / a) / 3.0d0
else if (b <= 2.2d-102) then
tmp = ((-0.3333333333333333d0) / a) * (b - sqrt(((b * b) + (a * (c * (-3.0d0))))))
else
tmp = (c * ((-0.5d0) + (a * ((c / (b * b)) * (-0.375d0))))) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.3e+119) {
tmp = ((b * -2.0) / a) / 3.0;
} else if (b <= 2.2e-102) {
tmp = (-0.3333333333333333 / a) * (b - Math.sqrt(((b * b) + (a * (c * -3.0)))));
} else {
tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.3e+119: tmp = ((b * -2.0) / a) / 3.0 elif b <= 2.2e-102: tmp = (-0.3333333333333333 / a) * (b - math.sqrt(((b * b) + (a * (c * -3.0))))) else: tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.3e+119) tmp = Float64(Float64(Float64(b * -2.0) / a) / 3.0); elseif (b <= 2.2e-102) tmp = Float64(Float64(-0.3333333333333333 / a) * Float64(b - sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -3.0)))))); else tmp = Float64(Float64(c * Float64(-0.5 + Float64(a * Float64(Float64(c / Float64(b * b)) * -0.375)))) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.3e+119) tmp = ((b * -2.0) / a) / 3.0; elseif (b <= 2.2e-102) tmp = (-0.3333333333333333 / a) * (b - sqrt(((b * b) + (a * (c * -3.0))))); else tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.3e+119], N[(N[(N[(b * -2.0), $MachinePrecision] / a), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[b, 2.2e-102], N[(N[(-0.3333333333333333 / a), $MachinePrecision] * N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * N[(-0.5 + N[(a * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+119}:\\
\;\;\;\;\frac{\frac{b \cdot -2}{a}}{3}\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{-102}:\\
\;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{b \cdot b} \cdot -0.375\right)\right)}{b}\\
\end{array}
\end{array}
if b < -2.3000000000000001e119Initial program 52.5%
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6452.5
Applied egg-rr52.5%
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6452.5
Applied egg-rr52.5%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-eval52.6
Applied egg-rr52.6%
Taylor expanded in b around -inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.1
Simplified97.1%
if -2.3000000000000001e119 < b < 2.20000000000000013e-102Initial program 81.7%
Applied egg-rr81.7%
if 2.20000000000000013e-102 < b Initial program 11.9%
Taylor expanded in b around inf
/-lowering-/.f64N/A
Simplified92.1%
Taylor expanded in c around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6494.4
Simplified94.4%
Final simplification90.1%
(FPCore (a b c)
:precision binary64
(if (<= b -1.2e-77)
(/ (* b (- (/ (* (* a (/ c b)) (- 0.0 -1.5)) b) 2.0)) (* a 3.0))
(if (<= b 1.4e-102)
(/ (/ (- (sqrt (* c (* a -3.0))) b) a) 3.0)
(/ (* c (+ -0.5 (* a (* (/ c (* b b)) -0.375)))) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.2e-77) {
tmp = (b * ((((a * (c / b)) * (0.0 - -1.5)) / b) - 2.0)) / (a * 3.0);
} else if (b <= 1.4e-102) {
tmp = ((sqrt((c * (a * -3.0))) - b) / a) / 3.0;
} else {
tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / 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.2d-77)) then
tmp = (b * ((((a * (c / b)) * (0.0d0 - (-1.5d0))) / b) - 2.0d0)) / (a * 3.0d0)
else if (b <= 1.4d-102) then
tmp = ((sqrt((c * (a * (-3.0d0)))) - b) / a) / 3.0d0
else
tmp = (c * ((-0.5d0) + (a * ((c / (b * b)) * (-0.375d0))))) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.2e-77) {
tmp = (b * ((((a * (c / b)) * (0.0 - -1.5)) / b) - 2.0)) / (a * 3.0);
} else if (b <= 1.4e-102) {
tmp = ((Math.sqrt((c * (a * -3.0))) - b) / a) / 3.0;
} else {
tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.2e-77: tmp = (b * ((((a * (c / b)) * (0.0 - -1.5)) / b) - 2.0)) / (a * 3.0) elif b <= 1.4e-102: tmp = ((math.sqrt((c * (a * -3.0))) - b) / a) / 3.0 else: tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.2e-77) tmp = Float64(Float64(b * Float64(Float64(Float64(Float64(a * Float64(c / b)) * Float64(0.0 - -1.5)) / b) - 2.0)) / Float64(a * 3.0)); elseif (b <= 1.4e-102) tmp = Float64(Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / a) / 3.0); else tmp = Float64(Float64(c * Float64(-0.5 + Float64(a * Float64(Float64(c / Float64(b * b)) * -0.375)))) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.2e-77) tmp = (b * ((((a * (c / b)) * (0.0 - -1.5)) / b) - 2.0)) / (a * 3.0); elseif (b <= 1.4e-102) tmp = ((sqrt((c * (a * -3.0))) - b) / a) / 3.0; else tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.2e-77], N[(N[(b * N[(N[(N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] * N[(0.0 - -1.5), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.4e-102], N[(N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] / 3.0), $MachinePrecision], N[(N[(c * N[(-0.5 + N[(a * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{-77}:\\
\;\;\;\;\frac{b \cdot \left(\frac{\left(a \cdot \frac{c}{b}\right) \cdot \left(0 - -1.5\right)}{b} - 2\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{-102}:\\
\;\;\;\;\frac{\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a}}{3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{b \cdot b} \cdot -0.375\right)\right)}{b}\\
\end{array}
\end{array}
if b < -1.19999999999999995e-77Initial program 65.2%
Taylor expanded in b around -inf
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Simplified86.2%
if -1.19999999999999995e-77 < b < 1.40000000000000006e-102Initial program 78.2%
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.2
Applied egg-rr78.2%
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6478.2
Applied egg-rr78.2%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-eval78.4
Applied egg-rr78.4%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6476.0
Simplified76.0%
if 1.40000000000000006e-102 < b Initial program 11.9%
Taylor expanded in b around inf
/-lowering-/.f64N/A
Simplified92.1%
Taylor expanded in c around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6494.4
Simplified94.4%
Final simplification86.5%
(FPCore (a b c)
:precision binary64
(if (<= b -2.2e-79)
(/ (* b (- (/ (* (* a (/ c b)) (- 0.0 -1.5)) b) 2.0)) (* a 3.0))
(if (<= b 6e-111)
(/ (- (sqrt (* -3.0 (* a c))) b) (* a 3.0))
(/ (* c (+ -0.5 (* a (* (/ c (* b b)) -0.375)))) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.2e-79) {
tmp = (b * ((((a * (c / b)) * (0.0 - -1.5)) / b) - 2.0)) / (a * 3.0);
} else if (b <= 6e-111) {
tmp = (sqrt((-3.0 * (a * c))) - b) / (a * 3.0);
} else {
tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / 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.2d-79)) then
tmp = (b * ((((a * (c / b)) * (0.0d0 - (-1.5d0))) / b) - 2.0d0)) / (a * 3.0d0)
else if (b <= 6d-111) then
tmp = (sqrt(((-3.0d0) * (a * c))) - b) / (a * 3.0d0)
else
tmp = (c * ((-0.5d0) + (a * ((c / (b * b)) * (-0.375d0))))) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.2e-79) {
tmp = (b * ((((a * (c / b)) * (0.0 - -1.5)) / b) - 2.0)) / (a * 3.0);
} else if (b <= 6e-111) {
tmp = (Math.sqrt((-3.0 * (a * c))) - b) / (a * 3.0);
} else {
tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.2e-79: tmp = (b * ((((a * (c / b)) * (0.0 - -1.5)) / b) - 2.0)) / (a * 3.0) elif b <= 6e-111: tmp = (math.sqrt((-3.0 * (a * c))) - b) / (a * 3.0) else: tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.2e-79) tmp = Float64(Float64(b * Float64(Float64(Float64(Float64(a * Float64(c / b)) * Float64(0.0 - -1.5)) / b) - 2.0)) / Float64(a * 3.0)); elseif (b <= 6e-111) tmp = Float64(Float64(sqrt(Float64(-3.0 * Float64(a * c))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * Float64(-0.5 + Float64(a * Float64(Float64(c / Float64(b * b)) * -0.375)))) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.2e-79) tmp = (b * ((((a * (c / b)) * (0.0 - -1.5)) / b) - 2.0)) / (a * 3.0); elseif (b <= 6e-111) tmp = (sqrt((-3.0 * (a * c))) - b) / (a * 3.0); else tmp = (c * (-0.5 + (a * ((c / (b * b)) * -0.375)))) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.2e-79], N[(N[(b * N[(N[(N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] * N[(0.0 - -1.5), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-111], N[(N[(N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * N[(-0.5 + N[(a * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{-79}:\\
\;\;\;\;\frac{b \cdot \left(\frac{\left(a \cdot \frac{c}{b}\right) \cdot \left(0 - -1.5\right)}{b} - 2\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-111}:\\
\;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{b \cdot b} \cdot -0.375\right)\right)}{b}\\
\end{array}
\end{array}
if b < -2.1999999999999999e-79Initial program 65.2%
Taylor expanded in b around -inf
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Simplified86.2%
if -2.1999999999999999e-79 < b < 6.00000000000000016e-111Initial program 78.2%
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.2
Applied egg-rr78.2%
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6478.2
Applied egg-rr78.2%
Taylor expanded in b around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6475.8
Simplified75.8%
if 6.00000000000000016e-111 < b Initial program 11.9%
Taylor expanded in b around inf
/-lowering-/.f64N/A
Simplified92.1%
Taylor expanded in c around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6494.4
Simplified94.4%
Final simplification86.5%
(FPCore (a b c) :precision binary64 (if (<= b -2e-310) (+ (/ (* b -0.6666666666666666) a) (/ (* c 0.5) b)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e-310) {
tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / 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 <= (-2d-310)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + ((c * 0.5d0) / 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 <= -2e-310) {
tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2e-310: tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2e-310) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(Float64(c * 0.5) / 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 <= -2e-310) tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2e-310], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(N[(c * 0.5), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c \cdot 0.5}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.999999999999994e-310Initial program 70.3%
--lowering--.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.3
Applied egg-rr70.3%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Simplified50.1%
Taylor expanded in c around 0
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6464.4
Simplified64.4%
if -1.999999999999994e-310 < b Initial program 21.3%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.4
Simplified80.4%
(FPCore (a b c) :precision binary64 (if (<= b -2e-310) (/ (* b -2.0) (* a 3.0)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e-310) {
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-310)) 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-310) {
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-310: 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-310) 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-310) 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-310], 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^{-310}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.999999999999994e-310Initial program 70.3%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f6464.3
Simplified64.3%
if -1.999999999999994e-310 < b Initial program 21.3%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.4
Simplified80.4%
Final simplification70.9%
(FPCore (a b c) :precision binary64 (if (<= b 9e-308) (/ (* b -0.6666666666666666) a) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 9e-308) {
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 <= 9d-308) 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 <= 9e-308) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 9e-308: tmp = (b * -0.6666666666666666) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 9e-308) 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 <= 9e-308) tmp = (b * -0.6666666666666666) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 9e-308], 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 9 \cdot 10^{-308}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 9.00000000000000017e-308Initial program 70.3%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6464.1
Simplified64.1%
Applied egg-rr64.3%
if 9.00000000000000017e-308 < b Initial program 21.3%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.4
Simplified80.4%
(FPCore (a b c) :precision binary64 (if (<= b 1.72e-37) (/ (* b -0.6666666666666666) a) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.72e-37) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 1.72d-37) then
tmp = (b * (-0.6666666666666666d0)) / a
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.72e-37) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.72e-37: tmp = (b * -0.6666666666666666) / a else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.72e-37) tmp = Float64(Float64(b * -0.6666666666666666) / a); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.72e-37) tmp = (b * -0.6666666666666666) / a; else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.72e-37], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.72 \cdot 10^{-37}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < 1.72000000000000008e-37Initial program 68.4%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6456.1
Simplified56.1%
Applied egg-rr56.3%
if 1.72000000000000008e-37 < b Initial program 11.7%
Taylor expanded in b around inf
unpow2N/A
*-lowering-*.f646.2
Simplified6.2%
*-commutativeN/A
associate-/r*N/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
+-inversesN/A
metadata-evalN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
div0N/A
metadata-evalN/A
+-inversesN/A
unsub-negN/A
rem-square-sqrtN/A
sqrt-prodN/A
+-commutativeN/A
metadata-evalN/A
metadata-evalN/A
frac-2negN/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
Applied egg-rr28.3%
(FPCore (a b c) :precision binary64 (if (<= b 2.7e-37) (/ b (/ a -0.6666666666666666)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= 2.7e-37) {
tmp = b / (a / -0.6666666666666666);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 2.7d-37) then
tmp = b / (a / (-0.6666666666666666d0))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 2.7e-37) {
tmp = b / (a / -0.6666666666666666);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 2.7e-37: tmp = b / (a / -0.6666666666666666) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 2.7e-37) tmp = Float64(b / Float64(a / -0.6666666666666666)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 2.7e-37) tmp = b / (a / -0.6666666666666666); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 2.7e-37], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.7 \cdot 10^{-37}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < 2.70000000000000016e-37Initial program 68.4%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6456.1
Simplified56.1%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6456.2
Applied egg-rr56.2%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6456.2
Applied egg-rr56.2%
if 2.70000000000000016e-37 < b Initial program 11.7%
Taylor expanded in b around inf
unpow2N/A
*-lowering-*.f646.2
Simplified6.2%
*-commutativeN/A
associate-/r*N/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
+-inversesN/A
metadata-evalN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
div0N/A
metadata-evalN/A
+-inversesN/A
unsub-negN/A
rem-square-sqrtN/A
sqrt-prodN/A
+-commutativeN/A
metadata-evalN/A
metadata-evalN/A
frac-2negN/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
Applied egg-rr28.3%
(FPCore (a b c) :precision binary64 (if (<= b 1.72e-37) (/ -0.6666666666666666 (/ a b)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.72e-37) {
tmp = -0.6666666666666666 / (a / b);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 1.72d-37) then
tmp = (-0.6666666666666666d0) / (a / b)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.72e-37) {
tmp = -0.6666666666666666 / (a / b);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.72e-37: tmp = -0.6666666666666666 / (a / b) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.72e-37) tmp = Float64(-0.6666666666666666 / Float64(a / b)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.72e-37) tmp = -0.6666666666666666 / (a / b); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.72e-37], N[(-0.6666666666666666 / N[(a / b), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.72 \cdot 10^{-37}:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < 1.72000000000000008e-37Initial program 68.4%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6456.1
Simplified56.1%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6456.2
Applied egg-rr56.2%
if 1.72000000000000008e-37 < b Initial program 11.7%
Taylor expanded in b around inf
unpow2N/A
*-lowering-*.f646.2
Simplified6.2%
*-commutativeN/A
associate-/r*N/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
+-inversesN/A
metadata-evalN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
div0N/A
metadata-evalN/A
+-inversesN/A
unsub-negN/A
rem-square-sqrtN/A
sqrt-prodN/A
+-commutativeN/A
metadata-evalN/A
metadata-evalN/A
frac-2negN/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
Applied egg-rr28.3%
(FPCore (a b c) :precision binary64 (if (<= b 1.72e-37) (* b (/ -0.6666666666666666 a)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.72e-37) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 1.72d-37) then
tmp = b * ((-0.6666666666666666d0) / a)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.72e-37) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.72e-37: tmp = b * (-0.6666666666666666 / a) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.72e-37) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.72e-37) tmp = b * (-0.6666666666666666 / a); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.72e-37], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.72 \cdot 10^{-37}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < 1.72000000000000008e-37Initial program 68.4%
Taylor expanded in b around -inf
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6456.1
Simplified56.1%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6456.2
Applied egg-rr56.2%
if 1.72000000000000008e-37 < b Initial program 11.7%
Taylor expanded in b around inf
unpow2N/A
*-lowering-*.f646.2
Simplified6.2%
*-commutativeN/A
associate-/r*N/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
+-inversesN/A
metadata-evalN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
div0N/A
metadata-evalN/A
+-inversesN/A
unsub-negN/A
rem-square-sqrtN/A
sqrt-prodN/A
+-commutativeN/A
metadata-evalN/A
metadata-evalN/A
frac-2negN/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
Applied egg-rr28.3%
(FPCore (a b c) :precision binary64 0.0)
double code(double a, double b, double c) {
return 0.0;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = 0.0d0
end function
public static double code(double a, double b, double c) {
return 0.0;
}
def code(a, b, c): return 0.0
function code(a, b, c) return 0.0 end
function tmp = code(a, b, c) tmp = 0.0; end
code[a_, b_, c_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 50.2%
Taylor expanded in b around inf
unpow2N/A
*-lowering-*.f6427.8
Simplified27.8%
*-commutativeN/A
associate-/r*N/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
+-inversesN/A
metadata-evalN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
div0N/A
metadata-evalN/A
+-inversesN/A
unsub-negN/A
rem-square-sqrtN/A
sqrt-prodN/A
+-commutativeN/A
metadata-evalN/A
metadata-evalN/A
frac-2negN/A
+-commutativeN/A
sqrt-prodN/A
rem-square-sqrtN/A
unsub-negN/A
Applied egg-rr10.9%
herbie shell --seed 2024191
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))