Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H

Percentage Accurate: 95.7% → 97.4%
Time: 12.9s
Alternatives: 20
Speedup: 1.4×

Specification

?
\[\begin{array}{l} \\ \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
	return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
	return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t):
	return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t)
	return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y)))
end
function tmp = code(x, y, z, t)
	tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 20 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 95.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
	return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
	return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t):
	return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t)
	return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y)))
end
function tmp = code(x, y, z, t)
	tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}

Alternative 1: 97.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{+49}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-1}{z}, y \cdot 0.3333333333333333, x + \frac{t}{y \cdot \left(z \cdot 3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -6e+49)
   (fma (/ -1.0 z) (* y 0.3333333333333333) (+ x (/ t (* y (* z 3.0)))))
   (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -6e+49) {
		tmp = fma((-1.0 / z), (y * 0.3333333333333333), (x + (t / (y * (z * 3.0)))));
	} else {
		tmp = x + (((t / y) - y) / (z * 3.0));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -6e+49)
		tmp = fma(Float64(-1.0 / z), Float64(y * 0.3333333333333333), Float64(x + Float64(t / Float64(y * Float64(z * 3.0)))));
	else
		tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0)));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[t, -6e+49], N[(N[(-1.0 / z), $MachinePrecision] * N[(y * 0.3333333333333333), $MachinePrecision] + N[(x + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z}, y \cdot 0.3333333333333333, x + \frac{t}{y \cdot \left(z \cdot 3\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.0000000000000005e49

    1. Initial program 98.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. sub-negN/A

        \[\leadsto \color{blue}{\left(x + \left(\mathsf{neg}\left(\frac{y}{z \cdot 3}\right)\right)\right)} + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{y}{z \cdot 3}\right)\right) + x\right)} + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(\mathsf{neg}\left(\frac{y}{z \cdot 3}\right)\right) + x\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      6. lift-*.f64N/A

        \[\leadsto \left(\left(\mathsf{neg}\left(\frac{y}{z \cdot 3}\right)\right) + x\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      7. lift-/.f64N/A

        \[\leadsto \left(\left(\mathsf{neg}\left(\frac{y}{z \cdot 3}\right)\right) + x\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      8. associate-+l+N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y}{z \cdot 3}\right)\right) + \left(x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      9. lift-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{y}{z \cdot 3}}\right)\right) + \left(x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(y\right)}{z \cdot 3}} + \left(x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      11. neg-mul-1N/A

        \[\leadsto \frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \left(x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \frac{-1 \cdot y}{\color{blue}{z \cdot 3}} + \left(x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      13. times-fracN/A

        \[\leadsto \color{blue}{\frac{-1}{z} \cdot \frac{y}{3}} + \left(x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{z}, \frac{y}{3}, x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{z}}, \frac{y}{3}, x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      16. div-invN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \color{blue}{y \cdot \frac{1}{3}}, x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \color{blue}{y \cdot \frac{1}{3}}, x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, y \cdot \color{blue}{\frac{1}{3}}, x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      19. lower-+.f6498.1

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, y \cdot 0.3333333333333333, \color{blue}{x + \frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, y \cdot \frac{1}{3}, x + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      21. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, y \cdot \frac{1}{3}, x + \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      22. lower-*.f6498.1

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, y \cdot 0.3333333333333333, x + \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
    4. Applied egg-rr98.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{z}, y \cdot 0.3333333333333333, x + \frac{t}{y \cdot \left(z \cdot 3\right)}\right)} \]

    if -6.0000000000000005e49 < t

    1. Initial program 94.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      5. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      6. associate-+l-N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      7. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. lift-/.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      10. lift-*.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      11. *-commutativeN/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      12. associate-/r*N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      13. sub-divN/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      14. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      15. lower--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
      16. lower-/.f6497.5

        \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
    4. Applied egg-rr97.5%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{+49}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-1}{z}, y \cdot 0.3333333333333333, x + \frac{t}{y \cdot \left(z \cdot 3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 97.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{-32}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -2.5e-32)
   (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0))))
   (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -2.5e-32) {
		tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
	} else {
		tmp = x + (((t / y) - y) / (z * 3.0));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-2.5d-32)) then
        tmp = (x - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))
    else
        tmp = x + (((t / y) - y) / (z * 3.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -2.5e-32) {
		tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
	} else {
		tmp = x + (((t / y) - y) / (z * 3.0));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -2.5e-32:
		tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))
	else:
		tmp = x + (((t / y) - y) / (z * 3.0))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -2.5e-32)
		tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0))));
	else
		tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -2.5e-32)
		tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
	else
		tmp = x + (((t / y) - y) / (z * 3.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.5e-32], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-32}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5e-32

    1. Initial program 98.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing

    if -2.5e-32 < t

    1. Initial program 93.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      5. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      6. associate-+l-N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      7. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. lift-/.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      10. lift-*.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      11. *-commutativeN/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      12. associate-/r*N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      13. sub-divN/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      14. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      15. lower--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
      16. lower-/.f6497.3

        \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
    4. Applied egg-rr97.3%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{-32}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 97.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.4 \cdot 10^{+49}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -5.4e+49)
   (fma (/ t (* z y)) 0.3333333333333333 (fma y (/ -0.3333333333333333 z) x))
   (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.4e+49) {
		tmp = fma((t / (z * y)), 0.3333333333333333, fma(y, (-0.3333333333333333 / z), x));
	} else {
		tmp = x + (((t / y) - y) / (z * 3.0));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -5.4e+49)
		tmp = fma(Float64(t / Float64(z * y)), 0.3333333333333333, fma(y, Float64(-0.3333333333333333 / z), x));
	else
		tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0)));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.4e+49], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.4000000000000002e49

    1. Initial program 98.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right)} + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      5. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      6. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      7. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(x - \frac{y}{z \cdot 3}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} + \left(x - \frac{y}{z \cdot 3}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} + \left(x - \frac{y}{z \cdot 3}\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \frac{\color{blue}{t \cdot 1}}{\left(z \cdot 3\right) \cdot y} + \left(x - \frac{y}{z \cdot 3}\right) \]
      11. *-commutativeN/A

        \[\leadsto \frac{t \cdot 1}{\color{blue}{y \cdot \left(z \cdot 3\right)}} + \left(x - \frac{y}{z \cdot 3}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \frac{t \cdot 1}{y \cdot \color{blue}{\left(z \cdot 3\right)}} + \left(x - \frac{y}{z \cdot 3}\right) \]
      13. associate-*r*N/A

        \[\leadsto \frac{t \cdot 1}{\color{blue}{\left(y \cdot z\right) \cdot 3}} + \left(x - \frac{y}{z \cdot 3}\right) \]
      14. times-fracN/A

        \[\leadsto \color{blue}{\frac{t}{y \cdot z} \cdot \frac{1}{3}} + \left(x - \frac{y}{z \cdot 3}\right) \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t}{y \cdot z}, \frac{1}{3}, x - \frac{y}{z \cdot 3}\right)} \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t}{y \cdot z}}, \frac{1}{3}, x - \frac{y}{z \cdot 3}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{t}{\color{blue}{y \cdot z}}, \frac{1}{3}, x - \frac{y}{z \cdot 3}\right) \]
      18. metadata-eval97.9

        \[\leadsto \mathsf{fma}\left(\frac{t}{y \cdot z}, \color{blue}{0.3333333333333333}, x - \frac{y}{z \cdot 3}\right) \]
      19. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{t}{y \cdot z}, \frac{1}{3}, \color{blue}{x - \frac{y}{z \cdot 3}}\right) \]
      20. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\frac{t}{y \cdot z}, \frac{1}{3}, \color{blue}{x + \left(\mathsf{neg}\left(\frac{y}{z \cdot 3}\right)\right)}\right) \]
      21. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{t}{y \cdot z}, \frac{1}{3}, \color{blue}{\left(\mathsf{neg}\left(\frac{y}{z \cdot 3}\right)\right) + x}\right) \]
    4. Applied egg-rr97.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t}{y \cdot z}, 0.3333333333333333, \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\right)} \]

    if -5.4000000000000002e49 < t

    1. Initial program 94.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      5. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      6. associate-+l-N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      7. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. lift-/.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      10. lift-*.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      11. *-commutativeN/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      12. associate-/r*N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      13. sub-divN/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      14. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      15. lower--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
      16. lower-/.f6497.5

        \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
    4. Applied egg-rr97.5%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.4 \cdot 10^{+49}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 40.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-71}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;z \cdot 3 \leq 4 \cdot 10^{-71}:\\ \;\;\;\;-\frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z 3.0) -1e-71)
   (+ x (/ -0.3333333333333333 z))
   (if (<= (* z 3.0) 4e-71) (- (/ y z)) (+ x (/ 1.0 z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * 3.0) <= -1e-71) {
		tmp = x + (-0.3333333333333333 / z);
	} else if ((z * 3.0) <= 4e-71) {
		tmp = -(y / z);
	} else {
		tmp = x + (1.0 / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z * 3.0d0) <= (-1d-71)) then
        tmp = x + ((-0.3333333333333333d0) / z)
    else if ((z * 3.0d0) <= 4d-71) then
        tmp = -(y / z)
    else
        tmp = x + (1.0d0 / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * 3.0) <= -1e-71) {
		tmp = x + (-0.3333333333333333 / z);
	} else if ((z * 3.0) <= 4e-71) {
		tmp = -(y / z);
	} else {
		tmp = x + (1.0 / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z * 3.0) <= -1e-71:
		tmp = x + (-0.3333333333333333 / z)
	elif (z * 3.0) <= 4e-71:
		tmp = -(y / z)
	else:
		tmp = x + (1.0 / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * 3.0) <= -1e-71)
		tmp = Float64(x + Float64(-0.3333333333333333 / z));
	elseif (Float64(z * 3.0) <= 4e-71)
		tmp = Float64(-Float64(y / z));
	else
		tmp = Float64(x + Float64(1.0 / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z * 3.0) <= -1e-71)
		tmp = x + (-0.3333333333333333 / z);
	elseif ((z * 3.0) <= 4e-71)
		tmp = -(y / z);
	else
		tmp = x + (1.0 / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e-71], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 4e-71], (-N[(y / z), $MachinePrecision]), N[(x + N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-71}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\

\mathbf{elif}\;z \cdot 3 \leq 4 \cdot 10^{-71}:\\
\;\;\;\;-\frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{1}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z #s(literal 3 binary64)) < -9.9999999999999992e-72

    1. Initial program 96.6%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      3. associate-*r/N/A

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
      6. metadata-evalN/A

        \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
      7. lower-/.f6443.1

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
    5. Simplified43.1%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]

    if -9.9999999999999992e-72 < (*.f64 z #s(literal 3 binary64)) < 3.9999999999999997e-71

    1. Initial program 90.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
      4. lower-*.f6447.2

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    5. Simplified47.2%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    6. Taylor expanded in y around -inf

      \[\leadsto \frac{\color{blue}{-1 \cdot y}}{z} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(y\right)}}{z} \]
      2. lower-neg.f6433.3

        \[\leadsto \frac{\color{blue}{-y}}{z} \]
    8. Simplified33.3%

      \[\leadsto \frac{\color{blue}{-y}}{z} \]

    if 3.9999999999999997e-71 < (*.f64 z #s(literal 3 binary64))

    1. Initial program 99.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      3. associate-*r/N/A

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
      6. metadata-evalN/A

        \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
      7. lower-/.f6441.1

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
    5. Simplified41.1%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto x + \color{blue}{\frac{1}{z}} \]
    7. Step-by-step derivation
      1. lower-/.f6441.4

        \[\leadsto x + \color{blue}{\frac{1}{z}} \]
    8. Simplified41.4%

      \[\leadsto x + \color{blue}{\frac{1}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification38.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-71}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;z \cdot 3 \leq 4 \cdot 10^{-71}:\\ \;\;\;\;-\frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 40.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{-0.3333333333333333}{z}\\ \mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-71}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot 3 \leq 4 \cdot 10^{-71}:\\ \;\;\;\;-\frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (/ -0.3333333333333333 z))))
   (if (<= (* z 3.0) -1e-71) t_1 (if (<= (* z 3.0) 4e-71) (- (/ y z)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (-0.3333333333333333 / z);
	double tmp;
	if ((z * 3.0) <= -1e-71) {
		tmp = t_1;
	} else if ((z * 3.0) <= 4e-71) {
		tmp = -(y / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((-0.3333333333333333d0) / z)
    if ((z * 3.0d0) <= (-1d-71)) then
        tmp = t_1
    else if ((z * 3.0d0) <= 4d-71) then
        tmp = -(y / z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (-0.3333333333333333 / z);
	double tmp;
	if ((z * 3.0) <= -1e-71) {
		tmp = t_1;
	} else if ((z * 3.0) <= 4e-71) {
		tmp = -(y / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (-0.3333333333333333 / z)
	tmp = 0
	if (z * 3.0) <= -1e-71:
		tmp = t_1
	elif (z * 3.0) <= 4e-71:
		tmp = -(y / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(-0.3333333333333333 / z))
	tmp = 0.0
	if (Float64(z * 3.0) <= -1e-71)
		tmp = t_1;
	elseif (Float64(z * 3.0) <= 4e-71)
		tmp = Float64(-Float64(y / z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (-0.3333333333333333 / z);
	tmp = 0.0;
	if ((z * 3.0) <= -1e-71)
		tmp = t_1;
	elseif ((z * 3.0) <= 4e-71)
		tmp = -(y / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e-71], t$95$1, If[LessEqual[N[(z * 3.0), $MachinePrecision], 4e-71], (-N[(y / z), $MachinePrecision]), t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{-0.3333333333333333}{z}\\
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \cdot 3 \leq 4 \cdot 10^{-71}:\\
\;\;\;\;-\frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z #s(literal 3 binary64)) < -9.9999999999999992e-72 or 3.9999999999999997e-71 < (*.f64 z #s(literal 3 binary64))

    1. Initial program 98.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      3. associate-*r/N/A

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
      6. metadata-evalN/A

        \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
      7. lower-/.f6442.2

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
    5. Simplified42.2%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]

    if -9.9999999999999992e-72 < (*.f64 z #s(literal 3 binary64)) < 3.9999999999999997e-71

    1. Initial program 90.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
      4. lower-*.f6447.2

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    5. Simplified47.2%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    6. Taylor expanded in y around -inf

      \[\leadsto \frac{\color{blue}{-1 \cdot y}}{z} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(y\right)}}{z} \]
      2. lower-neg.f6433.3

        \[\leadsto \frac{\color{blue}{-y}}{z} \]
    8. Simplified33.3%

      \[\leadsto \frac{\color{blue}{-y}}{z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification38.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-71}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;z \cdot 3 \leq 4 \cdot 10^{-71}:\\ \;\;\;\;-\frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 46.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-8}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-247}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{-0.3333333333333333}{y}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -9e-8)
   (/ (* y -0.3333333333333333) z)
   (if (<= y 7.6e-247)
     (+ x (/ -0.3333333333333333 z))
     (if (<= y 7.5e+42)
       (fma t (/ -0.3333333333333333 y) x)
       (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -9e-8) {
		tmp = (y * -0.3333333333333333) / z;
	} else if (y <= 7.6e-247) {
		tmp = x + (-0.3333333333333333 / z);
	} else if (y <= 7.5e+42) {
		tmp = fma(t, (-0.3333333333333333 / y), x);
	} else {
		tmp = y / (z * -3.0);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -9e-8)
		tmp = Float64(Float64(y * -0.3333333333333333) / z);
	elseif (y <= 7.6e-247)
		tmp = Float64(x + Float64(-0.3333333333333333 / z));
	elseif (y <= 7.5e+42)
		tmp = fma(t, Float64(-0.3333333333333333 / y), x);
	else
		tmp = Float64(y / Float64(z * -3.0));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-8], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 7.6e-247], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+42], N[(t * N[(-0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-8}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 7.6 \cdot 10^{-247}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{-0.3333333333333333}{y}, x\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -8.99999999999999986e-8

    1. Initial program 99.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
      4. lower-*.f6476.9

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    5. Simplified76.9%

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

    if -8.99999999999999986e-8 < y < 7.59999999999999977e-247

    1. Initial program 90.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      3. associate-*r/N/A

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
      6. metadata-evalN/A

        \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
      7. lower-/.f6435.1

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
    5. Simplified35.1%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]

    if 7.59999999999999977e-247 < y < 7.50000000000000041e42

    1. Initial program 95.1%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      5. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      6. associate-+l-N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      7. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. lift-/.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      10. lift-*.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      11. *-commutativeN/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      12. associate-/r*N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      13. sub-divN/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      14. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      15. lower--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
      16. lower-/.f6493.5

        \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
    4. Applied egg-rr93.5%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    5. Taylor expanded in y around 0

      \[\leadsto \color{blue}{\frac{x \cdot y - \frac{-1}{3} \cdot \frac{t}{z}}{y}} \]
    6. Step-by-step derivation
      1. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{y} - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y}} \]
      2. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{x}{y} \cdot y} - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y} \]
      3. remove-double-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot y\right)\right)\right)\right)} - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y} \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{x}{y}\right)\right) \cdot y}\right)\right) - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y} \]
      5. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{x}{y}\right)} \cdot y\right)\right) - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y} \]
      6. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) - \color{blue}{\frac{-1}{3} \cdot \frac{\frac{t}{z}}{y}} \]
      7. associate-/l/N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) - \frac{-1}{3} \cdot \color{blue}{\frac{t}{y \cdot z}} \]
      8. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right) \cdot \frac{t}{y \cdot z}} \]
      9. metadata-evalN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) + \color{blue}{\frac{1}{3}} \cdot \frac{t}{y \cdot z} \]
      10. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{3} \cdot \frac{t}{y \cdot z} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right)} \]
      11. *-lft-identityN/A

        \[\leadsto \frac{1}{3} \cdot \frac{\color{blue}{1 \cdot t}}{y \cdot z} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) \]
      12. associate-*l/N/A

        \[\leadsto \frac{1}{3} \cdot \color{blue}{\left(\frac{1}{y \cdot z} \cdot t\right)} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) \]
      13. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) \cdot t} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \color{blue}{t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right)} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) \]
      15. mul-1-negN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)} \cdot y\right)\right) \]
      16. distribute-lft-neg-outN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{x}{y} \cdot y\right)\right)}\right)\right) \]
      17. remove-double-negN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \color{blue}{\frac{x}{y} \cdot y} \]
      18. associate-*l/N/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \color{blue}{\frac{x \cdot y}{y}} \]
      19. associate-/l*N/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \color{blue}{x \cdot \frac{y}{y}} \]
      20. *-inversesN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + x \cdot \color{blue}{1} \]
      21. *-rgt-identityN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \color{blue}{x} \]
    7. Simplified91.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, \frac{0.3333333333333333}{y \cdot z}, x\right)} \]
    8. Taylor expanded in z around -inf

      \[\leadsto \mathsf{fma}\left(t, \color{blue}{\frac{\frac{-1}{3}}{y}}, x\right) \]
    9. Step-by-step derivation
      1. lower-/.f6445.7

        \[\leadsto \mathsf{fma}\left(t, \color{blue}{\frac{-0.3333333333333333}{y}}, x\right) \]
    10. Simplified45.7%

      \[\leadsto \mathsf{fma}\left(t, \color{blue}{\frac{-0.3333333333333333}{y}}, x\right) \]

    if 7.50000000000000041e42 < y

    1. Initial program 98.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
      4. lower-*.f6482.6

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    5. Simplified82.6%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{\frac{-1}{3}}{z}} \]
      2. clear-numN/A

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{\frac{-1}{3}}}} \]
      3. div-invN/A

        \[\leadsto y \cdot \frac{1}{\color{blue}{z \cdot \frac{1}{\frac{-1}{3}}}} \]
      4. metadata-evalN/A

        \[\leadsto y \cdot \frac{1}{z \cdot \color{blue}{-3}} \]
      5. un-div-invN/A

        \[\leadsto \color{blue}{\frac{y}{z \cdot -3}} \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y}{z \cdot -3}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{y}{\color{blue}{-3 \cdot z}} \]
      8. lower-*.f6482.7

        \[\leadsto \frac{y}{\color{blue}{-3 \cdot z}} \]
    7. Applied egg-rr82.7%

      \[\leadsto \color{blue}{\frac{y}{-3 \cdot z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification56.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-8}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-247}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{-0.3333333333333333}{y}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 89.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+42}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{0.3333333333333333}{z \cdot y}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -3.4e-7)
   (fma y (/ -0.3333333333333333 z) x)
   (if (<= y 2e+42)
     (fma t (/ 0.3333333333333333 (* z y)) x)
     (fma -1.0 (/ y (* z 3.0)) x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -3.4e-7) {
		tmp = fma(y, (-0.3333333333333333 / z), x);
	} else if (y <= 2e+42) {
		tmp = fma(t, (0.3333333333333333 / (z * y)), x);
	} else {
		tmp = fma(-1.0, (y / (z * 3.0)), x);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -3.4e-7)
		tmp = fma(y, Float64(-0.3333333333333333 / z), x);
	elseif (y <= 2e+42)
		tmp = fma(t, Float64(0.3333333333333333 / Float64(z * y)), x);
	else
		tmp = fma(-1.0, Float64(y / Float64(z * 3.0)), x);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e-7], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2e+42], N[(t * N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(-1.0 * N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\

\mathbf{elif}\;y \leq 2 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{0.3333333333333333}{z \cdot y}, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.39999999999999974e-7

    1. Initial program 99.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - \frac{1}{3} \cdot \frac{1}{z}\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{x}{y}\right)} \]
      3. distribute-lft-inN/A

        \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + y \cdot \frac{x}{y}} \]
      4. associate-*r/N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{\frac{y \cdot x}{y}} \]
      5. *-commutativeN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{\color{blue}{x \cdot y}}{y} \]
      6. associate-/l*N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x \cdot \frac{y}{y}} \]
      7. *-inversesN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + x \cdot \color{blue}{1} \]
      8. *-rgt-identityN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x} \]
      9. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right), x\right)} \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right), x\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right), x\right) \]
      12. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\frac{-1}{3}}}{z}, x\right) \]
      14. lower-/.f6493.4

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{-0.3333333333333333}{z}}, x\right) \]
    5. Simplified93.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)} \]

    if -3.39999999999999974e-7 < y < 2.00000000000000009e42

    1. Initial program 92.1%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      5. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      6. associate-+l-N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      7. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. lift-/.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      10. lift-*.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      11. *-commutativeN/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      12. associate-/r*N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      13. sub-divN/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      14. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      15. lower--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
      16. lower-/.f6492.2

        \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
    4. Applied egg-rr92.2%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    5. Taylor expanded in y around 0

      \[\leadsto \color{blue}{\frac{x \cdot y - \frac{-1}{3} \cdot \frac{t}{z}}{y}} \]
    6. Step-by-step derivation
      1. div-subN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{y} - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y}} \]
      2. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{x}{y} \cdot y} - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y} \]
      3. remove-double-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot y\right)\right)\right)\right)} - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y} \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{x}{y}\right)\right) \cdot y}\right)\right) - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y} \]
      5. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{x}{y}\right)} \cdot y\right)\right) - \frac{\frac{-1}{3} \cdot \frac{t}{z}}{y} \]
      6. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) - \color{blue}{\frac{-1}{3} \cdot \frac{\frac{t}{z}}{y}} \]
      7. associate-/l/N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) - \frac{-1}{3} \cdot \color{blue}{\frac{t}{y \cdot z}} \]
      8. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right) \cdot \frac{t}{y \cdot z}} \]
      9. metadata-evalN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) + \color{blue}{\frac{1}{3}} \cdot \frac{t}{y \cdot z} \]
      10. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{3} \cdot \frac{t}{y \cdot z} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right)} \]
      11. *-lft-identityN/A

        \[\leadsto \frac{1}{3} \cdot \frac{\color{blue}{1 \cdot t}}{y \cdot z} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) \]
      12. associate-*l/N/A

        \[\leadsto \frac{1}{3} \cdot \color{blue}{\left(\frac{1}{y \cdot z} \cdot t\right)} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) \]
      13. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) \cdot t} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \color{blue}{t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right)} + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{x}{y}\right) \cdot y\right)\right) \]
      15. mul-1-negN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)} \cdot y\right)\right) \]
      16. distribute-lft-neg-outN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{x}{y} \cdot y\right)\right)}\right)\right) \]
      17. remove-double-negN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \color{blue}{\frac{x}{y} \cdot y} \]
      18. associate-*l/N/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \color{blue}{\frac{x \cdot y}{y}} \]
      19. associate-/l*N/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \color{blue}{x \cdot \frac{y}{y}} \]
      20. *-inversesN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + x \cdot \color{blue}{1} \]
      21. *-rgt-identityN/A

        \[\leadsto t \cdot \left(\frac{1}{3} \cdot \frac{1}{y \cdot z}\right) + \color{blue}{x} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, \frac{0.3333333333333333}{y \cdot z}, x\right)} \]

    if 2.00000000000000009e42 < y

    1. Initial program 98.1%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - \frac{1}{3} \cdot \frac{1}{z}\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{x}{y}\right)} \]
      3. distribute-lft-inN/A

        \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + y \cdot \frac{x}{y}} \]
      4. associate-*r/N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{\frac{y \cdot x}{y}} \]
      5. *-commutativeN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{\color{blue}{x \cdot y}}{y} \]
      6. associate-/l*N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x \cdot \frac{y}{y}} \]
      7. *-inversesN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + x \cdot \color{blue}{1} \]
      8. *-rgt-identityN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x} \]
      9. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right), x\right)} \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right), x\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right), x\right) \]
      12. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\frac{-1}{3}}}{z}, x\right) \]
      14. lower-/.f6495.8

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{-0.3333333333333333}{z}}, x\right) \]
    5. Simplified95.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto y \cdot \color{blue}{\frac{\frac{-1}{3}}{z}} + x \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z} \cdot y} + x \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot y + x \]
      4. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{\frac{-1}{3}}}} \cdot y + x \]
      5. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{z}{\frac{-1}{3}}}} + x \]
      6. div-invN/A

        \[\leadsto \frac{1 \cdot y}{\color{blue}{z \cdot \frac{1}{\frac{-1}{3}}}} + x \]
      7. metadata-evalN/A

        \[\leadsto \frac{1 \cdot y}{z \cdot \color{blue}{-3}} + x \]
      8. metadata-evalN/A

        \[\leadsto \frac{1 \cdot y}{z \cdot \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}} + x \]
      9. distribute-rgt-neg-inN/A

        \[\leadsto \frac{1 \cdot y}{\color{blue}{\mathsf{neg}\left(z \cdot 3\right)}} + x \]
      10. lift-*.f64N/A

        \[\leadsto \frac{1 \cdot y}{\mathsf{neg}\left(\color{blue}{z \cdot 3}\right)} + x \]
      11. neg-mul-1N/A

        \[\leadsto \frac{1 \cdot y}{\color{blue}{-1 \cdot \left(z \cdot 3\right)}} + x \]
      12. times-fracN/A

        \[\leadsto \color{blue}{\frac{1}{-1} \cdot \frac{y}{z \cdot 3}} + x \]
      13. metadata-evalN/A

        \[\leadsto \color{blue}{-1} \cdot \frac{y}{z \cdot 3} + x \]
      14. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)} \]
      15. lower-/.f6495.9

        \[\leadsto \mathsf{fma}\left(-1, \color{blue}{\frac{y}{z \cdot 3}}, x\right) \]
    7. Applied egg-rr95.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+42}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{0.3333333333333333}{z \cdot y}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\ \;\;\;\;\frac{t}{3 \cdot \left(z \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1e-124)
   (fma y (/ -0.3333333333333333 z) x)
   (if (<= y 7.6e-13) (/ t (* 3.0 (* z y))) (fma -1.0 (/ y (* z 3.0)) x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1e-124) {
		tmp = fma(y, (-0.3333333333333333 / z), x);
	} else if (y <= 7.6e-13) {
		tmp = t / (3.0 * (z * y));
	} else {
		tmp = fma(-1.0, (y / (z * 3.0)), x);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1e-124)
		tmp = fma(y, Float64(-0.3333333333333333 / z), x);
	elseif (y <= 7.6e-13)
		tmp = Float64(t / Float64(3.0 * Float64(z * y)));
	else
		tmp = fma(-1.0, Float64(y / Float64(z * 3.0)), x);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1e-124], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 7.6e-13], N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\

\mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\
\;\;\;\;\frac{t}{3 \cdot \left(z \cdot y\right)}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.99999999999999933e-125

    1. Initial program 99.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - \frac{1}{3} \cdot \frac{1}{z}\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{x}{y}\right)} \]
      3. distribute-lft-inN/A

        \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + y \cdot \frac{x}{y}} \]
      4. associate-*r/N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{\frac{y \cdot x}{y}} \]
      5. *-commutativeN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{\color{blue}{x \cdot y}}{y} \]
      6. associate-/l*N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x \cdot \frac{y}{y}} \]
      7. *-inversesN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + x \cdot \color{blue}{1} \]
      8. *-rgt-identityN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x} \]
      9. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right), x\right)} \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right), x\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right), x\right) \]
      12. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\frac{-1}{3}}}{z}, x\right) \]
      14. lower-/.f6480.7

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{-0.3333333333333333}{z}}, x\right) \]
    5. Simplified80.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)} \]

    if -9.99999999999999933e-125 < y < 7.5999999999999999e-13

    1. Initial program 90.2%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      5. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      6. associate-+l-N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      7. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. lift-/.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      10. lift-*.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      11. *-commutativeN/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      12. associate-/r*N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      13. sub-divN/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      14. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      15. lower--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
      16. lower-/.f6491.1

        \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
    4. Applied egg-rr91.1%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    5. Taylor expanded in y around 0

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \frac{t}{y \cdot z}} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{3} \cdot t}{y \cdot z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{3} \cdot t}{y \cdot z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{t \cdot \frac{1}{3}}}{y \cdot z} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{t \cdot \frac{1}{3}}}{y \cdot z} \]
      5. lower-*.f6463.2

        \[\leadsto \frac{t \cdot 0.3333333333333333}{\color{blue}{y \cdot z}} \]
    7. Simplified63.2%

      \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} \]
    8. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \color{blue}{\frac{t}{y} \cdot \frac{\frac{1}{3}}{z}} \]
      2. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{t}{y}} \cdot \frac{\frac{1}{3}}{z} \]
      3. clear-numN/A

        \[\leadsto \frac{t}{y} \cdot \color{blue}{\frac{1}{\frac{z}{\frac{1}{3}}}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{\frac{t}{y}}{\frac{z}{\frac{1}{3}}}} \]
      5. div-invN/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot \frac{1}{\frac{1}{3}}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{\frac{t}{y}}{z \cdot \color{blue}{3}} \]
      7. metadata-evalN/A

        \[\leadsto \frac{\frac{t}{y}}{z \cdot \color{blue}{\left(\mathsf{neg}\left(-3\right)\right)}} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{\mathsf{neg}\left(z \cdot -3\right)}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{t}{y}}{\mathsf{neg}\left(z \cdot -3\right)}} \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot \left(\mathsf{neg}\left(-3\right)\right)}} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot \left(\mathsf{neg}\left(-3\right)\right)}} \]
      12. metadata-eval64.8

        \[\leadsto \frac{\frac{t}{y}}{z \cdot \color{blue}{3}} \]
    9. Applied egg-rr64.8%

      \[\leadsto \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot 3}} \]
      2. associate-/l/N/A

        \[\leadsto \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{t}{y \cdot \color{blue}{\left(z \cdot 3\right)}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{t}{y \cdot \left(z \cdot \color{blue}{\frac{1}{\frac{1}{3}}}\right)} \]
      6. div-invN/A

        \[\leadsto \frac{t}{y \cdot \color{blue}{\frac{z}{\frac{1}{3}}}} \]
      7. associate-/l*N/A

        \[\leadsto \frac{t}{\color{blue}{\frac{y \cdot z}{\frac{1}{3}}}} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{t}{\frac{\color{blue}{y \cdot z}}{\frac{1}{3}}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot z}{\frac{1}{3}}}} \]
      10. div-invN/A

        \[\leadsto \frac{t}{\color{blue}{\left(y \cdot z\right) \cdot \frac{1}{\frac{1}{3}}}} \]
      11. metadata-evalN/A

        \[\leadsto \frac{t}{\left(y \cdot z\right) \cdot \color{blue}{3}} \]
      12. lower-*.f6463.2

        \[\leadsto \frac{t}{\color{blue}{\left(y \cdot z\right) \cdot 3}} \]
      13. lift-*.f64N/A

        \[\leadsto \frac{t}{\color{blue}{\left(y \cdot z\right)} \cdot 3} \]
      14. *-commutativeN/A

        \[\leadsto \frac{t}{\color{blue}{\left(z \cdot y\right)} \cdot 3} \]
      15. lower-*.f6463.2

        \[\leadsto \frac{t}{\color{blue}{\left(z \cdot y\right)} \cdot 3} \]
    11. Applied egg-rr63.2%

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

    if 7.5999999999999999e-13 < y

    1. Initial program 96.9%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - \frac{1}{3} \cdot \frac{1}{z}\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{x}{y}\right)} \]
      3. distribute-lft-inN/A

        \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + y \cdot \frac{x}{y}} \]
      4. associate-*r/N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{\frac{y \cdot x}{y}} \]
      5. *-commutativeN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{\color{blue}{x \cdot y}}{y} \]
      6. associate-/l*N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x \cdot \frac{y}{y}} \]
      7. *-inversesN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + x \cdot \color{blue}{1} \]
      8. *-rgt-identityN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x} \]
      9. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right), x\right)} \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right), x\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right), x\right) \]
      12. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\frac{-1}{3}}}{z}, x\right) \]
      14. lower-/.f6490.8

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{-0.3333333333333333}{z}}, x\right) \]
    5. Simplified90.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto y \cdot \color{blue}{\frac{\frac{-1}{3}}{z}} + x \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z} \cdot y} + x \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot y + x \]
      4. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{\frac{-1}{3}}}} \cdot y + x \]
      5. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{z}{\frac{-1}{3}}}} + x \]
      6. div-invN/A

        \[\leadsto \frac{1 \cdot y}{\color{blue}{z \cdot \frac{1}{\frac{-1}{3}}}} + x \]
      7. metadata-evalN/A

        \[\leadsto \frac{1 \cdot y}{z \cdot \color{blue}{-3}} + x \]
      8. metadata-evalN/A

        \[\leadsto \frac{1 \cdot y}{z \cdot \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}} + x \]
      9. distribute-rgt-neg-inN/A

        \[\leadsto \frac{1 \cdot y}{\color{blue}{\mathsf{neg}\left(z \cdot 3\right)}} + x \]
      10. lift-*.f64N/A

        \[\leadsto \frac{1 \cdot y}{\mathsf{neg}\left(\color{blue}{z \cdot 3}\right)} + x \]
      11. neg-mul-1N/A

        \[\leadsto \frac{1 \cdot y}{\color{blue}{-1 \cdot \left(z \cdot 3\right)}} + x \]
      12. times-fracN/A

        \[\leadsto \color{blue}{\frac{1}{-1} \cdot \frac{y}{z \cdot 3}} + x \]
      13. metadata-evalN/A

        \[\leadsto \color{blue}{-1} \cdot \frac{y}{z \cdot 3} + x \]
      14. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)} \]
      15. lower-/.f6490.9

        \[\leadsto \mathsf{fma}\left(-1, \color{blue}{\frac{y}{z \cdot 3}}, x\right) \]
    7. Applied egg-rr90.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\ \;\;\;\;\frac{t}{3 \cdot \left(z \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 75.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\ \;\;\;\;\frac{t}{3 \cdot \left(z \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
   (if (<= y -1e-124) t_1 (if (<= y 7.6e-13) (/ t (* 3.0 (* z y))) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = fma(y, (-0.3333333333333333 / z), x);
	double tmp;
	if (y <= -1e-124) {
		tmp = t_1;
	} else if (y <= 7.6e-13) {
		tmp = t / (3.0 * (z * y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = fma(y, Float64(-0.3333333333333333 / z), x)
	tmp = 0.0
	if (y <= -1e-124)
		tmp = t_1;
	elseif (y <= 7.6e-13)
		tmp = Float64(t / Float64(3.0 * Float64(z * y)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1e-124], t$95$1, If[LessEqual[y, 7.6e-13], N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\
\;\;\;\;\frac{t}{3 \cdot \left(z \cdot y\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.99999999999999933e-125 or 7.5999999999999999e-13 < y

    1. Initial program 98.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - \frac{1}{3} \cdot \frac{1}{z}\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{x}{y}\right)} \]
      3. distribute-lft-inN/A

        \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + y \cdot \frac{x}{y}} \]
      4. associate-*r/N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{\frac{y \cdot x}{y}} \]
      5. *-commutativeN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{\color{blue}{x \cdot y}}{y} \]
      6. associate-/l*N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x \cdot \frac{y}{y}} \]
      7. *-inversesN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + x \cdot \color{blue}{1} \]
      8. *-rgt-identityN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x} \]
      9. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right), x\right)} \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right), x\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right), x\right) \]
      12. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\frac{-1}{3}}}{z}, x\right) \]
      14. lower-/.f6485.1

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{-0.3333333333333333}{z}}, x\right) \]
    5. Simplified85.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)} \]

    if -9.99999999999999933e-125 < y < 7.5999999999999999e-13

    1. Initial program 90.2%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      5. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      6. associate-+l-N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      7. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. lift-/.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      10. lift-*.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      11. *-commutativeN/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      12. associate-/r*N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      13. sub-divN/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      14. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      15. lower--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
      16. lower-/.f6491.1

        \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
    4. Applied egg-rr91.1%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    5. Taylor expanded in y around 0

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \frac{t}{y \cdot z}} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{3} \cdot t}{y \cdot z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{3} \cdot t}{y \cdot z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{t \cdot \frac{1}{3}}}{y \cdot z} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{t \cdot \frac{1}{3}}}{y \cdot z} \]
      5. lower-*.f6463.2

        \[\leadsto \frac{t \cdot 0.3333333333333333}{\color{blue}{y \cdot z}} \]
    7. Simplified63.2%

      \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} \]
    8. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \color{blue}{\frac{t}{y} \cdot \frac{\frac{1}{3}}{z}} \]
      2. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{t}{y}} \cdot \frac{\frac{1}{3}}{z} \]
      3. clear-numN/A

        \[\leadsto \frac{t}{y} \cdot \color{blue}{\frac{1}{\frac{z}{\frac{1}{3}}}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{\frac{t}{y}}{\frac{z}{\frac{1}{3}}}} \]
      5. div-invN/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot \frac{1}{\frac{1}{3}}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{\frac{t}{y}}{z \cdot \color{blue}{3}} \]
      7. metadata-evalN/A

        \[\leadsto \frac{\frac{t}{y}}{z \cdot \color{blue}{\left(\mathsf{neg}\left(-3\right)\right)}} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{\mathsf{neg}\left(z \cdot -3\right)}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{t}{y}}{\mathsf{neg}\left(z \cdot -3\right)}} \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot \left(\mathsf{neg}\left(-3\right)\right)}} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot \left(\mathsf{neg}\left(-3\right)\right)}} \]
      12. metadata-eval64.8

        \[\leadsto \frac{\frac{t}{y}}{z \cdot \color{blue}{3}} \]
    9. Applied egg-rr64.8%

      \[\leadsto \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot 3}} \]
      2. associate-/l/N/A

        \[\leadsto \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{t}{y \cdot \color{blue}{\left(z \cdot 3\right)}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{t}{y \cdot \left(z \cdot \color{blue}{\frac{1}{\frac{1}{3}}}\right)} \]
      6. div-invN/A

        \[\leadsto \frac{t}{y \cdot \color{blue}{\frac{z}{\frac{1}{3}}}} \]
      7. associate-/l*N/A

        \[\leadsto \frac{t}{\color{blue}{\frac{y \cdot z}{\frac{1}{3}}}} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{t}{\frac{\color{blue}{y \cdot z}}{\frac{1}{3}}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot z}{\frac{1}{3}}}} \]
      10. div-invN/A

        \[\leadsto \frac{t}{\color{blue}{\left(y \cdot z\right) \cdot \frac{1}{\frac{1}{3}}}} \]
      11. metadata-evalN/A

        \[\leadsto \frac{t}{\left(y \cdot z\right) \cdot \color{blue}{3}} \]
      12. lower-*.f6463.2

        \[\leadsto \frac{t}{\color{blue}{\left(y \cdot z\right) \cdot 3}} \]
      13. lift-*.f64N/A

        \[\leadsto \frac{t}{\color{blue}{\left(y \cdot z\right)} \cdot 3} \]
      14. *-commutativeN/A

        \[\leadsto \frac{t}{\color{blue}{\left(z \cdot y\right)} \cdot 3} \]
      15. lower-*.f6463.2

        \[\leadsto \frac{t}{\color{blue}{\left(z \cdot y\right)} \cdot 3} \]
    11. Applied egg-rr63.2%

      \[\leadsto \color{blue}{\frac{t}{\left(z \cdot y\right) \cdot 3}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\ \;\;\;\;\frac{t}{3 \cdot \left(z \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 74.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\ \;\;\;\;t \cdot \frac{0.3333333333333333}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
   (if (<= y -1e-124)
     t_1
     (if (<= y 7.6e-13) (* t (/ 0.3333333333333333 (* z y))) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = fma(y, (-0.3333333333333333 / z), x);
	double tmp;
	if (y <= -1e-124) {
		tmp = t_1;
	} else if (y <= 7.6e-13) {
		tmp = t * (0.3333333333333333 / (z * y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = fma(y, Float64(-0.3333333333333333 / z), x)
	tmp = 0.0
	if (y <= -1e-124)
		tmp = t_1;
	elseif (y <= 7.6e-13)
		tmp = Float64(t * Float64(0.3333333333333333 / Float64(z * y)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1e-124], t$95$1, If[LessEqual[y, 7.6e-13], N[(t * N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{z \cdot y}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.99999999999999933e-125 or 7.5999999999999999e-13 < y

    1. Initial program 98.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - \frac{1}{3} \cdot \frac{1}{z}\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{x}{y}\right)} \]
      3. distribute-lft-inN/A

        \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + y \cdot \frac{x}{y}} \]
      4. associate-*r/N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{\frac{y \cdot x}{y}} \]
      5. *-commutativeN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{\color{blue}{x \cdot y}}{y} \]
      6. associate-/l*N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x \cdot \frac{y}{y}} \]
      7. *-inversesN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + x \cdot \color{blue}{1} \]
      8. *-rgt-identityN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x} \]
      9. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right), x\right)} \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right), x\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right), x\right) \]
      12. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\frac{-1}{3}}}{z}, x\right) \]
      14. lower-/.f6485.1

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{-0.3333333333333333}{z}}, x\right) \]
    5. Simplified85.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)} \]

    if -9.99999999999999933e-125 < y < 7.5999999999999999e-13

    1. Initial program 90.2%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      5. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      6. associate-+l-N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      7. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. lift-/.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      10. lift-*.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      11. *-commutativeN/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      12. associate-/r*N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      13. sub-divN/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      14. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      15. lower--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
      16. lower-/.f6491.1

        \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
    4. Applied egg-rr91.1%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    5. Taylor expanded in y around 0

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \frac{t}{y \cdot z}} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{3} \cdot t}{y \cdot z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{3} \cdot t}{y \cdot z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{t \cdot \frac{1}{3}}}{y \cdot z} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{t \cdot \frac{1}{3}}}{y \cdot z} \]
      5. lower-*.f6463.2

        \[\leadsto \frac{t \cdot 0.3333333333333333}{\color{blue}{y \cdot z}} \]
    7. Simplified63.2%

      \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{t \cdot \frac{1}{3}}{\color{blue}{y \cdot z}} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{t \cdot \frac{\frac{1}{3}}{y \cdot z}} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{\frac{1}{3}}{y \cdot z} \cdot t} \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{3}}{y \cdot z} \cdot t} \]
      5. lower-/.f6463.1

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{y \cdot z}} \cdot t \]
    9. Applied egg-rr63.1%

      \[\leadsto \color{blue}{\frac{0.3333333333333333}{y \cdot z} \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\ \;\;\;\;t \cdot \frac{0.3333333333333333}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 95.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ x + \frac{\frac{t}{y} - y}{z \cdot 3} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
	return x + (((t / y) - y) / (z * 3.0));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
	return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t):
	return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0)))
