Average Error: 5.5 → 3.4
Time: 23.5s
Precision: 64
Internal Precision: 128
\[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
\[\begin{array}{l} \mathbf{if}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\ \;\;\;\;\left(\left(\left(y \cdot z\right) \cdot x\right) \cdot 18.0 - a \cdot 4.0\right) \cdot t + \left(c \cdot b - \left(\left(x \cdot 4.0\right) \cdot i + \left(\sqrt[3]{\left(k \cdot 27.0\right) \cdot j} \cdot \sqrt[3]{\left(k \cdot 27.0\right) \cdot j}\right) \cdot \sqrt[3]{\left(k \cdot 27.0\right) \cdot j}\right)\right)\\ \mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 9.87007768282815 \cdot 10^{+307}:\\ \;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \left(a \cdot 4.0\right) + \left(c \cdot b - \left(\left(x \cdot 4.0\right) \cdot i + 27.0 \cdot \left(k \cdot j\right)\right)\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Bits error versus j

Bits error versus k

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)) < -inf.0

    1. Initial program 60.3

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Simplified40.5

      \[\leadsto \color{blue}{\left(c \cdot b - \left(27.0 \cdot \left(k \cdot j\right) + \left(x \cdot 4.0\right) \cdot i\right)\right) + \left(\left(x \cdot 18.0\right) \cdot \left(y \cdot z\right) - a \cdot 4.0\right) \cdot t}\]
    3. Using strategy rm
    4. Applied associate-*r*40.5

      \[\leadsto \left(c \cdot b - \left(\color{blue}{\left(27.0 \cdot k\right) \cdot j} + \left(x \cdot 4.0\right) \cdot i\right)\right) + \left(\left(x \cdot 18.0\right) \cdot \left(y \cdot z\right) - a \cdot 4.0\right) \cdot t\]
    5. Taylor expanded around -inf 40.1

      \[\leadsto \left(c \cdot b - \left(\left(27.0 \cdot k\right) \cdot j + \left(x \cdot 4.0\right) \cdot i\right)\right) + \left(\color{blue}{18.0 \cdot \left(x \cdot \left(z \cdot y\right)\right)} - a \cdot 4.0\right) \cdot t\]
    6. Using strategy rm
    7. Applied add-cube-cbrt40.2

      \[\leadsto \left(c \cdot b - \left(\color{blue}{\left(\sqrt[3]{\left(27.0 \cdot k\right) \cdot j} \cdot \sqrt[3]{\left(27.0 \cdot k\right) \cdot j}\right) \cdot \sqrt[3]{\left(27.0 \cdot k\right) \cdot j}} + \left(x \cdot 4.0\right) \cdot i\right)\right) + \left(18.0 \cdot \left(x \cdot \left(z \cdot y\right)\right) - a \cdot 4.0\right) \cdot t\]

    if -inf.0 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)) < 9.87007768282815e+307

    1. Initial program 0.3

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]

    if 9.87007768282815e+307 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k))

    1. Initial program 59.0

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Simplified38.1

      \[\leadsto \color{blue}{\left(c \cdot b - \left(27.0 \cdot \left(k \cdot j\right) + \left(x \cdot 4.0\right) \cdot i\right)\right) + \left(\left(x \cdot 18.0\right) \cdot \left(y \cdot z\right) - a \cdot 4.0\right) \cdot t}\]
    3. Taylor expanded around 0 30.4

      \[\leadsto \left(c \cdot b - \left(27.0 \cdot \left(k \cdot j\right) + \left(x \cdot 4.0\right) \cdot i\right)\right) + \left(\color{blue}{0} - a \cdot 4.0\right) \cdot t\]
  3. Recombined 3 regimes into one program.
  4. Final simplification3.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\ \;\;\;\;\left(\left(\left(y \cdot z\right) \cdot x\right) \cdot 18.0 - a \cdot 4.0\right) \cdot t + \left(c \cdot b - \left(\left(x \cdot 4.0\right) \cdot i + \left(\sqrt[3]{\left(k \cdot 27.0\right) \cdot j} \cdot \sqrt[3]{\left(k \cdot 27.0\right) \cdot j}\right) \cdot \sqrt[3]{\left(k \cdot 27.0\right) \cdot j}\right)\right)\\ \mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 9.87007768282815 \cdot 10^{+307}:\\ \;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \left(a \cdot 4.0\right) + \left(c \cdot b - \left(\left(x \cdot 4.0\right) \cdot i + 27.0 \cdot \left(k \cdot j\right)\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019008 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1"
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))

Details

Time bar (total: 21.9s)Debug log

sample189.0ms

Algorithm
intervals

simplify87.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

87.0ms
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k))

prune25.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 3.6b

localize45.0ms

Local error

Found 4 expressions with local error:

4.0b
(* (* x 18.0) (* y z))
3.6b
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
0.2b
(* 27.0 (* k j))
0.0b
(- (* c b) (+ (* 27.0 (* k j)) (* (* x 4.0) i)))

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 49
Calls

