Average Error: 14.9 → 2.2
Time: 4.2s
Precision: binary64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \leq -8.717304416683607 \cdot 10^{-82}:\\ \;\;\;\;\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\left(y \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{x}\right)}^{2}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{z}}\right)\\ \mathbf{elif}\;\frac{y}{z} \leq 7.655047405253071 \cdot 10^{-201}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \leq 7.55957540953951 \cdot 10^{+202}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \leq -8.717304416683607 \cdot 10^{-82}:\\
\;\;\;\;\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\left(y \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{x}\right)}^{2}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{z}}\right)\\

\mathbf{elif}\;\frac{y}{z} \leq 7.655047405253071 \cdot 10^{-201}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

\mathbf{elif}\;\frac{y}{z} \leq 7.55957540953951 \cdot 10^{+202}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\

\end{array}
(FPCore (x y z t) :precision binary64 (* x (/ (* (/ y z) t) t)))
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ y z) -8.717304416683607e-82)
   (*
    (* (cbrt x) (cbrt x))
    (*
     (* y (/ (cbrt (pow (cbrt x) 2.0)) (* (cbrt z) (cbrt z))))
     (/ (cbrt (cbrt x)) (cbrt z))))
   (if (<= (/ y z) 7.655047405253071e-201)
     (* y (/ x z))
     (if (<= (/ y z) 7.55957540953951e+202)
       (* (/ y z) x)
       (* (* y x) (/ 1.0 z))))))
double code(double x, double y, double z, double t) {
	return ((double) (x * (((double) ((y / z) * t)) / t)));
}
double code(double x, double y, double z, double t) {
	double tmp;
	if (((y / z) <= -8.717304416683607e-82)) {
		tmp = ((double) (((double) (((double) cbrt(x)) * ((double) cbrt(x)))) * ((double) (((double) (y * (((double) cbrt(((double) pow(((double) cbrt(x)), 2.0)))) / ((double) (((double) cbrt(z)) * ((double) cbrt(z))))))) * (((double) cbrt(((double) cbrt(x)))) / ((double) cbrt(z)))))));
	} else {
		double tmp_1;
		if (((y / z) <= 7.655047405253071e-201)) {
			tmp_1 = ((double) (y * (x / z)));
		} else {
			double tmp_2;
			if (((y / z) <= 7.55957540953951e+202)) {
				tmp_2 = ((double) ((y / z) * x));
			} else {
				tmp_2 = ((double) (((double) (y * x)) * (1.0 / z)));
			}
			tmp_1 = tmp_2;
		}
		tmp = tmp_1;
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.9
Target1.4
Herbie2.2
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} < -1.20672205123045 \cdot 10^{+245}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} < -5.907522236933906 \cdot 10^{-275}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} < 5.658954423153415 \cdot 10^{-65}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} < 2.0087180502407133 \cdot 10^{+217}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array}\]

Derivation

  1. Split input into 4 regimes
  2. if (/ y z) < -8.7173044166836066e-82

    1. Initial program Error: 15.7 bits

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. SimplifiedError: 6.6 bits

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrtError: 7.6 bits

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \cdot \frac{y}{z}\]
    5. Applied associate-*l*Error: 7.6 bits

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \frac{y}{z}\right)}\]
    6. SimplifiedError: 7.1 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{\left(y \cdot \frac{\sqrt[3]{x}}{z}\right)}\]
    7. Using strategy rm
    8. Applied add-cube-cbrtError: 7.3 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \frac{\sqrt[3]{x}}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\right)\]
    9. Applied add-cube-cbrtError: 7.4 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \frac{\sqrt[3]{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}\right)\]
    10. Applied cbrt-prodError: 7.4 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \frac{\color{blue}{\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}\right)\]
    11. Applied times-fracError: 7.4 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \color{blue}{\left(\frac{\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{z}}\right)}\right)\]
    12. Applied associate-*r*Error: 5.1 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{\left(\left(y \cdot \frac{\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{z}}\right)}\]
    13. SimplifiedError: 5.1 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\color{blue}{\left(y \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{x}\right)}^{2}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right)} \cdot \frac{\sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{z}}\right)\]

    if -8.7173044166836066e-82 < (/ y z) < 7.65504740525307086e-201

    1. Initial program Error: 14.8 bits

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. SimplifiedError: 7.7 bits

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrtError: 8.1 bits

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \cdot \frac{y}{z}\]
    5. Applied associate-*l*Error: 8.1 bits

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \frac{y}{z}\right)}\]
    6. SimplifiedError: 5.1 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{\left(y \cdot \frac{\sqrt[3]{x}}{z}\right)}\]
    7. Taylor expanded around 0 Error: 1.9 bits

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    8. SimplifiedError: 1.9 bits

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]

    if 7.65504740525307086e-201 < (/ y z) < 7.55957540953951011e202

    1. Initial program Error: 9.3 bits

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. SimplifiedError: 0.2 bits

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]

    if 7.55957540953951011e202 < (/ y z)

    1. Initial program Error: 43.4 bits

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. SimplifiedError: 29.0 bits

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied div-invError: 29.0 bits

      \[\leadsto x \cdot \color{blue}{\left(y \cdot \frac{1}{z}\right)}\]
    5. Applied associate-*r*Error: 1.2 bits

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplificationError: 2.2 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \leq -8.717304416683607 \cdot 10^{-82}:\\ \;\;\;\;\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\left(y \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{x}\right)}^{2}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{z}}\right)\\ \mathbf{elif}\;\frac{y}{z} \leq 7.655047405253071 \cdot 10^{-201}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \leq 7.55957540953951 \cdot 10^{+202}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020203 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"
  :precision binary64

  :herbie-target
  (if (< (/ (* (/ y z) t) t) -1.20672205123045e+245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.907522236933906e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.658954423153415e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e+217) (* x (/ y z)) (/ (* y x) z)))))

  (* x (/ (* (/ y z) t) t)))