?

Average Error: 0.0 → 0.0
Time: 5.9s
Precision: binary64
Cost: 448

?

\[\left(\left(\left(56789 \leq a \land a \leq 98765\right) \land \left(0 \leq b \land b \leq 1\right)\right) \land \left(0 \leq c \land c \leq 0.0016773\right)\right) \land \left(0 \leq d \land d \leq 0.0016773\right)\]
\[a \cdot \left(\left(b + c\right) + d\right) \]
\[a \cdot \left(\left(b + c\right) + d\right) \]
(FPCore (a b c d) :precision binary64 (* a (+ (+ b c) d)))
(FPCore (a b c d) :precision binary64 (* a (+ (+ b c) d)))
double code(double a, double b, double c, double d) {
	return a * ((b + c) + d);
}
double code(double a, double b, double c, double d) {
	return a * ((b + c) + d);
}
real(8) function code(a, b, c, d)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: d
    code = a * ((b + c) + d)
end function
real(8) function code(a, b, c, d)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: d
    code = a * ((b + c) + d)
end function
public static double code(double a, double b, double c, double d) {
	return a * ((b + c) + d);
}
public static double code(double a, double b, double c, double d) {
	return a * ((b + c) + d);
}
def code(a, b, c, d):
	return a * ((b + c) + d)
def code(a, b, c, d):
	return a * ((b + c) + d)
function code(a, b, c, d)
	return Float64(a * Float64(Float64(b + c) + d))
end
function code(a, b, c, d)
	return Float64(a * Float64(Float64(b + c) + d))
end
function tmp = code(a, b, c, d)
	tmp = a * ((b + c) + d);
end
function tmp = code(a, b, c, d)
	tmp = a * ((b + c) + d);
end
code[a_, b_, c_, d_] := N[(a * N[(N[(b + c), $MachinePrecision] + d), $MachinePrecision]), $MachinePrecision]
code[a_, b_, c_, d_] := N[(a * N[(N[(b + c), $MachinePrecision] + d), $MachinePrecision]), $MachinePrecision]
a \cdot \left(\left(b + c\right) + d\right)
a \cdot \left(\left(b + c\right) + d\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[a \cdot b + a \cdot \left(c + d\right) \]

Derivation?

  1. Initial program 0.0

    \[a \cdot \left(\left(b + c\right) + d\right) \]
  2. Final simplification0.0

    \[\leadsto a \cdot \left(\left(b + c\right) + d\right) \]

Alternatives

Alternative 1
Error30.8
Cost1512
\[\begin{array}{l} \mathbf{if}\;b \leq 6.6 \cdot 10^{-288}:\\ \;\;\;\;a \cdot c\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-266}:\\ \;\;\;\;a \cdot d\\ \mathbf{elif}\;b \leq 1.26 \cdot 10^{-236}:\\ \;\;\;\;a \cdot c\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{-228}:\\ \;\;\;\;a \cdot d\\ \mathbf{elif}\;b \leq 3.3 \cdot 10^{-207}:\\ \;\;\;\;a \cdot c\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-173}:\\ \;\;\;\;a \cdot d\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{-148}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;b \leq 3.4 \cdot 10^{-132}:\\ \;\;\;\;a \cdot c\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-79}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;b \leq 2.75 \cdot 10^{-70}:\\ \;\;\;\;a \cdot d\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
Alternative 2
Error13.5
Cost717
\[\begin{array}{l} \mathbf{if}\;d \leq 6.4 \cdot 10^{-142} \lor \neg \left(d \leq 1.35 \cdot 10^{-131}\right) \land d \leq 6 \cdot 10^{-90}:\\ \;\;\;\;a \cdot \left(b + c\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot d\\ \end{array} \]
Alternative 3
Error9.8
Cost717
\[\begin{array}{l} \mathbf{if}\;d \leq 1.65 \cdot 10^{-149} \lor \neg \left(d \leq 3.8 \cdot 10^{-131}\right) \land d \leq 1.65 \cdot 10^{-124}:\\ \;\;\;\;a \cdot \left(b + c\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(c + d\right)\\ \end{array} \]
Alternative 4
Error10.4
Cost716
\[\begin{array}{l} t_0 := a \cdot \left(b + d\right)\\ \mathbf{if}\;c \leq 10^{-163}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq 1.25 \cdot 10^{-135}:\\ \;\;\;\;a \cdot \left(c + d\right)\\ \mathbf{elif}\;c \leq 4.4 \cdot 10^{-115}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b + c\right)\\ \end{array} \]
Alternative 5
Error30.5
Cost324
\[\begin{array}{l} \mathbf{if}\;c \leq 10^{-163}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot c\\ \end{array} \]
Alternative 6
Error40.8
Cost192
\[a \cdot b \]

Error

Reproduce?

herbie shell --seed 2023018 
(FPCore (a b c d)
  :name "Expression, p14"
  :precision binary64
  :pre (and (and (and (and (<= 56789.0 a) (<= a 98765.0)) (and (<= 0.0 b) (<= b 1.0))) (and (<= 0.0 c) (<= c 0.0016773))) (and (<= 0.0 d) (<= d 0.0016773)))

  :herbie-target
  (+ (* a b) (* a (+ c d)))

  (* a (+ (+ b c) d)))