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

Percentage Accurate: 99.2% → 99.2%
Time: 8.7s
Alternatives: 13
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 13 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.9%

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

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

Alternative 2: 79.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{x}{y}}{y}\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+39}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -6.8 \cdot 10^{-175}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.3999999999999999e39 or 1.46000000000000001e-39 < y

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative94.0%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    4. Simplified94.0%

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    5. Taylor expanded in y around inf 92.5%

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

    if -3.3999999999999999e39 < y < -8.0000000000000002e-58

    1. Initial program 99.9%

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

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. div-inv75.0%

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

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

        \[\leadsto 1 - \color{blue}{\frac{x \cdot \frac{1}{z}}{t}} \]
      2. div-inv75.3%

        \[\leadsto 1 - \frac{\color{blue}{\frac{x}{z}}}{t} \]
    6. Applied egg-rr75.3%

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

    if -8.0000000000000002e-58 < y < -6.8e-175

    1. Initial program 99.9%

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

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

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

        \[\leadsto 1 - \color{blue}{\frac{-1 \cdot x}{t \cdot y}} \]
      2. neg-mul-145.2%

        \[\leadsto 1 - \frac{\color{blue}{-x}}{t \cdot y} \]
      3. *-commutative45.2%

        \[\leadsto 1 - \frac{-x}{\color{blue}{y \cdot t}} \]
    5. Simplified45.2%

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

    if -6.8e-175 < y < 1.46000000000000001e-39

    1. Initial program 96.1%

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

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. div-inv73.3%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{t} \cdot \frac{1}{z}} \]
    5. Step-by-step derivation
      1. un-div-inv73.3%

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    6. Applied egg-rr73.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+39}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \mathbf{elif}\;y \leq -8 \cdot 10^{-58}:\\ \;\;\;\;1 - \frac{\frac{x}{z}}{t}\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-175}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \mathbf{elif}\;y \leq 1.46 \cdot 10^{-39}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 3: 91.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-154} \lor \neg \left(t \leq 2.6 \cdot 10^{-46}\right):\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.19999999999999993e-154 or 2.6000000000000002e-46 < t

    1. Initial program 99.9%

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

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

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

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

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

    if -1.19999999999999993e-154 < t < 2.6000000000000002e-46

    1. Initial program 96.9%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative94.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{-154} \lor \neg \left(t \leq 2.6 \cdot 10^{-46}\right):\\ \;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\ \end{array} \]

Alternative 4: 71.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+59} \lor \neg \left(y \leq 8 \cdot 10^{-66}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.4000000000000002e59 or 7.9999999999999998e-66 < y

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative93.4%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    4. Simplified93.4%

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    5. Taylor expanded in y around 0 74.9%

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

        \[\leadsto 1 - \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y} \]
      2. neg-mul-174.9%

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

      \[\leadsto 1 - \frac{\color{blue}{\frac{-x}{z}}}{y} \]
    8. Step-by-step derivation
      1. expm1-log1p-u73.6%

        \[\leadsto 1 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{-x}{z}}{y}\right)\right)} \]
      2. expm1-udef73.6%

        \[\leadsto 1 - \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\frac{-x}{z}}{y}\right)} - 1\right)} \]
      3. associate-/l/73.6%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{-x}{y \cdot z}}\right)} - 1\right) \]
      4. add-sqr-sqrt32.2%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{y \cdot z}\right)} - 1\right) \]
      5. sqrt-unprod65.6%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{y \cdot z}\right)} - 1\right) \]
      6. sqr-neg65.6%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{y \cdot z}\right)} - 1\right) \]
      7. sqrt-unprod41.3%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{y \cdot z}\right)} - 1\right) \]
      8. add-sqr-sqrt72.8%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{x}}{y \cdot z}\right)} - 1\right) \]
    9. Applied egg-rr72.8%

      \[\leadsto 1 - \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{y \cdot z}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def72.8%

        \[\leadsto 1 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{y \cdot z}\right)\right)} \]
      2. expm1-log1p73.6%

        \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot z}} \]
    11. Simplified73.6%

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

    if -2.4000000000000002e59 < y < 7.9999999999999998e-66

    1. Initial program 97.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+59} \lor \neg \left(y \leq 8 \cdot 10^{-66}\right):\\ \;\;\;\;1 - \frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \end{array} \]

Alternative 5: 70.8% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.70000000000000003e59 or 1.30000000000000005e-65 < y

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative93.4%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    4. Simplified93.4%

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    5. Taylor expanded in y around 0 74.9%

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

        \[\leadsto 1 - \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y} \]
      2. neg-mul-174.9%

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

      \[\leadsto 1 - \frac{\color{blue}{\frac{-x}{z}}}{y} \]
    8. Step-by-step derivation
      1. expm1-log1p-u73.6%

        \[\leadsto 1 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{-x}{z}}{y}\right)\right)} \]
      2. expm1-udef73.6%

        \[\leadsto 1 - \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\frac{-x}{z}}{y}\right)} - 1\right)} \]
      3. associate-/l/73.6%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{-x}{y \cdot z}}\right)} - 1\right) \]
      4. add-sqr-sqrt32.2%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{y \cdot z}\right)} - 1\right) \]
      5. sqrt-unprod65.6%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{y \cdot z}\right)} - 1\right) \]
      6. sqr-neg65.6%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{y \cdot z}\right)} - 1\right) \]
      7. sqrt-unprod41.3%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{y \cdot z}\right)} - 1\right) \]
      8. add-sqr-sqrt72.8%

        \[\leadsto 1 - \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{x}}{y \cdot z}\right)} - 1\right) \]
    9. Applied egg-rr72.8%

      \[\leadsto 1 - \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{y \cdot z}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def72.8%

        \[\leadsto 1 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{y \cdot z}\right)\right)} \]
      2. expm1-log1p73.6%

        \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot z}} \]
    11. Simplified73.6%

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

    if -1.70000000000000003e59 < y < 1.30000000000000005e-65

    1. Initial program 97.5%

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

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. div-inv69.3%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{t} \cdot \frac{1}{z}} \]
    5. Step-by-step derivation
      1. un-div-inv69.3%

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    6. Applied egg-rr69.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+59} \lor \neg \left(y \leq 1.3 \cdot 10^{-65}\right):\\ \;\;\;\;1 - \frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z}\\ \end{array} \]

