Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A

Percentage Accurate: 99.2% → 99.2%
Time: 12.0s
Alternatives: 12
Speedup: 1.0×

Specification

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

\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\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 12 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: 99.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.2% accurate, 1.0× speedup?

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

\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Derivation
  1. Initial program 98.6%

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  2. Add Preprocessing
  3. Final simplification98.6%

    \[\leadsto 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  4. Add Preprocessing

Alternative 2: 85.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-184} \lor \neg \left(z \leq 1.7 \cdot 10^{-103}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\

\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.2e-184 or 1.70000000000000001e-103 < z

    1. Initial program 99.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg99.0%

        \[\leadsto \color{blue}{1 + \left(-\frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\right)} \]
      2. neg-mul-199.0%

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

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{-1 \cdot \frac{x}{y - z}}{y - t}} \]
      7. metadata-eval98.5%

        \[\leadsto 1 + \frac{\color{blue}{\frac{1}{-1}} \cdot \frac{x}{y - z}}{y - t} \]
      8. times-frac98.5%

        \[\leadsto 1 + \frac{\color{blue}{\frac{1 \cdot x}{-1 \cdot \left(y - z\right)}}}{y - t} \]
      9. *-lft-identity98.5%

        \[\leadsto 1 + \frac{\frac{\color{blue}{x}}{-1 \cdot \left(y - z\right)}}{y - t} \]
      10. neg-mul-198.5%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{-\left(y - z\right)}}}{y - t} \]
      11. sub-neg98.5%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(y + \left(-z\right)\right)}}}{y - t} \]
      12. +-commutative98.5%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(\left(-z\right) + y\right)}}}{y - t} \]
      13. distribute-neg-out98.5%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{\left(-\left(-z\right)\right) + \left(-y\right)}}}{y - t} \]
      14. remove-double-neg98.5%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z} + \left(-y\right)}}{y - t} \]
      15. sub-neg98.5%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z - y}}}{y - t} \]
    3. Simplified98.5%

      \[\leadsto \color{blue}{1 + \frac{\frac{x}{z - y}}{y - t}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 91.6%

      \[\leadsto 1 + \color{blue}{\frac{x}{z \cdot \left(y - t\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*92.0%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    7. Simplified92.0%

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

    if -3.2e-184 < z < 1.70000000000000001e-103

    1. Initial program 97.5%

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

      \[\leadsto 1 - \color{blue}{-1 \cdot \frac{x}{t \cdot \left(y - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/83.4%

        \[\leadsto 1 - \color{blue}{\frac{-1 \cdot x}{t \cdot \left(y - z\right)}} \]
      2. neg-mul-183.4%

        \[\leadsto 1 - \frac{\color{blue}{-x}}{t \cdot \left(y - z\right)} \]
    5. Simplified83.4%

      \[\leadsto 1 - \color{blue}{\frac{-x}{t \cdot \left(y - z\right)}} \]
    6. Taylor expanded in y around inf 73.4%

      \[\leadsto 1 - \color{blue}{-1 \cdot \frac{x}{t \cdot y}} \]
    7. Step-by-step derivation
      1. mul-1-neg73.4%

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

        \[\leadsto 1 - \left(-\color{blue}{\frac{\frac{x}{t}}{y}}\right) \]
      3. distribute-neg-frac74.9%

        \[\leadsto 1 - \color{blue}{\frac{-\frac{x}{t}}{y}} \]
    8. Simplified74.9%

      \[\leadsto 1 - \color{blue}{\frac{-\frac{x}{t}}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{-184} \lor \neg \left(z \leq 1.7 \cdot 10^{-103}\right):\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 91.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-78} \lor \neg \left(z \leq 4.8 \cdot 10^{-102}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.70000000000000006e-78 or 4.8e-102 < z

    1. Initial program 100.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \color{blue}{1 + \left(-\frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\right)} \]
      2. neg-mul-1100.0%

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

        \[\leadsto 1 + \color{blue}{\frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \cdot -1} \]
      4. *-commutative100.0%

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

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

        \[\leadsto 1 + \color{blue}{\frac{-1 \cdot \frac{x}{y - z}}{y - t}} \]
      7. metadata-eval99.9%

        \[\leadsto 1 + \frac{\color{blue}{\frac{1}{-1}} \cdot \frac{x}{y - z}}{y - t} \]
      8. times-frac99.9%

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

        \[\leadsto 1 + \frac{\frac{\color{blue}{x}}{-1 \cdot \left(y - z\right)}}{y - t} \]
      10. neg-mul-199.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{-\left(y - z\right)}}}{y - t} \]
      11. sub-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(y + \left(-z\right)\right)}}}{y - t} \]
      12. +-commutative99.9%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(\left(-z\right) + y\right)}}}{y - t} \]
      13. distribute-neg-out99.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{\left(-\left(-z\right)\right) + \left(-y\right)}}}{y - t} \]
      14. remove-double-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z} + \left(-y\right)}}{y - t} \]
      15. sub-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z - y}}}{y - t} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{1 + \frac{\frac{x}{z - y}}{y - t}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 96.6%

      \[\leadsto 1 + \color{blue}{\frac{x}{z \cdot \left(y - t\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*96.6%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    7. Simplified96.6%

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

    if -1.70000000000000006e-78 < z < 4.8e-102

    1. Initial program 95.7%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-78} \lor \neg \left(z \leq 4.8 \cdot 10^{-102}\right):\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 91.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-78} \lor \neg \left(z \leq 6.4 \cdot 10^{-103}\right):\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\

\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1999999999999999e-78 or 6.39999999999999953e-103 < z

    1. Initial program 100.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \color{blue}{1 + \left(-\frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\right)} \]
      2. neg-mul-1100.0%

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

        \[\leadsto 1 + \color{blue}{\frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \cdot -1} \]
      4. *-commutative100.0%

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

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

        \[\leadsto 1 + \color{blue}{\frac{-1 \cdot \frac{x}{y - z}}{y - t}} \]
      7. metadata-eval99.9%

        \[\leadsto 1 + \frac{\color{blue}{\frac{1}{-1}} \cdot \frac{x}{y - z}}{y - t} \]
      8. times-frac99.9%

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

        \[\leadsto 1 + \frac{\frac{\color{blue}{x}}{-1 \cdot \left(y - z\right)}}{y - t} \]
      10. neg-mul-199.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{-\left(y - z\right)}}}{y - t} \]
      11. sub-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(y + \left(-z\right)\right)}}}{y - t} \]
      12. +-commutative99.9%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(\left(-z\right) + y\right)}}}{y - t} \]
      13. distribute-neg-out99.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{\left(-\left(-z\right)\right) + \left(-y\right)}}}{y - t} \]
      14. remove-double-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z} + \left(-y\right)}}{y - t} \]
      15. sub-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z - y}}}{y - t} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{1 + \frac{\frac{x}{z - y}}{y - t}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 96.6%

      \[\leadsto 1 + \color{blue}{\frac{x}{z \cdot \left(y - t\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*96.6%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    7. Simplified96.6%

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

    if -2.1999999999999999e-78 < z < 6.39999999999999953e-103

    1. Initial program 95.7%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num95.7%

        \[\leadsto 1 - \color{blue}{\frac{1}{\frac{\left(y - z\right) \cdot \left(y - t\right)}{x}}} \]
      2. inv-pow95.7%

        \[\leadsto 1 - \color{blue}{{\left(\frac{\left(y - z\right) \cdot \left(y - t\right)}{x}\right)}^{-1}} \]
      3. *-commutative95.7%

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

        \[\leadsto 1 - {\color{blue}{\left(\frac{y - t}{\frac{x}{y - z}}\right)}}^{-1} \]
    4. Applied egg-rr88.5%

      \[\leadsto 1 - \color{blue}{{\left(\frac{y - t}{\frac{x}{y - z}}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-188.5%

        \[\leadsto 1 - \color{blue}{\frac{1}{\frac{y - t}{\frac{x}{y - z}}}} \]
      2. associate-/r/99.8%

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

      \[\leadsto 1 - \color{blue}{\frac{1}{\frac{y - t}{x} \cdot \left(y - z\right)}} \]
    7. Taylor expanded in z around 0 81.6%

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
    8. Step-by-step derivation
      1. associate-/r*77.8%

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y}}{y - t}} \]
    9. Simplified77.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{-78} \lor \neg \left(z \leq 6.4 \cdot 10^{-103}\right):\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 1.3 \cdot 10^{-143}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\

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


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

    1. Initial program 97.9%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg97.9%

        \[\leadsto \color{blue}{1 + \left(-\frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\right)} \]
      2. neg-mul-197.9%

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

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{-1 \cdot \frac{x}{y - z}}{y - t}} \]
      7. metadata-eval95.2%

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

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

        \[\leadsto 1 + \frac{\frac{\color{blue}{x}}{-1 \cdot \left(y - z\right)}}{y - t} \]
      10. neg-mul-195.2%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{-\left(y - z\right)}}}{y - t} \]
      11. sub-neg95.2%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(y + \left(-z\right)\right)}}}{y - t} \]
      12. +-commutative95.2%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(\left(-z\right) + y\right)}}}{y - t} \]
      13. distribute-neg-out95.2%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{\left(-\left(-z\right)\right) + \left(-y\right)}}}{y - t} \]
      14. remove-double-neg95.2%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z} + \left(-y\right)}}{y - t} \]
      15. sub-neg95.2%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z - y}}}{y - t} \]
    3. Simplified95.2%

      \[\leadsto \color{blue}{1 + \frac{\frac{x}{z - y}}{y - t}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 74.7%

      \[\leadsto 1 + \color{blue}{\frac{x}{z \cdot \left(y - t\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*76.5%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    7. Simplified76.5%

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

    if -2.5e-206 < t < 1.29999999999999994e-143

    1. Initial program 97.8%

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

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

    if 1.29999999999999994e-143 < t

    1. Initial program 99.9%

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

      \[\leadsto 1 - \color{blue}{-1 \cdot \frac{x}{t \cdot \left(y - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/95.1%

        \[\leadsto 1 - \color{blue}{\frac{-1 \cdot x}{t \cdot \left(y - z\right)}} \]
      2. neg-mul-195.1%

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

      \[\leadsto 1 - \color{blue}{\frac{-x}{t \cdot \left(y - z\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.8%

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

Alternative 6: 87.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 2.55 \cdot 10^{-61}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.7000000000000001e-205

    1. Initial program 97.9%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg97.9%

        \[\leadsto \color{blue}{1 + \left(-\frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\right)} \]
      2. neg-mul-197.9%

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

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{-1 \cdot \frac{x}{y - z}}{y - t}} \]
      7. metadata-eval95.2%

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

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

        \[\leadsto 1 + \frac{\frac{\color{blue}{x}}{-1 \cdot \left(y - z\right)}}{y - t} \]
      10. neg-mul-195.2%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{-\left(y - z\right)}}}{y - t} \]
      11. sub-neg95.2%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(y + \left(-z\right)\right)}}}{y - t} \]
      12. +-commutative95.2%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(\left(-z\right) + y\right)}}}{y - t} \]
      13. distribute-neg-out95.2%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{\left(-\left(-z\right)\right) + \left(-y\right)}}}{y - t} \]
      14. remove-double-neg95.2%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z} + \left(-y\right)}}{y - t} \]
      15. sub-neg95.2%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z - y}}}{y - t} \]
    3. Simplified95.2%

      \[\leadsto \color{blue}{1 + \frac{\frac{x}{z - y}}{y - t}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 74.7%

      \[\leadsto 1 + \color{blue}{\frac{x}{z \cdot \left(y - t\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*76.5%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    7. Simplified76.5%

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

    if -3.7000000000000001e-205 < t < 2.54999999999999984e-61

    1. Initial program 98.3%

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

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

    if 2.54999999999999984e-61 < t

    1. Initial program 99.8%

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

      \[\leadsto 1 - \color{blue}{-1 \cdot \frac{x}{t \cdot \left(y - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/96.7%

        \[\leadsto 1 - \color{blue}{\frac{-1 \cdot x}{t \cdot \left(y - z\right)}} \]
      2. neg-mul-196.7%

        \[\leadsto 1 - \frac{\color{blue}{-x}}{t \cdot \left(y - z\right)} \]
    5. Simplified96.7%

      \[\leadsto 1 - \color{blue}{\frac{-x}{t \cdot \left(y - z\right)}} \]
    6. Taylor expanded in x around 0 96.7%

      \[\leadsto 1 - \color{blue}{-1 \cdot \frac{x}{t \cdot \left(y - z\right)}} \]
    7. Step-by-step derivation
      1. mul-1-neg96.7%

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

        \[\leadsto 1 - \left(-\color{blue}{\frac{\frac{x}{t}}{y - z}}\right) \]
      3. distribute-neg-frac96.8%

        \[\leadsto 1 - \color{blue}{\frac{-\frac{x}{t}}{y - z}} \]
    8. Simplified96.8%

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

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

Alternative 7: 77.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{-129}:\\
\;\;\;\;1\\

\mathbf{elif}\;t \leq 4.1 \cdot 10^{-221}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.80000000000000004e-129 or 4.09999999999999981e-221 < t

    1. Initial program 99.2%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
    4. Taylor expanded in x around 0 76.9%

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

    if -9.80000000000000004e-129 < t < 4.09999999999999981e-221

    1. Initial program 95.9%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg95.9%

        \[\leadsto \color{blue}{1 + \left(-\frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\right)} \]
      2. neg-mul-195.9%

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

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{-1 \cdot \frac{x}{y - z}}{y - t}} \]
      7. metadata-eval99.9%

        \[\leadsto 1 + \frac{\color{blue}{\frac{1}{-1}} \cdot \frac{x}{y - z}}{y - t} \]
      8. times-frac99.9%

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

        \[\leadsto 1 + \frac{\frac{\color{blue}{x}}{-1 \cdot \left(y - z\right)}}{y - t} \]
      10. neg-mul-199.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{-\left(y - z\right)}}}{y - t} \]
      11. sub-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(y + \left(-z\right)\right)}}}{y - t} \]
      12. +-commutative99.9%

        \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(\left(-z\right) + y\right)}}}{y - t} \]
      13. distribute-neg-out99.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{\left(-\left(-z\right)\right) + \left(-y\right)}}}{y - t} \]
      14. remove-double-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z} + \left(-y\right)}}{y - t} \]
      15. sub-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z - y}}}{y - t} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{1 + \frac{\frac{x}{z - y}}{y - t}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 82.0%

      \[\leadsto 1 + \color{blue}{\frac{x}{z \cdot \left(y - t\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*86.0%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    7. Simplified86.0%

      \[\leadsto 1 + \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    8. Taylor expanded in y around inf 77.8%

      \[\leadsto 1 + \color{blue}{\frac{x}{y \cdot z}} \]
    9. Step-by-step derivation
      1. *-commutative77.8%

        \[\leadsto 1 + \frac{x}{\color{blue}{z \cdot y}} \]
    10. Simplified77.8%

      \[\leadsto 1 + \color{blue}{\frac{x}{z \cdot y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.8 \cdot 10^{-129}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-221}:\\ \;\;\;\;1 + \frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 77.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-170}:\\
\;\;\;\;1\\

\mathbf{elif}\;z \leq 3.05 \cdot 10^{-109}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3499999999999999e-170 or 3.0499999999999998e-109 < z

    1. Initial program 99.4%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
    4. Taylor expanded in x around 0 79.5%

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

    if -1.3499999999999999e-170 < z < 3.0499999999999998e-109

    1. Initial program 96.2%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
    4. Taylor expanded in t around inf 71.8%

      \[\leadsto \color{blue}{1 + \frac{x}{t \cdot y}} \]
    5. Step-by-step derivation
      1. +-commutative71.8%

        \[\leadsto \color{blue}{\frac{x}{t \cdot y} + 1} \]
    6. Simplified71.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-170}:\\ \;\;\;\;1\\ \mathbf{elif}\;z \leq 3.05 \cdot 10^{-109}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.76 \cdot 10^{-99}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-56}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.75999999999999991e-99 or 3.9e-56 < y

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
    4. Taylor expanded in x around 0 89.5%

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

    if -1.75999999999999991e-99 < y < 3.9e-56

    1. Initial program 96.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.76 \cdot 10^{-99}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-56}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 83.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-99}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 4.7 \cdot 10^{-57}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5000000000000003e-99 or 4.6999999999999998e-57 < y

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
    4. Taylor expanded in x around 0 89.5%

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

    if -4.5000000000000003e-99 < y < 4.6999999999999998e-57

    1. Initial program 96.4%

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

      \[\leadsto 1 - \color{blue}{-1 \cdot \frac{x}{t \cdot \left(y - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/83.7%

        \[\leadsto 1 - \color{blue}{\frac{-1 \cdot x}{t \cdot \left(y - z\right)}} \]
      2. neg-mul-183.7%

        \[\leadsto 1 - \frac{\color{blue}{-x}}{t \cdot \left(y - z\right)} \]
    5. Simplified83.7%

      \[\leadsto 1 - \color{blue}{\frac{-x}{t \cdot \left(y - z\right)}} \]
    6. Taylor expanded in y around 0 74.3%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    8. Simplified75.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-99}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-57}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 98.5% accurate, 1.0× speedup?

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

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

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  2. Step-by-step derivation
    1. sub-neg98.6%

      \[\leadsto \color{blue}{1 + \left(-\frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\right)} \]
    2. neg-mul-198.6%

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

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

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

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

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

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

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

      \[\leadsto 1 + \frac{\frac{\color{blue}{x}}{-1 \cdot \left(y - z\right)}}{y - t} \]
    10. neg-mul-196.3%

      \[\leadsto 1 + \frac{\frac{x}{\color{blue}{-\left(y - z\right)}}}{y - t} \]
    11. sub-neg96.3%

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

      \[\leadsto 1 + \frac{\frac{x}{-\color{blue}{\left(\left(-z\right) + y\right)}}}{y - t} \]
    13. distribute-neg-out96.3%

      \[\leadsto 1 + \frac{\frac{x}{\color{blue}{\left(-\left(-z\right)\right) + \left(-y\right)}}}{y - t} \]
    14. remove-double-neg96.3%

      \[\leadsto 1 + \frac{\frac{x}{\color{blue}{z} + \left(-y\right)}}{y - t} \]
    15. sub-neg96.3%

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

    \[\leadsto \color{blue}{1 + \frac{\frac{x}{z - y}}{y - t}} \]
  4. Add Preprocessing
  5. Final simplification96.3%

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

Alternative 12: 76.2% accurate, 11.0× speedup?

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

\\
1
\end{array}
Derivation
  1. Initial program 98.6%

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

    \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
  4. Taylor expanded in x around 0 74.4%

    \[\leadsto \color{blue}{1} \]
  5. Final simplification74.4%

    \[\leadsto 1 \]
  6. Add Preprocessing

Reproduce

?
herbie shell --seed 2024096 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
  :precision binary64
  (- 1.0 (/ x (* (- y z) (- y t)))))