end
function tmp = code(x, y, z, t)
	tmp = x + (((t / y) - y) / (z * 3.0));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Derivation
  1. Initial program 95.1%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. lift-/.f64N/A

      \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    3. lift-*.f64N/A

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
    4. lift-*.f64N/A

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
    5. lift-/.f64N/A

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
    6. associate-+l-N/A

      \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    7. lower--.f64N/A

      \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    8. lift-/.f64N/A

      \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    9. lift-/.f64N/A

      \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
    10. lift-*.f64N/A

      \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
    11. *-commutativeN/A

      \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
    12. associate-/r*N/A

      \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
    13. sub-divN/A

      \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
    14. lower-/.f64N/A

      \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
    15. lower--.f64N/A

      \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
    16. lower-/.f6495.4

      \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
  4. Applied egg-rr95.4%

    \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
  5. Final simplification95.4%

    \[\leadsto x + \frac{\frac{t}{y} - y}{z \cdot 3} \]
  6. Add Preprocessing

Alternative 12: 95.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y} - y, x\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (fma (/ 0.3333333333333333 z) (- (/ t y) y) x))
double code(double x, double y, double z, double t) {
	return fma((0.3333333333333333 / z), ((t / y) - y), x);
}
function code(x, y, z, t)
	return fma(Float64(0.3333333333333333 / z), Float64(Float64(t / y) - y), x)
