Average Error: 5.1 → 3.5
Time: 25.8s
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 \le -9.515817935371277 \cdot 10^{+287}:\\ \;\;\;\;\left(\left(y \cdot z\right) \cdot \left(x \cdot 18.0\right) - a \cdot 4.0\right) \cdot t + \left(c \cdot b - \left(\left(x \cdot 4.0\right) \cdot i + \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 1.2867839035792513 \cdot 10^{+293}:\\ \;\;\;\;\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(c \cdot b - \left(x \cdot \left(4.0 \cdot i\right) + \left(k \cdot j\right) \cdot 27.0\right)\right) + \left(a \cdot 4.0\right) \cdot \left(-t\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)) < -9.515817935371277e+287

    1. Initial program 33.4

      \[\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. Initial simplification22.6

      \[\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(\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*22.6

      \[\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\]

    if -9.515817935371277e+287 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)) < 1.2867839035792513e+293

    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 1.2867839035792513e+293 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k))

    1. Initial program 34.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. Initial simplification24.1

      \[\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(\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-*l*24.0

      \[\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}{x \cdot \left(18.0 \cdot \left(y \cdot z\right)\right)} - a \cdot 4.0\right) \cdot t\]
    5. Using strategy rm
    6. Applied associate-*l*23.6

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

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

    \[\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 \le -9.515817935371277 \cdot 10^{+287}:\\ \;\;\;\;\left(\left(y \cdot z\right) \cdot \left(x \cdot 18.0\right) - a \cdot 4.0\right) \cdot t + \left(c \cdot b - \left(\left(x \cdot 4.0\right) \cdot i + \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 1.2867839035792513 \cdot 10^{+293}:\\ \;\;\;\;\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(c \cdot b - \left(x \cdot \left(4.0 \cdot i\right) + \left(k \cdot j\right) \cdot 27.0\right)\right) + \left(a \cdot 4.0\right) \cdot \left(-t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2018365 
(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: 16.2s)Debug log

start273.0ms

Algorithm
intervals

setup192.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 4.1b

localize69.0ms

Local error

Found 4 expressions with local error:

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

rewrite35.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

22.0ms
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
6.0ms
(* (* x 18.0) (* y z))
4.0ms
(* (* x 4.0) i)

series156.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

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

simplify1.8s

Counts
19 → 56
Calls

19 calls. Slowest were:

580.0ms
(* (* (* (* x 18.0) (* x 18.0)) (* x 18.0)) (* (* (* y z) (* y z)) (* y z)))
377.0ms
(* (- (* (* (* x 18.0) (* y z)) (* (* x 18.0) (* y z))) (* (* a 4.0) (* a 4.0))) t)
241.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))

prune1.4s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 2.3b

localize19.0ms

Local error

Found 4 expressions with local error:

5.8b
(* x (* 18.0 (* y z)))
3.9b
(* (- (* x (* 18.0 (* y z))) (* a 4.0)) t)
0.2b
(* 18.0 (* y z))
0.2b
(* (* x 4.0) i)

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 40
Calls

4 calls. Slowest were:

9.0ms
(* (- (* x (* 18.0 (* y z))) (* a 4.0)) t)
2.0ms
(* x (* 18.0 (* y z)))
2.0ms
(* (* x 4.0) i)

series141.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

79.0ms
(* (- (* x (* 18.0 (* y z))) (* a 4.0)) t)
26.0ms
(* x (* 18.0 (* y z)))
18.0ms
(* (* x 4.0) i)
18.0ms
(* 18.0 (* y z))

simplify1.3s

Counts
17 → 52
Calls

17 calls. Slowest were:

399.0ms
(* (- (* (* x (* 18.0 (* y z))) (* x (* 18.0 (* y z)))) (* (* a 4.0) (* a 4.0))) t)
297.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))
287.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))

prune1.5s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 2.1b

localize20.0ms

Local error

Found 4 expressions with local error:

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

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
4 → 40
Calls

4 calls. Slowest were:

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

series138.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

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

simplify1.4s

Counts
17 → 52
Calls

17 calls. Slowest were:

415.0ms
(* (- (* (* x (* 18.0 (* y z))) (* x (* 18.0 (* y z)))) (* (* a 4.0) (* a 4.0))) t)
340.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))
276.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))

prune1.5s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 2.1b

localize21.0ms

Local error

Found 4 expressions with local error:

15.3b
(cbrt (* x (* 18.0 (* y z))))
15.3b
(cbrt (* x (* 18.0 (* y z))))
15.3b
(cbrt (* x (* 18.0 (* y z))))
5.8b
(* x (* 18.0 (* y z)))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 36
Calls

4 calls. Slowest were:

2.0ms
(* x (* 18.0 (* y z)))
1.0ms
(cbrt (* x (* 18.0 (* y z))))
1.0ms
(cbrt (* x (* 18.0 (* y z))))

series396.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

146.0ms
(cbrt (* x (* 18.0 (* y z))))
119.0ms
(cbrt (* x (* 18.0 (* y z))))
111.0ms
(cbrt (* x (* 18.0 (* y z))))
19.0ms
(* x (* 18.0 (* y z)))

simplify1.5s

Counts
16 → 48
Calls

16 calls. Slowest were:

245.0ms
(* (cbrt -18.0) (exp (* -1/3 (+ (log (/ -1 x)) (+ (log (/ -1 z)) (log (/ -1 y)))))))
211.0ms
(* (cbrt -18.0) (exp (* -1/3 (+ (log (/ -1 x)) (+ (log (/ -1 z)) (log (/ -1 y)))))))
196.0ms
(* (cbrt -18.0) (exp (* -1/3 (+ (log (/ -1 x)) (+ (log (/ -1 z)) (log (/ -1 y)))))))

prune1.4s

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 2.1b

regimes2.8s

Accuracy

64.9% (1.3b remaining)

Error of 3.5b against oracle of 2.1b and baseline of 5.9b

bsearch37.0ms