Average Error: 11.9 → 3.6
Time: 13.8s
Precision: binary64
\[[x, y] = \mathsf{sort}([x, y]) \\]
\[x \cdot \frac{\frac{y}{z} \cdot t}{t} \]
\[\begin{array}{l} t_1 := \frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\\ \mathbf{if}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \leq -2.6237 \cdot 10^{-319}:\\ \;\;\;\;\left(x \cdot t_1\right) \cdot \frac{y}{\sqrt[3]{z}}\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_2 := \sqrt{t_1}\\ \left(t_2 \cdot \left(\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot t_2\right)\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}} \end{array}\\ \end{array} \]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
t_1 := \frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\\
\mathbf{if}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \leq -2.6237 \cdot 10^{-319}:\\
\;\;\;\;\left(x \cdot t_1\right) \cdot \frac{y}{\sqrt[3]{z}}\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt{t_1}\\
\left(t_2 \cdot \left(\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot t_2\right)\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}
\end{array}\\


\end{array}
(FPCore (x y z t) :precision binary64 (* x (/ (* (/ y z) t) t)))
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ 1.0 (* (cbrt z) (cbrt z)))))
   (if (<= (* x (/ (* (/ y z) t) t)) -2.6237e-319)
     (* (* x t_1) (/ y (cbrt z)))
     (let* ((t_2 (sqrt t_1)))
       (*
        (* t_2 (* (* x (* (cbrt y) (cbrt y))) t_2))
        (/ (cbrt y) (cbrt z)))))))
double code(double x, double y, double z, double t) {
	return x * (((y / z) * t) / t);
}
double code(double x, double y, double z, double t) {
	double t_1 = 1.0 / (cbrt(z) * cbrt(z));
	double tmp;
	if ((x * (((y / z) * t) / t)) <= -2.6237e-319) {
		tmp = (x * t_1) * (y / cbrt(z));
	} else {
		double t_2 = sqrt(t_1);
		tmp = (t_2 * ((x * (cbrt(y) * cbrt(y))) * t_2)) * (cbrt(y) / cbrt(z));
	}
	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

Original11.9
Target1.1
Herbie3.6
\[\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 2 regimes
  2. if (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t)) < -2.62369e-319

    1. Initial program 8.3

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t} \]
    2. Simplified3.1

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    3. Applied add-cube-cbrt_binary643.9

      \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \]
    4. Applied *-un-lft-identity_binary643.9

      \[\leadsto x \cdot \frac{\color{blue}{1 \cdot y}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}} \]
    5. Applied times-frac_binary643.9

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y}{\sqrt[3]{z}}\right)} \]
    6. Applied associate-*r*_binary644.8

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

    if -2.62369e-319 < (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t))

    1. Initial program 14.1

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t} \]
    2. Simplified5.9

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    3. Applied *-un-lft-identity_binary645.9

      \[\leadsto x \cdot \frac{y}{\color{blue}{1 \cdot z}} \]
    4. Applied add-cube-cbrt_binary646.5

      \[\leadsto x \cdot \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{1 \cdot z} \]
    5. Applied times-frac_binary646.5

      \[\leadsto x \cdot \color{blue}{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \frac{\sqrt[3]{y}}{z}\right)} \]
    6. Applied associate-*r*_binary643.7

      \[\leadsto \color{blue}{\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1}\right) \cdot \frac{\sqrt[3]{y}}{z}} \]
    7. Simplified3.7

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

      \[\leadsto \left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \]
    9. Applied *-un-lft-identity_binary643.9

      \[\leadsto \left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\color{blue}{1 \cdot \sqrt[3]{y}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}} \]
    10. Applied times-frac_binary643.9

      \[\leadsto \left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\right)} \]
    11. Applied associate-*r*_binary642.8

      \[\leadsto \color{blue}{\left(\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}} \]
    12. Applied add-sqr-sqrt_binary642.9

      \[\leadsto \left(\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \color{blue}{\left(\sqrt{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \sqrt{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right)}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}} \]
    13. Applied associate-*r*_binary642.9

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \sqrt{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right) \cdot \sqrt{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right)} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification3.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \leq -2.6237 \cdot 10^{-319}:\\ \;\;\;\;\left(x \cdot \frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{y}{\sqrt[3]{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \left(\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \sqrt{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right)\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\\ \end{array} \]

Reproduce

herbie shell --seed 2022068 
(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)))