end
code[x_, y_, z_, t_] := N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y} - y, x\right)
\end{array}
Derivation
  1. Initial program 95.1%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf

    \[\leadsto \color{blue}{y \cdot \left(\left(\frac{1}{3} \cdot \frac{t}{{y}^{2} \cdot z} + \frac{x}{y}\right) - \frac{1}{3} \cdot \frac{1}{z}\right)} \]
  4. Simplified95.4%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y} - y, x\right)} \]
  5. Add Preprocessing

Alternative 13: 47.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-8}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -9e-8)
   (/ (* y -0.3333333333333333) z)
   (if (<= y 7.5e+42) (+ x (/ -0.3333333333333333 z)) (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -9e-8) {
		tmp = (y * -0.3333333333333333) / z;
	} else if (y <= 7.5e+42) {
		tmp = x + (-0.3333333333333333 / z);
	} else {
		tmp = y / (z * -3.0);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-9d-8)) then
        tmp = (y * (-0.3333333333333333d0)) / z
    else if (y <= 7.5d+42) then
        tmp = x + ((-0.3333333333333333d0) / z)
    else
        tmp = y / (z * (-3.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -9e-8) {
		tmp = (y * -0.3333333333333333) / z;
	} else if (y <= 7.5e+42) {
		tmp = x + (-0.3333333333333333 / z);
	} else {
		tmp = y / (z * -3.0);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -9e-8:
		tmp = (y * -0.3333333333333333) / z
	elif y <= 7.5e+42:
		tmp = x + (-0.3333333333333333 / z)
	else:
		tmp = y / (z * -3.0)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -9e-8)
		tmp = Float64(Float64(y * -0.3333333333333333) / z);
	elseif (y <= 7.5e+42)
		tmp = Float64(x + Float64(-0.3333333333333333 / z));
	else
		tmp = Float64(y / Float64(z * -3.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -9e-8)
		tmp = (y * -0.3333333333333333) / z;
	elseif (y <= 7.5e+42)
		tmp = x + (-0.3333333333333333 / z);
	else
		tmp = y / (z * -3.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-8], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 7.5e+42], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-8}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.99999999999999986e-8

    1. Initial program 99.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
      4. lower-*.f6476.9

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    5. Simplified76.9%

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

    if -8.99999999999999986e-8 < y < 7.50000000000000041e42

    1. Initial program 92.2%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      3. associate-*r/N/A

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
      6. metadata-evalN/A

        \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
      7. lower-/.f6435.2

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
    5. Simplified35.2%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]

    if 7.50000000000000041e42 < y

    1. Initial program 98.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
      4. lower-*.f6482.6

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    5. Simplified82.6%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{\frac{-1}{3}}{z}} \]
      2. clear-numN/A

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{\frac{-1}{3}}}} \]
      3. div-invN/A

        \[\leadsto y \cdot \frac{1}{\color{blue}{z \cdot \frac{1}{\frac{-1}{3}}}} \]
      4. metadata-evalN/A

        \[\leadsto y \cdot \frac{1}{z \cdot \color{blue}{-3}} \]
      5. un-div-invN/A

        \[\leadsto \color{blue}{\frac{y}{z \cdot -3}} \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y}{z \cdot -3}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{y}{\color{blue}{-3 \cdot z}} \]
      8. lower-*.f6482.7

        \[\leadsto \frac{y}{\color{blue}{-3 \cdot z}} \]
    7. Applied egg-rr82.7%

      \[\leadsto \color{blue}{\frac{y}{-3 \cdot z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-8}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 47.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1e-7)
   (* y (/ -0.3333333333333333 z))
   (if (<= y 7.5e+42) (+ x (/ -0.3333333333333333 z)) (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1e-7) {
		tmp = y * (-0.3333333333333333 / z);
	} else if (y <= 7.5e+42) {
		tmp = x + (-0.3333333333333333 / z);
	} else {
		tmp = y / (z * -3.0);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-1d-7)) then
        tmp = y * ((-0.3333333333333333d0) / z)
    else if (y <= 7.5d+42) then
        tmp = x + ((-0.3333333333333333d0) / z)
    else
        tmp = y / (z * (-3.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1e-7) {
		tmp = y * (-0.3333333333333333 / z);
	} else if (y <= 7.5e+42) {
		tmp = x + (-0.3333333333333333 / z);
	} else {
		tmp = y / (z * -3.0);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1e-7:
		tmp = y * (-0.3333333333333333 / z)
	elif y <= 7.5e+42:
		tmp = x + (-0.3333333333333333 / z)
	else:
		tmp = y / (z * -3.0)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1e-7)
		tmp = Float64(y * Float64(-0.3333333333333333 / z));
	elseif (y <= 7.5e+42)
		tmp = Float64(x + Float64(-0.3333333333333333 / z));
	else
		tmp = Float64(y / Float64(z * -3.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1e-7)
		tmp = y * (-0.3333333333333333 / z);
	elseif (y <= 7.5e+42)
		tmp = x + (-0.3333333333333333 / z);
	else
		tmp = y / (z * -3.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1e-7], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+42], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.9999999999999995e-8

    1. Initial program 99.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
      4. lower-*.f6476.9

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    5. Simplified76.9%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{\frac{-1}{3}}{z}} \]
      2. lift-/.f64N/A

        \[\leadsto y \cdot \color{blue}{\frac{\frac{-1}{3}}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z} \cdot y} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot y \]
      5. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{\frac{-1}{3}}}} \cdot y \]
      6. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\frac{z}{\frac{-1}{3}}} \cdot y \]
      7. div-invN/A

        \[\leadsto \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{z \cdot \frac{1}{\frac{-1}{3}}}} \cdot y \]
      8. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(-1\right)}{z \cdot \color{blue}{-3}} \cdot y \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(-1\right)}{z \cdot -3} \cdot y} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{1}}{z \cdot -3} \cdot y \]
      11. metadata-evalN/A

        \[\leadsto \frac{1}{z \cdot \color{blue}{\frac{1}{\frac{-1}{3}}}} \cdot y \]
      12. div-invN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{z}{\frac{-1}{3}}}} \cdot y \]
      13. clear-numN/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot y \]
      14. lift-/.f6476.9

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{z}} \cdot y \]
    7. Applied egg-rr76.9%

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

    if -9.9999999999999995e-8 < y < 7.50000000000000041e42

    1. Initial program 92.2%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      3. associate-*r/N/A

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
      6. metadata-evalN/A

        \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
      7. lower-/.f6435.2

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
    5. Simplified35.2%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]

    if 7.50000000000000041e42 < y

    1. Initial program 98.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
      4. lower-*.f6482.6

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    5. Simplified82.6%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{\frac{-1}{3}}{z}} \]
      2. clear-numN/A

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{\frac{-1}{3}}}} \]
      3. div-invN/A

        \[\leadsto y \cdot \frac{1}{\color{blue}{z \cdot \frac{1}{\frac{-1}{3}}}} \]
      4. metadata-evalN/A

        \[\leadsto y \cdot \frac{1}{z \cdot \color{blue}{-3}} \]
      5. un-div-invN/A

        \[\leadsto \color{blue}{\frac{y}{z \cdot -3}} \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y}{z \cdot -3}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{y}{\color{blue}{-3 \cdot z}} \]
      8. lower-*.f6482.7

        \[\leadsto \frac{y}{\color{blue}{-3 \cdot z}} \]
    7. Applied egg-rr82.7%

      \[\leadsto \color{blue}{\frac{y}{-3 \cdot z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 47.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ -0.3333333333333333 z))))
   (if (<= y -1e-7)
     t_1
     (if (<= y 7.5e+42) (+ x (/ -0.3333333333333333 z)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (-0.3333333333333333 / z);
	double tmp;
	if (y <= -1e-7) {
		tmp = t_1;
	} else if (y <= 7.5e+42) {
		tmp = x + (-0.3333333333333333 / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * ((-0.3333333333333333d0) / z)
    if (y <= (-1d-7)) then
        tmp = t_1
    else if (y <= 7.5d+42) then
        tmp = x + ((-0.3333333333333333d0) / z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (-0.3333333333333333 / z);
	double tmp;
	if (y <= -1e-7) {
		tmp = t_1;
	} else if (y <= 7.5e+42) {
		tmp = x + (-0.3333333333333333 / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (-0.3333333333333333 / z)
	tmp = 0
	if y <= -1e-7:
		tmp = t_1
	elif y <= 7.5e+42:
		tmp = x + (-0.3333333333333333 / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(-0.3333333333333333 / z))
	tmp = 0.0
	if (y <= -1e-7)
		tmp = t_1;
	elseif (y <= 7.5e+42)
		tmp = Float64(x + Float64(-0.3333333333333333 / z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (-0.3333333333333333 / z);
	tmp = 0.0;
	if (y <= -1e-7)
		tmp = t_1;
	elseif (y <= 7.5e+42)
		tmp = x + (-0.3333333333333333 / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-7], t$95$1, If[LessEqual[y, 7.5e+42], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.9999999999999995e-8 or 7.50000000000000041e42 < y

    1. Initial program 98.9%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
      4. lower-*.f6479.6

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    5. Simplified79.6%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{\frac{-1}{3}}{z}} \]
      2. lift-/.f64N/A

        \[\leadsto y \cdot \color{blue}{\frac{\frac{-1}{3}}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z} \cdot y} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot y \]
      5. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{\frac{-1}{3}}}} \cdot y \]
      6. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\frac{z}{\frac{-1}{3}}} \cdot y \]
      7. div-invN/A

        \[\leadsto \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{z \cdot \frac{1}{\frac{-1}{3}}}} \cdot y \]
      8. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(-1\right)}{z \cdot \color{blue}{-3}} \cdot y \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(-1\right)}{z \cdot -3} \cdot y} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{1}}{z \cdot -3} \cdot y \]
      11. metadata-evalN/A

        \[\leadsto \frac{1}{z \cdot \color{blue}{\frac{1}{\frac{-1}{3}}}} \cdot y \]
      12. div-invN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{z}{\frac{-1}{3}}}} \cdot y \]
      13. clear-numN/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot y \]
      14. lift-/.f6479.6

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{z}} \cdot y \]
    7. Applied egg-rr79.6%

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

    if -9.9999999999999995e-8 < y < 7.50000000000000041e42

    1. Initial program 92.2%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      3. associate-*r/N/A

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
      6. metadata-evalN/A

        \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
      7. lower-/.f6435.2

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
    5. Simplified35.2%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 47.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* -0.3333333333333333 (/ y z))))
   (if (<= y -1e-7)
     t_1
     (if (<= y 7.5e+42) (+ x (/ -0.3333333333333333 z)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = -0.3333333333333333 * (y / z);
	double tmp;
	if (y <= -1e-7) {
		tmp = t_1;
	} else if (y <= 7.5e+42) {
		tmp = x + (-0.3333333333333333 / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (-0.3333333333333333d0) * (y / z)
    if (y <= (-1d-7)) then
        tmp = t_1
    else if (y <= 7.5d+42) then
        tmp = x + ((-0.3333333333333333d0) / z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = -0.3333333333333333 * (y / z);
	double tmp;
	if (y <= -1e-7) {
		tmp = t_1;
	} else if (y <= 7.5e+42) {
		tmp = x + (-0.3333333333333333 / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -0.3333333333333333 * (y / z)
	tmp = 0
	if y <= -1e-7:
		tmp = t_1
	elif y <= 7.5e+42:
		tmp = x + (-0.3333333333333333 / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(-0.3333333333333333 * Float64(y / z))
	tmp = 0.0
	if (y <= -1e-7)
		tmp = t_1;
	elseif (y <= 7.5e+42)
		tmp = Float64(x + Float64(-0.3333333333333333 / z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -0.3333333333333333 * (y / z);
	tmp = 0.0;
	if (y <= -1e-7)
		tmp = t_1;
	elseif (y <= 7.5e+42)
		tmp = x + (-0.3333333333333333 / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-7], t$95$1, If[LessEqual[y, 7.5e+42], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.9999999999999995e-8 or 7.50000000000000041e42 < y

    1. Initial program 98.9%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{\color{blue}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. lift-/.f64N/A

        \[\leadsto \left(x - \color{blue}{\frac{y}{z \cdot 3}}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      3. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right)} \cdot y} \]
      4. lift-*.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      5. lift-/.f64N/A

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}} \]
      6. associate-+l-N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      7. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto x - \left(\color{blue}{\frac{y}{z \cdot 3}} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. lift-/.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{t}{\left(z \cdot 3\right) \cdot y}}\right) \]
      10. lift-*.f64N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
      11. *-commutativeN/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      12. associate-/r*N/A

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      13. sub-divN/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      14. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
      15. lower--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - \frac{t}{y}}}{z \cdot 3} \]
      16. lower-/.f6499.7

        \[\leadsto x - \frac{y - \color{blue}{\frac{t}{y}}}{z \cdot 3} \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    5. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
      2. lower-/.f6479.5

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{y}{z}} \]
    7. Simplified79.5%

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

    if -9.9999999999999995e-8 < y < 7.50000000000000041e42

    1. Initial program 92.2%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
      3. associate-*r/N/A

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
      6. metadata-evalN/A

        \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
      7. lower-/.f6435.2

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
    5. Simplified35.2%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 64.4% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma y (/ -0.3333333333333333 z) x))