Alternative 6: 81.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+39} \lor \neg \left(y \leq 5.3 \cdot 10^{-39}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.3999999999999999e39 or 5.30000000000000003e-39 < y

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative94.0%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    4. Simplified94.0%

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    5. Taylor expanded in y around inf 92.5%

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

    if -3.3999999999999999e39 < y < 5.30000000000000003e-39

    1. Initial program 97.5%

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

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. div-inv67.3%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{t} \cdot \frac{1}{z}} \]
    5. Step-by-step derivation
      1. un-div-inv67.3%

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    6. Applied egg-rr67.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+39} \lor \neg \left(y \leq 5.3 \cdot 10^{-39}\right):\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z}\\ \end{array} \]

Alternative 7: 63.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 4.3 \cdot 10^{-288}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.49999999999999972e-36

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto 1 - \frac{\color{blue}{-x}}{y \cdot z} \]
      3. *-commutative83.7%

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

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

    if -7.49999999999999972e-36 < z < 4.29999999999999976e-288

    1. Initial program 97.5%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative66.6%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    4. Simplified67.5%

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    5. Taylor expanded in y around inf 66.0%

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

    if 4.29999999999999976e-288 < z

    1. Initial program 99.1%

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

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

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

        \[\leadsto 1 - \color{blue}{\frac{-1 \cdot x}{t \cdot y}} \]
      2. neg-mul-162.5%

        \[\leadsto 1 - \frac{\color{blue}{-x}}{t \cdot y} \]
      3. *-commutative62.5%

        \[\leadsto 1 - \frac{-x}{\color{blue}{y \cdot t}} \]
    5. Simplified62.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{-36}:\\ \;\;\;\;1 + \frac{x}{y \cdot z}\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-288}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \end{array} \]

Alternative 8: 63.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-291}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.9000000000000001e-35

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative87.8%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    4. Simplified87.9%

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    5. Taylor expanded in y around 0 83.7%

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

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

        \[\leadsto 1 - \frac{\frac{\color{blue}{-x}}{z}}{y} \]
    7. Simplified83.7%

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

    if -1.9000000000000001e-35 < z < 1.55000000000000006e-291

    1. Initial program 97.4%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative67.4%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    4. Simplified68.3%

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    5. Taylor expanded in y around inf 66.8%

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

    if 1.55000000000000006e-291 < z

    1. Initial program 99.1%

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

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

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

        \[\leadsto 1 - \color{blue}{\frac{-1 \cdot x}{t \cdot y}} \]
      2. neg-mul-163.8%

        \[\leadsto 1 - \frac{\color{blue}{-x}}{t \cdot y} \]
      3. *-commutative63.8%

        \[\leadsto 1 - \frac{-x}{\color{blue}{y \cdot t}} \]
    5. Simplified63.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{-35}:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-291}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \end{array} \]

Alternative 9: 76.7% accurate, 1.0× speedup?

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

\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 < -2.6e9

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative87.8%

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

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

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    5. Taylor expanded in y around 0 85.9%

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

        \[\leadsto 1 - \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y} \]
      2. neg-mul-185.9%

        \[\leadsto 1 - \frac{\frac{\color{blue}{-x}}{z}}{y} \]
    7. Simplified85.9%

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

    if -2.6e9 < z

    1. Initial program 98.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2600000000:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\ \end{array} \]

Alternative 10: 76.9% accurate, 1.0× speedup?

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

\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 < -2.50000000000000008e-54

    1. Initial program 100.0%

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

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

    if -2.50000000000000008e-54 < z

    1. Initial program 98.4%

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

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

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

Alternative 11: 77.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-55}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25e-55

    1. Initial program 100.0%

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

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

    if -1.25e-55 < z

    1. Initial program 98.4%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
    3. Step-by-step derivation
      1. *-commutative80.9%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - t}}{y}} \]
    4. Simplified81.1%

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

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

Alternative 12: 77.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.36 \cdot 10^{-55}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35999999999999993e-55

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - z\right)}} \]
    3. Step-by-step derivation
      1. *-commutative86.2%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y}} \]
    4. Simplified86.2%

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

    if -1.35999999999999993e-55 < z

    1. Initial program 98.4%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{y \cdot \left(y - t\right)}} \]
    3. Step-by-step derivation
      1. *-commutative80.9%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - t}}{y}} \]
    4. Simplified81.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.36 \cdot 10^{-55}:\\ \;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\ \end{array} \]

Alternative 13: 62.2% accurate, 1.6× speedup?

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

\\
1 - \frac{x}{z \cdot t}
\end{array}
Derivation
  1. Initial program 98.9%

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

    \[\leadsto 1 - \color{blue}{\frac{x}{t \cdot z}} \]
  3. Final simplification58.7%

    \[\leadsto 1 - \frac{x}{z \cdot t} \]

Reproduce

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