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

Percentage Accurate: 95.4% → 96.8%
Time: 11.1s
Alternatives: 15
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 15 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.4% 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: 96.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 1.06 \cdot 10^{-50}:\\ \;\;\;\;x + \frac{1}{\frac{3}{\frac{t}{y} - y} \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{y}{3 \cdot z}\right) + \frac{t}{y \cdot \left(3 \cdot z\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t 1.06e-50)
   (+ x (/ 1.0 (* (/ 3.0 (- (/ t y) y)) z)))
   (+ (- x (/ y (* 3.0 z))) (/ t (* y (* 3.0 z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1.06e-50) {
		tmp = x + (1.0 / ((3.0 / ((t / y) - y)) * z));
	} else {
		tmp = (x - (y / (3.0 * z))) + (t / (y * (3.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 (t <= 1.06d-50) then
        tmp = x + (1.0d0 / ((3.0d0 / ((t / y) - y)) * z))
    else
        tmp = (x - (y / (3.0d0 * z))) + (t / (y * (3.0d0 * z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1.06e-50) {
		tmp = x + (1.0 / ((3.0 / ((t / y) - y)) * z));
	} else {
		tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * z)));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= 1.06e-50:
		tmp = x + (1.0 / ((3.0 / ((t / y) - y)) * z))
	else:
		tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * z)))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 1.06e-50)
		tmp = Float64(x + Float64(1.0 / Float64(Float64(3.0 / Float64(Float64(t / y) - y)) * z)));
	else
		tmp = Float64(Float64(x - Float64(y / Float64(3.0 * z))) + Float64(t / Float64(y * Float64(3.0 * z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= 1.06e-50)
		tmp = x + (1.0 / ((3.0 / ((t / y) - y)) * z));
	else
		tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.06e-50], N[(x + N[(1.0 / N[(N[(3.0 / N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.06 \cdot 10^{-50}:\\
\;\;\;\;x + \frac{1}{\frac{3}{\frac{t}{y} - y} \cdot z}\\

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


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

    1. Initial program 90.9%

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

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*l/97.3%

        \[\leadsto x + \color{blue}{\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}} \]
      2. clear-num97.3%

        \[\leadsto x + \color{blue}{\frac{1}{\frac{z}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}} \]
    5. Applied egg-rr97.3%

      \[\leadsto x + \color{blue}{\frac{1}{\frac{z}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}} \]
    6. Step-by-step derivation
      1. clear-num97.3%

        \[\leadsto x + \frac{1}{\color{blue}{\frac{1}{\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}}}} \]
      2. associate-/r/97.2%

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{1}{0.3333333333333333}}{\frac{t}{y} - y}} \cdot z} \]
      4. metadata-eval97.3%

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

      \[\leadsto x + \frac{1}{\color{blue}{\frac{3}{\frac{t}{y} - y} \cdot z}} \]

    if 1.05999999999999995e-50 < t

    1. Initial program 99.8%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification98.0%

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

Alternative 2: 96.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.3 \cdot 10^{-50}:\\
\;\;\;\;x + \frac{1}{\frac{3}{\frac{t}{y} - y} \cdot z}\\

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


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

    1. Initial program 90.9%

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

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*l/97.3%

        \[\leadsto x + \color{blue}{\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}} \]
      2. clear-num97.3%

        \[\leadsto x + \color{blue}{\frac{1}{\frac{z}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}} \]
    5. Applied egg-rr97.3%

      \[\leadsto x + \color{blue}{\frac{1}{\frac{z}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}} \]
    6. Step-by-step derivation
      1. clear-num97.3%

        \[\leadsto x + \frac{1}{\color{blue}{\frac{1}{\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}}}} \]
      2. associate-/r/97.2%

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{1}{0.3333333333333333}}{\frac{t}{y} - y}} \cdot z} \]
      4. metadata-eval97.3%

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

      \[\leadsto x + \frac{1}{\color{blue}{\frac{3}{\frac{t}{y} - y} \cdot z}} \]

    if 1.3000000000000001e-50 < t

    1. Initial program 99.8%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified99.8%

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

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

Alternative 3: 89.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+67}:\\
\;\;\;\;x - \frac{y}{3 \cdot z}\\

\mathbf{elif}\;y \leq 10^{+18}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.22000000000000004e67

    1. Initial program 99.8%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 96.8%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. metadata-eval96.8%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac96.9%

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

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative96.9%

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

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

    if -1.22000000000000004e67 < y < 1e18

    1. Initial program 88.1%

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

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 82.9%

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

    if 1e18 < y

    1. Initial program 98.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*98.3%

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

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified98.3%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 92.9%

      \[\leadsto \color{blue}{x + -0.3333333333333333 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. metadata-eval92.9%

        \[\leadsto x + \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
      2. cancel-sign-sub-inv92.9%

        \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
      3. associate-*r/93.0%

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
    7. Simplified93.0%

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

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

Alternative 4: 91.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{+67}:\\
\;\;\;\;x - \frac{y}{3 \cdot z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.26e67

    1. Initial program 99.8%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 96.8%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. metadata-eval96.8%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac96.9%

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

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative96.9%

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

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

    if -1.26e67 < y < 7.6e18

    1. Initial program 88.1%

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

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 82.9%

      \[\leadsto x + \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z}} \]
    5. Step-by-step derivation
      1. associate-/r*84.9%

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\frac{\frac{t}{y}}{z}} \]
      2. *-lft-identity84.9%

        \[\leadsto x + 0.3333333333333333 \cdot \frac{\color{blue}{1 \cdot \frac{t}{y}}}{z} \]
      3. associate-*l/84.8%

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\left(\frac{1}{z} \cdot \frac{t}{y}\right)} \]
      4. associate-*r/89.6%

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\frac{\frac{1}{z} \cdot t}{y}} \]
      5. associate-*l/89.7%

        \[\leadsto x + 0.3333333333333333 \cdot \frac{\color{blue}{\frac{1 \cdot t}{z}}}{y} \]
      6. associate-*r/89.7%

        \[\leadsto x + 0.3333333333333333 \cdot \frac{\color{blue}{1 \cdot \frac{t}{z}}}{y} \]
      7. *-lft-identity89.7%

        \[\leadsto x + 0.3333333333333333 \cdot \frac{\color{blue}{\frac{t}{z}}}{y} \]
    6. Simplified89.7%

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

    if 7.6e18 < y

    1. Initial program 98.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*98.3%

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

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified98.3%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 92.9%

      \[\leadsto \color{blue}{x + -0.3333333333333333 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. metadata-eval92.9%

        \[\leadsto x + \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
      2. cancel-sign-sub-inv92.9%

        \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
      3. associate-*r/93.0%

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
    7. Simplified93.0%

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

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

Alternative 5: 91.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+67}:\\
\;\;\;\;x - \frac{y}{3 \cdot z}\\

\mathbf{elif}\;y \leq 6 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.22000000000000004e67

    1. Initial program 99.8%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 96.8%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. metadata-eval96.8%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac96.9%

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

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative96.9%

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

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

    if -1.22000000000000004e67 < y < 6e18

    1. Initial program 88.1%

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

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 82.9%

      \[\leadsto x + \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z}} \]
    5. Step-by-step derivation
      1. associate-/r*84.9%

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\frac{\frac{t}{y}}{z}} \]
      2. *-lft-identity84.9%

        \[\leadsto x + 0.3333333333333333 \cdot \frac{\color{blue}{1 \cdot \frac{t}{y}}}{z} \]
      3. associate-*l/84.8%

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\left(\frac{1}{z} \cdot \frac{t}{y}\right)} \]
      4. associate-*r/89.6%

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\frac{\frac{1}{z} \cdot t}{y}} \]
      5. associate-*l/89.7%

        \[\leadsto x + 0.3333333333333333 \cdot \frac{\color{blue}{\frac{1 \cdot t}{z}}}{y} \]
      6. associate-*r/89.7%

        \[\leadsto x + 0.3333333333333333 \cdot \frac{\color{blue}{1 \cdot \frac{t}{z}}}{y} \]
      7. *-lft-identity89.7%

        \[\leadsto x + 0.3333333333333333 \cdot \frac{\color{blue}{\frac{t}{z}}}{y} \]
    6. Simplified89.7%

      \[\leadsto x + \color{blue}{0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}} \]
    7. Step-by-step derivation
      1. associate-*r/89.8%

        \[\leadsto x + \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{z}}{y}} \]
    8. Applied egg-rr89.8%

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

    if 6e18 < y

    1. Initial program 98.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*98.3%

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

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified98.3%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 92.9%

      \[\leadsto \color{blue}{x + -0.3333333333333333 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. metadata-eval92.9%

        \[\leadsto x + \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
      2. cancel-sign-sub-inv92.9%

        \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
      3. associate-*r/93.0%

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
    7. Simplified93.0%

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

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

Alternative 6: 46.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+86}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9.3 \cdot 10^{+27}:\\ \;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -4.8e+86) x (if (<= z 9.3e+27) (* (/ y z) -0.3333333333333333) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -4.8e+86) {
		tmp = x;
	} else if (z <= 9.3e+27) {
		tmp = (y / z) * -0.3333333333333333;
	} else {
		tmp = x;
	}
	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 <= (-4.8d+86)) then
        tmp = x
    else if (z <= 9.3d+27) then
        tmp = (y / z) * (-0.3333333333333333d0)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -4.8e+86) {
		tmp = x;
	} else if (z <= 9.3e+27) {
		tmp = (y / z) * -0.3333333333333333;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -4.8e+86:
		tmp = x
	elif z <= 9.3e+27:
		tmp = (y / z) * -0.3333333333333333
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -4.8e+86)
		tmp = x;
	elseif (z <= 9.3e+27)
		tmp = Float64(Float64(y / z) * -0.3333333333333333);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -4.8e+86)
		tmp = x;
	elseif (z <= 9.3e+27)
		tmp = (y / z) * -0.3333333333333333;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.8e+86], x, If[LessEqual[z, 9.3e+27], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+86}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9.3 \cdot 10^{+27}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8000000000000001e86 or 9.30000000000000043e27 < z

    1. Initial program 98.9%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*98.9%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative98.9%

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

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 53.0%

      \[\leadsto \color{blue}{x} \]

    if -4.8000000000000001e86 < z < 9.30000000000000043e27

    1. Initial program 89.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*89.5%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative89.5%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified89.5%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 54.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+86}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9.3 \cdot 10^{+27}:\\ \;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 46.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+85}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{+27}:\\ \;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -4e+85) x (if (<= z 4.7e+27) (/ -0.3333333333333333 (/ z y)) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -4e+85) {
		tmp = x;
	} else if (z <= 4.7e+27) {
		tmp = -0.3333333333333333 / (z / y);
	} else {
		tmp = x;
	}
	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 <= (-4d+85)) then
        tmp = x
    else if (z <= 4.7d+27) then
        tmp = (-0.3333333333333333d0) / (z / y)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -4e+85) {
		tmp = x;
	} else if (z <= 4.7e+27) {
		tmp = -0.3333333333333333 / (z / y);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -4e+85:
		tmp = x
	elif z <= 4.7e+27:
		tmp = -0.3333333333333333 / (z / y)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -4e+85)
		tmp = x;
	elseif (z <= 4.7e+27)
		tmp = Float64(-0.3333333333333333 / Float64(z / y));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -4e+85)
		tmp = x;
	elseif (z <= 4.7e+27)
		tmp = -0.3333333333333333 / (z / y);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -4e+85], x, If[LessEqual[z, 4.7e+27], N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+85}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{+27}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.0000000000000001e85 or 4.69999999999999976e27 < z

    1. Initial program 98.9%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*98.9%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative98.9%

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

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 53.0%

      \[\leadsto \color{blue}{x} \]

    if -4.0000000000000001e85 < z < 4.69999999999999976e27

    1. Initial program 89.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*89.5%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative89.5%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified89.5%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 54.1%

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

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
    7. Step-by-step derivation
      1. clear-num47.8%

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      2. un-div-inv47.8%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
    8. Applied egg-rr47.8%

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

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