double code(double x, double y, double z, double t) {
	return fma(y, (-0.3333333333333333 / z), x);
}
function code(x, y, z, t)
	return fma(y, Float64(-0.3333333333333333 / z), x)
end
code[x_, y_, z_, t_] := N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)
\end{array}
Derivation
  1. Initial program 95.1%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf

    \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - \frac{1}{3} \cdot \frac{1}{z}\right)} \]
  4. Step-by-step derivation
    1. sub-negN/A

      \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)\right)} \]
    2. +-commutativeN/A

      \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{x}{y}\right)} \]
    3. distribute-lft-inN/A

      \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + y \cdot \frac{x}{y}} \]
    4. associate-*r/N/A

      \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{\frac{y \cdot x}{y}} \]
    5. *-commutativeN/A

      \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \frac{\color{blue}{x \cdot y}}{y} \]
    6. associate-/l*N/A

      \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x \cdot \frac{y}{y}} \]
    7. *-inversesN/A

      \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + x \cdot \color{blue}{1} \]
    8. *-rgt-identityN/A

      \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right) + \color{blue}{x} \]
    9. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right), x\right)} \]
    10. associate-*r/N/A

      \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right), x\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(y, \mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right), x\right) \]
    12. distribute-neg-fracN/A

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}}, x\right) \]
    13. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\frac{-1}{3}}}{z}, x\right) \]
    14. lower-/.f6462.1

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{-0.3333333333333333}{z}}, x\right) \]
  5. Simplified62.1%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)} \]
  6. Add Preprocessing