4 calls. Slowest were:

11.0ms
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
5.0ms
(- (* c b) (+ (* 27.0 (* k j)) (* (* x 4.0) i)))
3.0ms
(* (* x 18.0) (* y z))

series153.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

65.0ms
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
60.0ms
(- (* c b) (+ (* 27.0 (* k j)) (* (* x 4.0) i)))
18.0ms
(* (* x 18.0) (* y z))
10.0ms
(* 27.0 (* k j))

simplify2.1s

Counts
22 → 61
Calls

22 calls. Slowest were:

563.0ms
(* (* (* (* x 18.0) (* x 18.0)) (* x 18.0)) (* (* (* y z) (* y z)) (* y z)))
359.0ms
(* (- (* (* (* x 18.0) (* y z)) (* (* x 18.0) (* y z))) (* (* a 4.0) (* a 4.0))) t)
271.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))

prune1.3s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 2.4b

localize13.0ms

Local error

Found 4 expressions with local error:

4.0b
(* (* x 18.0) (* y z))
3.6b
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
0.2b
(* (* 27.0 k) j)
0.0b
(- (* c b) (+ (* (* 27.0 k) j) (* (* x 4.0) i)))

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
4 → 49
Calls

4 calls. Slowest were:

11.0ms
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
5.0ms
(- (* c b) (+ (* (* 27.0 k) j) (* (* x 4.0) i)))
3.0ms
(* (* x 18.0) (* y z))

series212.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

85.0ms
(- (* c b) (+ (* (* 27.0 k) j) (* (* x 4.0) i)))
77.0ms
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
33.0ms
(* (* x 18.0) (* y z))
17.0ms
(* (* 27.0 k) j)

simplify2.1s

Counts
22 → 61
Calls

22 calls. Slowest were:

617.0ms
(* (* (* (* x 18.0) (* x 18.0)) (* x 18.0)) (* (* (* y z) (* y z)) (* y z)))
346.0ms
(* (- (* (* (* x 18.0) (* y z)) (* (* x 18.0) (* y z))) (* (* a 4.0) (* a 4.0))) t)
192.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))

prune1.2s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 2.4b

localize33.0ms

Local error

Found 4 expressions with local error:

4.0b
(* x (* z y))
3.6b
(* (- (* 18.0 (* x (* z y))) (* a 4.0)) t)
0.2b
(* 18.0 (* x (* z y)))
0.2b
(* (* 27.0 k) j)

rewrite28.0ms

Algorithm
rewrite-expression-head
Counts
4 → 40
Calls

4 calls. Slowest were:

17.0ms
(* (- (* 18.0 (* x (* z y))) (* a 4.0)) t)
4.0ms
(* (* 27.0 k) j)
4.0ms
(* 18.0 (* x (* z y)))

series156.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

81.0ms
(* (- (* 18.0 (* x (* z y))) (* a 4.0)) t)
30.0ms
(* 18.0 (* x (* z y)))
28.0ms
(* x (* z y))
17.0ms
(* (* 27.0 k) j)

simplify1.1s

Counts
17 → 52
Calls

17 calls. Slowest were:

320.0ms
(* (- (* (* 18.0 (* x (* z y))) (* 18.0 (* x (* z y)))) (* (* a 4.0) (* a 4.0))) t)
297.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))
237.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))

prune1.1s

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 2.4b

localize30.0ms

Local error

Found 4 expressions with local error:

8.8b
(cbrt (* (* 27.0 k) j))
8.8b
(cbrt (* (* 27.0 k) j))
8.8b
(cbrt (* (* 27.0 k) j))
4.0b
(* x (* z y))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
4 → 36
Calls

4 calls. Slowest were:

1.0ms
(cbrt (* (* 27.0 k) j))
1.0ms
(cbrt (* (* 27.0 k) j))
1.0ms
(cbrt (* (* 27.0 k) j))

series371.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

131.0ms
(cbrt (* (* 27.0 k) j))
113.0ms
(cbrt (* (* 27.0 k) j))
111.0ms
(cbrt (* (* 27.0 k) j))
17.0ms
(* x (* z y))

simplify994.0ms

Counts
15 → 48
Calls

15 calls. Slowest were:

146.0ms
(* (cbrt 27.0) (exp (* -1/3 (+ (log (/ -1 j)) (log (/ -1 k))))))
141.0ms
(* (cbrt 27.0) (exp (* -1/3 (+ (log (/ 1 k)) (log (/ 1 j))))))
139.0ms
(* (cbrt 27.0) (exp (* -1/3 (+ (log (/ 1 k)) (log (/ 1 j))))))

prune1.2s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 2.4b

regimes2.3s

Accuracy

74.4% (1.0b remaining)

Error of 3.4b against oracle of 2.3b and baseline of 6.3b

bsearch25.0ms

end0.0ms

sample6.9s

Algorithm
intervals