Alternative 8: 95.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
	return x + (0.3333333333333333 * (((t / y) - 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 = x + (0.3333333333333333d0 * (((t / y) - y) / z))
end function
public static double code(double x, double y, double z, double t) {
	return x + (0.3333333333333333 * (((t / y) - y) / z));
}
def code(x, y, z, t):
	return x + (0.3333333333333333 * (((t / y) - y) / z))
function code(x, y, z, t)
	return Float64(x + Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)))
end
function tmp = code(x, y, z, t)
	tmp = x + (0.3333333333333333 * (((t / y) - y) / z));
end
code[x_, y_, z_, t_] := N[(x + N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

    \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in z around 0 96.0%

    \[\leadsto x + \color{blue}{0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}} \]
  5. Final simplification96.0%

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

Alternative 9: 95.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ x + \frac{0.3333333333333333}{\frac{z}{\frac{t}{y} - y}} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (/ 0.3333333333333333 (/ z (- (/ t y) y)))))
double code(double x, double y, double z, double t) {
	return x + (0.3333333333333333 / (z / ((t / y) - 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 + (0.3333333333333333d0 / (z / ((t / y) - y)))
end function
public static double code(double x, double y, double z, double t) {
	return x + (0.3333333333333333 / (z / ((t / y) - y)));
}
def code(x, y, z, t):
	return x + (0.3333333333333333 / (z / ((t / y) - y)))
function code(x, y, z, t)
	return Float64(x + Float64(0.3333333333333333 / Float64(z / Float64(Float64(t / y) - y))))
end
function tmp = code(x, y, z, t)
	tmp = x + (0.3333333333333333 / (z / ((t / y) - y)));
end
code[x_, y_, z_, t_] := N[(x + N[(0.3333333333333333 / N[(z / N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{0.3333333333333333}{\frac{z}{\frac{t}{y} - y}}
\end{array}
Derivation
  1. Initial program 93.2%

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

    \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-*l/96.0%

      \[\leadsto x + \color{blue}{\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}} \]
    2. associate-/l*96.0%

      \[\leadsto x + \color{blue}{\frac{0.3333333333333333}{\frac{z}{\frac{t}{y} - y}}} \]
  5. Applied egg-rr96.0%

    \[\leadsto x + \color{blue}{\frac{0.3333333333333333}{\frac{z}{\frac{t}{y} - y}}} \]
  6. Final simplification96.0%

    \[\leadsto x + \frac{0.3333333333333333}{\frac{z}{\frac{t}{y} - y}} \]
  7. Add Preprocessing

Alternative 10: 95.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ x + \frac{\frac{t}{y} - y}{3 \cdot z} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* 3.0 z))))
double code(double x, double y, double z, double t) {
	return x + (((t / y) - y) / (3.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 = x + (((t / y) - y) / (3.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
	return x + (((t / y) - y) / (3.0 * z));
}
def code(x, y, z, t):
	return x + (((t / y) - y) / (3.0 * z))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(3.0 * z)))
end
function tmp = code(x, y, z, t)
	tmp = x + (((t / y) - y) / (3.0 * z));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. associate-*l*93.2%

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

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

    \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-+l-93.2%

      \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{z \cdot \left(y \cdot 3\right)}\right)} \]
    2. *-commutative93.2%

      \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{z \cdot \color{blue}{\left(3 \cdot y\right)}}\right) \]
    3. associate-*l*93.2%

      \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}}\right) \]
    4. associate-/l/96.1%

      \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
    5. sub-div96.0%

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

    \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
  7. Final simplification96.0%

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