Alternative 18: 18.0% accurate, 3.1× speedup?

\[\begin{array}{l} \\ -\frac{y}{z} \end{array} \]
(FPCore (x y z t) :precision binary64 (- (/ y z)))
double code(double x, double y, double z, double t) {
	return -(y / z);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = -(y / z)
end function
public static double code(double x, double y, double z, double t) {
	return -(y / z);
}
def code(x, y, z, t):
	return -(y / z)
function code(x, y, z, t)
	return Float64(-Float64(y / z))
end
function tmp = code(x, y, z, t)
	tmp = -(y / z);
end
code[x_, y_, z_, t_] := (-N[(y / z), $MachinePrecision])
\begin{array}{l}

\\
-\frac{y}{z}
\end{array}
Derivation
  1. Initial program 95.1%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf

    \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} \]
  4. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
    2. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot y}{z}} \]
    3. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{y \cdot \frac{-1}{3}}}{z} \]
    4. lower-*.f6436.3

      \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
  5. Simplified36.3%

    \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
  6. Taylor expanded in y around -inf

    \[\leadsto \frac{\color{blue}{-1 \cdot y}}{z} \]
  7. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(y\right)}}{z} \]
    2. lower-neg.f6417.4

      \[\leadsto \frac{\color{blue}{-y}}{z} \]
  8. Simplified17.4%

    \[\leadsto \frac{\color{blue}{-y}}{z} \]
  9. Final simplification17.4%

    \[\leadsto -\frac{y}{z} \]
  10. Add Preprocessing

Alternative 19: 3.2% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \frac{1}{z} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ 1.0 z))
double code(double x, double y, double z, double t) {
	return 1.0 / z;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = 1.0d0 / z
end function
public static double code(double x, double y, double z, double t) {
	return 1.0 / z;
}
def code(x, y, z, t):
	return 1.0 / z
function code(x, y, z, t)
	return Float64(1.0 / z)
end
function tmp = code(x, y, z, t)
	tmp = 1.0 / z;
end
code[x_, y_, z_, t_] := N[(1.0 / z), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{z}
\end{array}
Derivation
  1. Initial program 95.1%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Add Preprocessing
  3. Taylor expanded in t around 0

    \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
  4. Step-by-step derivation
    1. sub-negN/A

      \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
    2. lower-+.f64N/A

      \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
    3. associate-*r/N/A

      \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
    4. metadata-evalN/A

      \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
    5. distribute-neg-fracN/A

      \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
    6. metadata-evalN/A

      \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
    7. lower-/.f6427.7

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
  5. Simplified27.7%

    \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]
  6. Taylor expanded in x around 0

    \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z}} \]
  7. Step-by-step derivation
    1. lower-/.f643.1

      \[\leadsto \color{blue}{\frac{-0.3333333333333333}{z}} \]
  8. Simplified3.1%

    \[\leadsto \color{blue}{\frac{-0.3333333333333333}{z}} \]
  9. Taylor expanded in z around 0

    \[\leadsto \color{blue}{\frac{1}{z}} \]
  10. Step-by-step derivation
    1. lower-/.f643.2

      \[\leadsto \color{blue}{\frac{1}{z}} \]
  11. Simplified3.2%

    \[\leadsto \color{blue}{\frac{1}{z}} \]
  12. Add Preprocessing