Alternative 11: 62.9% accurate, 2.1× speedup?

\[\begin{array}{l} \\ x - 0.3333333333333333 \cdot \frac{y}{z} \end{array} \]
(FPCore (x y z t) :precision binary64 (- x (* 0.3333333333333333 (/ y z))))
double code(double x, double y, double z, double t) {
	return x - (0.3333333333333333 * (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 = x - (0.3333333333333333d0 * (y / z))
end function
public static double code(double x, double y, double z, double t) {
	return x - (0.3333333333333333 * (y / z));
}
def code(x, y, z, t):
	return x - (0.3333333333333333 * (y / z))
function code(x, y, z, t)
	return Float64(x - Float64(0.3333333333333333 * Float64(y / z)))
end
function tmp = code(x, y, z, t)
	tmp = x - (0.3333333333333333 * (y / z));
end
code[x_, y_, z_, t_] := N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - 0.3333333333333333 \cdot \frac{y}{z}
\end{array}
Derivation
  1. Initial program 93.2%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. associate-*l*93.2%

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

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

    \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in t around 0 61.8%

    \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
  6. Final simplification61.8%

    \[\leadsto x - 0.3333333333333333 \cdot \frac{y}{z} \]
  7. Add Preprocessing

Alternative 12: 62.9% accurate, 2.1× speedup?

\[\begin{array}{l} \\ x - y \cdot \frac{0.3333333333333333}{z} \end{array} \]
(FPCore (x y z t) :precision binary64 (- x (* y (/ 0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
	return x - (y * (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 = x - (y * (0.3333333333333333d0 / z))
end function
public static double code(double x, double y, double z, double t) {
	return x - (y * (0.3333333333333333 / z));
}
def code(x, y, z, t):
	return x - (y * (0.3333333333333333 / z))
function code(x, y, z, t)
	return Float64(x - Float64(y * Float64(0.3333333333333333 / z)))
end
function tmp = code(x, y, z, t)
	tmp = x - (y * (0.3333333333333333 / z));
end
code[x_, y_, z_, t_] := N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - y \cdot \frac{0.3333333333333333}{z}
\end{array}
Derivation
  1. Initial program 93.2%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. associate-*l*93.2%

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

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

    \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in y around inf 61.8%

    \[\leadsto \color{blue}{x + -0.3333333333333333 \cdot \frac{y}{z}} \]
  6. Step-by-step derivation
    1. metadata-eval61.8%

      \[\leadsto x + \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
    2. cancel-sign-sub-inv61.8%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    3. associate-*r/61.8%

      \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
  7. Simplified61.8%

    \[\leadsto \color{blue}{x - \frac{0.3333333333333333 \cdot y}{z}} \]
  8. Step-by-step derivation
    1. associate-/l*61.8%

      \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{\frac{z}{y}}} \]
    2. associate-/r/61.8%

      \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
  9. Applied egg-rr61.8%

    \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
  10. Final simplification61.8%

    \[\leadsto x - y \cdot \frac{0.3333333333333333}{z} \]
  11. Add Preprocessing

Alternative 13: 62.9% accurate, 2.1× speedup?

\[\begin{array}{l} \\ x - \frac{0.3333333333333333}{\frac{z}{y}} \end{array} \]
(FPCore (x y z t) :precision binary64 (- x (/ 0.3333333333333333 (/ z y))))
double code(double x, double y, double z, double t) {
	return x - (0.3333333333333333 / (z / 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 - (0.3333333333333333d0 / (z / y))
end function
public static double code(double x, double y, double z, double t) {
	return x - (0.3333333333333333 / (z / y));
}
def code(x, y, z, t):
	return x - (0.3333333333333333 / (z / y))
function code(x, y, z, t)
	return Float64(x - Float64(0.3333333333333333 / Float64(z / y)))
end
function tmp = code(x, y, z, t)
	tmp = x - (0.3333333333333333 / (z / y));
end
code[x_, y_, z_, t_] := N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{0.3333333333333333}{\frac{z}{y}}
\end{array}
Derivation
  1. Initial program 93.2%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. associate-*l*93.2%

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

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

    \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in t around 0 61.8%

    \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
  6. Step-by-step derivation
    1. clear-num61.8%

      \[\leadsto x - 0.3333333333333333 \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
    2. un-div-inv61.8%

      \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{\frac{z}{y}}} \]
  7. Applied egg-rr61.8%

    \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{\frac{z}{y}}} \]
  8. Final simplification61.8%

    \[\leadsto x - \frac{0.3333333333333333}{\frac{z}{y}} \]
  9. Add Preprocessing

Alternative 14: 63.0% accurate, 2.1× speedup?

\[\begin{array}{l} \\ x - \frac{y}{3 \cdot z} \end{array} \]
(FPCore (x y z t) :precision binary64 (- x (/ y (* 3.0 z))))
double code(double x, double y, double z, double t) {
	return x - (y / (3.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 = x - (y / (3.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
	return x - (y / (3.0 * z));
}
def code(x, y, z, t):
	return x - (y / (3.0 * z))
function code(x, y, z, t)
	return Float64(x - Float64(y / Float64(3.0 * z)))
end
function tmp = code(x, y, z, t)
	tmp = x - (y / (3.0 * z));
end
code[x_, y_, z_, t_] := N[(x - N[(y / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. associate-*l*93.2%

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

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

    \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in t around 0 61.8%

    \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
  6. Step-by-step derivation
    1. metadata-eval61.8%

      \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
    2. times-frac61.8%

      \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
    3. *-un-lft-identity61.8%

      \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
    4. *-commutative61.8%

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

    \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
  8. Final simplification61.8%

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

Alternative 15: 30.3% accurate, 15.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 93.2%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. associate-*l*93.2%

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

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

    \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 25.9%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification25.9%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 96.3% accurate, 1.0× 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 2024031 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

  :herbie-target
  (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))

  (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))