Alternative 20: 3.2% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \frac{-0.3333333333333333}{z} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ -0.3333333333333333 z))
double code(double x, double y, double z, double t) {
	return -0.3333333333333333 / z;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (-0.3333333333333333d0) / z
end function
public static double code(double x, double y, double z, double t) {
	return -0.3333333333333333 / z;
}
def code(x, y, z, t):
	return -0.3333333333333333 / z
function code(x, y, z, t)
	return Float64(-0.3333333333333333 / z)
end
function tmp = code(x, y, z, t)
	tmp = -0.3333333333333333 / z;
end
code[x_, y_, z_, t_] := N[(-0.3333333333333333 / z), $MachinePrecision]
\begin{array}{l}

\\
\frac{-0.3333333333333333}{z}
\end{array}
Derivation
  1. Initial program 95.1%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Add Preprocessing
  3. Taylor expanded in t around 0

    \[\leadsto \color{blue}{x - \frac{1}{3} \cdot \frac{1}{z}} \]
  4. Step-by-step derivation
    1. sub-negN/A

      \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
    2. lower-+.f64N/A

      \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{z}\right)\right)} \]
    3. associate-*r/N/A

      \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{3} \cdot 1}{z}}\right)\right) \]
    4. metadata-evalN/A

      \[\leadsto x + \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{3}}}{z}\right)\right) \]
    5. distribute-neg-fracN/A

      \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{z}} \]
    6. metadata-evalN/A

      \[\leadsto x + \frac{\color{blue}{\frac{-1}{3}}}{z} \]
    7. lower-/.f6427.7

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z}} \]
  5. Simplified27.7%

    \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z}} \]
  6. Taylor expanded in x around 0

    \[\leadsto \color{blue}{\frac{\frac{-1}{3}}{z}} \]
  7. Step-by-step derivation
    1. lower-/.f643.1

      \[\leadsto \color{blue}{\frac{-0.3333333333333333}{z}} \]
  8. Simplified3.1%

    \[\leadsto \color{blue}{\frac{-0.3333333333333333}{z}} \]
  9. Add Preprocessing

Developer Target 1: 95.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
	return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
	return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t):
	return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t)
	return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y))
end
function tmp = code(x, y, z, t)
	tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}

Reproduce

?
herbie shell --seed 2024214 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))

  (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))