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

Percentage Accurate: 99.2% → 98.6%
Time: 7.8s
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: 98.6% accurate, 0.8× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ 1 + \frac{-1}{\frac{y - t}{x} \cdot \left(y - z\right)} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (+ 1.0 (/ -1.0 (* (/ (- y t) x) (- y z)))))
assert(z < t);
double code(double x, double y, double z, double t) {
	return 1.0 + (-1.0 / (((y - t) / x) * (y - z)));
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 + ((-1.0d0) / (((y - t) / x) * (y - z)))
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	return 1.0 + (-1.0 / (((y - t) / x) * (y - z)));
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	return 1.0 + (-1.0 / (((y - t) / x) * (y - z)))
z, t = sort([z, t])
function code(x, y, z, t)
	return Float64(1.0 + Float64(-1.0 / Float64(Float64(Float64(y - t) / x) * Float64(y - z))))
end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
	tmp = 1.0 + (-1.0 / (((y - t) / x) * (y - z)));
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := N[(1.0 + N[(-1.0 / N[(N[(N[(y - t), $MachinePrecision] / x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1 + \frac{-1}{\frac{y - t}{x} \cdot \left(y - z\right)}
\end{array}
Derivation
  1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.1% accurate, 0.6× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{-85}:\\ \;\;\;\;1 - \frac{x}{t \cdot z}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-58}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{\frac{-x}{y - z}}{y - t}\\ \mathbf{elif}\;t \leq 350:\\ \;\;\;\;1 + \frac{-1}{\frac{y \cdot \left(y - t\right)}{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t -3.7e-85)
   (- 1.0 (/ x (* t z)))
   (if (<= t 1.35e-58)
     (- 1.0 (/ (/ x y) (- y z)))
     (if (<= t 5.5e-26)
       (/ (/ (- x) (- y z)) (- y t))
       (if (<= t 350.0)
         (+ 1.0 (/ -1.0 (/ (* y (- y t)) x)))
         (+ 1.0 (/ (/ x t) (- y z))))))))
assert(z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -3.7e-85) {
		tmp = 1.0 - (x / (t * z));
	} else if (t <= 1.35e-58) {
		tmp = 1.0 - ((x / y) / (y - z));
	} else if (t <= 5.5e-26) {
		tmp = (-x / (y - z)) / (y - t);
	} else if (t <= 350.0) {
		tmp = 1.0 + (-1.0 / ((y * (y - t)) / x));
	} else {
		tmp = 1.0 + ((x / t) / (y - z));
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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-85)) then
        tmp = 1.0d0 - (x / (t * z))
    else if (t <= 1.35d-58) then
        tmp = 1.0d0 - ((x / y) / (y - z))
    else if (t <= 5.5d-26) then
        tmp = (-x / (y - z)) / (y - t)
    else if (t <= 350.0d0) then
        tmp = 1.0d0 + ((-1.0d0) / ((y * (y - t)) / x))
    else
        tmp = 1.0d0 + ((x / t) / (y - z))
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -3.7e-85) {
		tmp = 1.0 - (x / (t * z));
	} else if (t <= 1.35e-58) {
		tmp = 1.0 - ((x / y) / (y - z));
	} else if (t <= 5.5e-26) {
		tmp = (-x / (y - z)) / (y - t);
	} else if (t <= 350.0) {
		tmp = 1.0 + (-1.0 / ((y * (y - t)) / x));
	} else {
		tmp = 1.0 + ((x / t) / (y - z));
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= -3.7e-85:
		tmp = 1.0 - (x / (t * z))
	elif t <= 1.35e-58:
		tmp = 1.0 - ((x / y) / (y - z))
	elif t <= 5.5e-26:
		tmp = (-x / (y - z)) / (y - t)
	elif t <= 350.0:
		tmp = 1.0 + (-1.0 / ((y * (y - t)) / x))
	else:
		tmp = 1.0 + ((x / t) / (y - z))
	return tmp
z, t = sort([z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -3.7e-85)
		tmp = Float64(1.0 - Float64(x / Float64(t * z)));
	elseif (t <= 1.35e-58)
		tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - z)));
	elseif (t <= 5.5e-26)
		tmp = Float64(Float64(Float64(-x) / Float64(y - z)) / Float64(y - t));
	elseif (t <= 350.0)
		tmp = Float64(1.0 + Float64(-1.0 / Float64(Float64(y * Float64(y - t)) / x)));
	else
		tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z)));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -3.7e-85)
		tmp = 1.0 - (x / (t * z));
	elseif (t <= 1.35e-58)
		tmp = 1.0 - ((x / y) / (y - z));
	elseif (t <= 5.5e-26)
		tmp = (-x / (y - z)) / (y - t);
	elseif (t <= 350.0)
		tmp = 1.0 + (-1.0 / ((y * (y - t)) / x));
	else
		tmp = 1.0 + ((x / t) / (y - z));
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, -3.7e-85], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e-58], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-26], N[(N[((-x) / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 350.0], N[(1.0 + N[(-1.0 / N[(N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-85}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\

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

\mathbf{elif}\;t \leq 5.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{\frac{-x}{y - z}}{y - t}\\

\mathbf{elif}\;t \leq 350:\\
\;\;\;\;1 + \frac{-1}{\frac{y \cdot \left(y - t\right)}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -3.69999999999999983e-85

    1. Initial program 99.9%

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

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

    if -3.69999999999999983e-85 < t < 1.3499999999999999e-58

    1. Initial program 97.0%

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

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

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

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

    if 1.3499999999999999e-58 < t < 5.5000000000000005e-26

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 5.5000000000000005e-26 < t < 350

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

    if 350 < 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 98.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{-85}:\\ \;\;\;\;1 - \frac{x}{t \cdot z}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-58}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{\frac{-x}{y - z}}{y - t}\\ \mathbf{elif}\;t \leq 350:\\ \;\;\;\;1 + \frac{-1}{\frac{y \cdot \left(y - t\right)}{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 3: 89.7% accurate, 0.6× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := 1 - \frac{\frac{x}{y}}{y - z}\\ \mathbf{if}\;t \leq -1.05 \cdot 10^{-84}:\\ \;\;\;\;1 - \frac{x}{t \cdot z}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-58}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{-x}{y - z}}{y - t}\\ \mathbf{elif}\;t \leq 215:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- 1.0 (/ (/ x y) (- y z)))))
   (if (<= t -1.05e-84)
     (- 1.0 (/ x (* t z)))
     (if (<= t 1.35e-58)
       t_1
       (if (<= t 5.6e-44)
         (/ (/ (- x) (- y z)) (- y t))
         (if (<= t 215.0) t_1 (+ 1.0 (/ (/ x t) (- y z)))))))))
assert(z < t);
double code(double x, double y, double z, double t) {
	double t_1 = 1.0 - ((x / y) / (y - z));
	double tmp;
	if (t <= -1.05e-84) {
		tmp = 1.0 - (x / (t * z));
	} else if (t <= 1.35e-58) {
		tmp = t_1;
	} else if (t <= 5.6e-44) {
		tmp = (-x / (y - z)) / (y - t);
	} else if (t <= 215.0) {
		tmp = t_1;
	} else {
		tmp = 1.0 + ((x / t) / (y - z));
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 - z))
    if (t <= (-1.05d-84)) then
        tmp = 1.0d0 - (x / (t * z))
    else if (t <= 1.35d-58) then
        tmp = t_1
    else if (t <= 5.6d-44) then
        tmp = (-x / (y - z)) / (y - t)
    else if (t <= 215.0d0) then
        tmp = t_1
    else
        tmp = 1.0d0 + ((x / t) / (y - z))
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = 1.0 - ((x / y) / (y - z));
	double tmp;
	if (t <= -1.05e-84) {
		tmp = 1.0 - (x / (t * z));
	} else if (t <= 1.35e-58) {
		tmp = t_1;
	} else if (t <= 5.6e-44) {
		tmp = (-x / (y - z)) / (y - t);
	} else if (t <= 215.0) {
		tmp = t_1;
	} else {
		tmp = 1.0 + ((x / t) / (y - z));
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	t_1 = 1.0 - ((x / y) / (y - z))
	tmp = 0
	if t <= -1.05e-84:
		tmp = 1.0 - (x / (t * z))
	elif t <= 1.35e-58:
		tmp = t_1
	elif t <= 5.6e-44:
		tmp = (-x / (y - z)) / (y - t)
	elif t <= 215.0:
		tmp = t_1
	else:
		tmp = 1.0 + ((x / t) / (y - z))
	return tmp
z, t = sort([z, t])
function code(x, y, z, t)
	t_1 = Float64(1.0 - Float64(Float64(x / y) / Float64(y - z)))
	tmp = 0.0
	if (t <= -1.05e-84)
		tmp = Float64(1.0 - Float64(x / Float64(t * z)));
	elseif (t <= 1.35e-58)
		tmp = t_1;
	elseif (t <= 5.6e-44)
		tmp = Float64(Float64(Float64(-x) / Float64(y - z)) / Float64(y - t));
	elseif (t <= 215.0)
		tmp = t_1;
	else
		tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z)));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = 1.0 - ((x / y) / (y - z));
	tmp = 0.0;
	if (t <= -1.05e-84)
		tmp = 1.0 - (x / (t * z));
	elseif (t <= 1.35e-58)
		tmp = t_1;
	elseif (t <= 5.6e-44)
		tmp = (-x / (y - z)) / (y - t);
	elseif (t <= 215.0)
		tmp = t_1;
	else
		tmp = 1.0 + ((x / t) / (y - z));
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e-84], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e-58], t$95$1, If[LessEqual[t, 5.6e-44], N[(N[((-x) / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 215.0], t$95$1, N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{x}{y}}{y - z}\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{-84}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{-58}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 5.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{-x}{y - z}}{y - t}\\

\mathbf{elif}\;t \leq 215:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.04999999999999999e-84

    1. Initial program 99.9%

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

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

    if -1.04999999999999999e-84 < t < 1.3499999999999999e-58 or 5.6e-44 < t < 215

    1. Initial program 97.2%

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

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

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

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

    if 1.3499999999999999e-58 < t < 5.6e-44

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-x}{y - z}}{y - t}} \]
    4. Simplified75.6%

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

    if 215 < 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 98.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{-84}:\\ \;\;\;\;1 - \frac{x}{t \cdot z}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-58}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{-x}{y - z}}{y - t}\\ \mathbf{elif}\;t \leq 215:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 4: 83.4% accurate, 0.8× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{-22}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-103}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-39}:\\ \;\;\;\;1 - \frac{x}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.5e-22)
   1.0
   (if (<= y -4e-103)
     (+ 1.0 (/ x (* y t)))
     (if (<= y 2e-39) (- 1.0 (/ x (* t z))) 1.0))))
assert(z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.5e-22) {
		tmp = 1.0;
	} else if (y <= -4e-103) {
		tmp = 1.0 + (x / (y * t));
	} else if (y <= 2e-39) {
		tmp = 1.0 - (x / (t * z));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.5d-22)) then
        tmp = 1.0d0
    else if (y <= (-4d-103)) then
        tmp = 1.0d0 + (x / (y * t))
    else if (y <= 2d-39) then
        tmp = 1.0d0 - (x / (t * z))
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.5e-22) {
		tmp = 1.0;
	} else if (y <= -4e-103) {
		tmp = 1.0 + (x / (y * t));
	} else if (y <= 2e-39) {
		tmp = 1.0 - (x / (t * z));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -2.5e-22:
		tmp = 1.0
	elif y <= -4e-103:
		tmp = 1.0 + (x / (y * t))
	elif y <= 2e-39:
		tmp = 1.0 - (x / (t * z))
	else:
		tmp = 1.0
	return tmp
z, t = sort([z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.5e-22)
		tmp = 1.0;
	elseif (y <= -4e-103)
		tmp = Float64(1.0 + Float64(x / Float64(y * t)));
	elseif (y <= 2e-39)
		tmp = Float64(1.0 - Float64(x / Float64(t * z)));
	else
		tmp = 1.0;
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2.5e-22)
		tmp = 1.0;
	elseif (y <= -4e-103)
		tmp = 1.0 + (x / (y * t));
	elseif (y <= 2e-39)
		tmp = 1.0 - (x / (t * z));
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e-22], 1.0, If[LessEqual[y, -4e-103], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-39], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-22}:\\
\;\;\;\;1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.49999999999999977e-22 or 1.99999999999999986e-39 < y

    1. Initial program 100.0%

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

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

    if -2.49999999999999977e-22 < y < -3.99999999999999983e-103

    1. Initial program 100.0%

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

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

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

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

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

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

    if -3.99999999999999983e-103 < y < 1.99999999999999986e-39

    1. Initial program 97.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{-22}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-103}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-39}:\\ \;\;\;\;1 - \frac{x}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 5: 82.6% accurate, 0.8× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1650:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-103}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-39}:\\ \;\;\;\;1 - \frac{x}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1650.0)
   (- 1.0 (/ x (* y y)))
   (if (<= y -2.1e-103)
     (+ 1.0 (/ x (* y t)))
     (if (<= y 1.95e-39) (- 1.0 (/ x (* t z))) 1.0))))
assert(z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1650.0) {
		tmp = 1.0 - (x / (y * y));
	} else if (y <= -2.1e-103) {
		tmp = 1.0 + (x / (y * t));
	} else if (y <= 1.95e-39) {
		tmp = 1.0 - (x / (t * z));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 <= (-1650.0d0)) then
        tmp = 1.0d0 - (x / (y * y))
    else if (y <= (-2.1d-103)) then
        tmp = 1.0d0 + (x / (y * t))
    else if (y <= 1.95d-39) then
        tmp = 1.0d0 - (x / (t * z))
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1650.0) {
		tmp = 1.0 - (x / (y * y));
	} else if (y <= -2.1e-103) {
		tmp = 1.0 + (x / (y * t));
	} else if (y <= 1.95e-39) {
		tmp = 1.0 - (x / (t * z));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -1650.0:
		tmp = 1.0 - (x / (y * y))
	elif y <= -2.1e-103:
		tmp = 1.0 + (x / (y * t))
	elif y <= 1.95e-39:
		tmp = 1.0 - (x / (t * z))
	else:
		tmp = 1.0
	return tmp
z, t = sort([z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1650.0)
		tmp = Float64(1.0 - Float64(x / Float64(y * y)));
	elseif (y <= -2.1e-103)
		tmp = Float64(1.0 + Float64(x / Float64(y * t)));
	elseif (y <= 1.95e-39)
		tmp = Float64(1.0 - Float64(x / Float64(t * z)));
	else
		tmp = 1.0;
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1650.0)
		tmp = 1.0 - (x / (y * y));
	elseif (y <= -2.1e-103)
		tmp = 1.0 + (x / (y * t));
	elseif (y <= 1.95e-39)
		tmp = 1.0 - (x / (t * z));
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -1650.0], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.1e-103], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e-39], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1650:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\

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

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

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


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

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{{y}^{2}}} \]
    3. Step-by-step derivation
      1. unpow293.8%

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

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

    if -1650 < y < -2.10000000000000005e-103

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.10000000000000005e-103 < y < 1.95000000000000015e-39

    1. Initial program 97.0%

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

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

    if 1.95000000000000015e-39 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1650:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-103}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-39}:\\ \;\;\;\;1 - \frac{x}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 6: 89.0% accurate, 0.8× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -36000000000 \lor \neg \left(y \leq 3.5 \cdot 10^{-37}\right):\\ \;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -36000000000.0) (not (<= y 3.5e-37)))
   (- 1.0 (/ x (* y (- y t))))
   (+ 1.0 (/ (/ x t) (- y z)))))
assert(z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -36000000000.0) || !(y <= 3.5e-37)) {
		tmp = 1.0 - (x / (y * (y - t)));
	} else {
		tmp = 1.0 + ((x / t) / (y - z));
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 <= (-36000000000.0d0)) .or. (.not. (y <= 3.5d-37))) then
        tmp = 1.0d0 - (x / (y * (y - t)))
    else
        tmp = 1.0d0 + ((x / t) / (y - z))
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -36000000000.0) || !(y <= 3.5e-37)) {
		tmp = 1.0 - (x / (y * (y - t)));
	} else {
		tmp = 1.0 + ((x / t) / (y - z));
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	tmp = 0
	if (y <= -36000000000.0) or not (y <= 3.5e-37):
		tmp = 1.0 - (x / (y * (y - t)))
	else:
		tmp = 1.0 + ((x / t) / (y - z))
	return tmp
z, t = sort([z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -36000000000.0) || !(y <= 3.5e-37))
		tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t))));
	else
		tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z)));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -36000000000.0) || ~((y <= 3.5e-37)))
		tmp = 1.0 - (x / (y * (y - t)));
	else
		tmp = 1.0 + ((x / t) / (y - z));
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -36000000000.0], N[Not[LessEqual[y, 3.5e-37]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -36000000000 \lor \neg \left(y \leq 3.5 \cdot 10^{-37}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.6e10 or 3.5000000000000001e-37 < y

    1. Initial program 100.0%

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

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

    if -3.6e10 < y < 3.5000000000000001e-37

    1. Initial program 97.5%

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

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

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

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

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

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

Alternative 7: 87.1% accurate, 0.8× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -49000000000000:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{-39}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -49000000000000.0)
   (- 1.0 (/ x (* y y)))
   (if (<= y 2.35e-39) (+ 1.0 (/ (/ x t) (- y z))) 1.0)))
assert(z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -49000000000000.0) {
		tmp = 1.0 - (x / (y * y));
	} else if (y <= 2.35e-39) {
		tmp = 1.0 + ((x / t) / (y - z));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 <= (-49000000000000.0d0)) then
        tmp = 1.0d0 - (x / (y * y))
    else if (y <= 2.35d-39) then
        tmp = 1.0d0 + ((x / t) / (y - z))
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -49000000000000.0) {
		tmp = 1.0 - (x / (y * y));
	} else if (y <= 2.35e-39) {
		tmp = 1.0 + ((x / t) / (y - z));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -49000000000000.0:
		tmp = 1.0 - (x / (y * y))
	elif y <= 2.35e-39:
		tmp = 1.0 + ((x / t) / (y - z))
	else:
		tmp = 1.0
	return tmp
z, t = sort([z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -49000000000000.0)
		tmp = Float64(1.0 - Float64(x / Float64(y * y)));
	elseif (y <= 2.35e-39)
		tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z)));
	else
		tmp = 1.0;
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -49000000000000.0)
		tmp = 1.0 - (x / (y * y));
	elseif (y <= 2.35e-39)
		tmp = 1.0 + ((x / t) / (y - z));
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -49000000000000.0], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.35e-39], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -49000000000000:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\

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

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


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

    1. Initial program 100.0%

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

      \[\leadsto 1 - \color{blue}{\frac{x}{{y}^{2}}} \]
    3. Step-by-step derivation
      1. unpow293.7%

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

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

    if -4.9e13 < y < 2.3500000000000001e-39

    1. Initial program 97.5%

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

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

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

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

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

    if 2.3500000000000001e-39 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.9%

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

Alternative 8: 90.3% accurate, 0.8× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -1.1 \cdot 10^{-84}:\\ \;\;\;\;1 - \frac{x}{t \cdot z}\\ \mathbf{elif}\;t \leq 820:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t -1.1e-84)
   (- 1.0 (/ x (* t z)))
   (if (<= t 820.0) (- 1.0 (/ (/ x y) (- y z))) (+ 1.0 (/ (/ x t) (- y z))))))
assert(z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.1e-84) {
		tmp = 1.0 - (x / (t * z));
	} else if (t <= 820.0) {
		tmp = 1.0 - ((x / y) / (y - z));
	} else {
		tmp = 1.0 + ((x / t) / (y - z));
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.1d-84)) then
        tmp = 1.0d0 - (x / (t * z))
    else if (t <= 820.0d0) then
        tmp = 1.0d0 - ((x / y) / (y - z))
    else
        tmp = 1.0d0 + ((x / t) / (y - z))
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.1e-84) {
		tmp = 1.0 - (x / (t * z));
	} else if (t <= 820.0) {
		tmp = 1.0 - ((x / y) / (y - z));
	} else {
		tmp = 1.0 + ((x / t) / (y - z));
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= -1.1e-84:
		tmp = 1.0 - (x / (t * z))
	elif t <= 820.0:
		tmp = 1.0 - ((x / y) / (y - z))
	else:
		tmp = 1.0 + ((x / t) / (y - z))
	return tmp
z, t = sort([z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -1.1e-84)
		tmp = Float64(1.0 - Float64(x / Float64(t * z)));
	elseif (t <= 820.0)
		tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - z)));
	else
		tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z)));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -1.1e-84)
		tmp = 1.0 - (x / (t * z));
	elseif (t <= 820.0)
		tmp = 1.0 - ((x / y) / (y - z));
	else
		tmp = 1.0 + ((x / t) / (y - z));
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, -1.1e-84], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 820.0], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-84}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\

\mathbf{elif}\;t \leq 820:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\

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


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

    1. Initial program 99.9%

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

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

    if -1.0999999999999999e-84 < t < 820

    1. Initial program 97.3%

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

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

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

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

    if 820 < 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 98.4%

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

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

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

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

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

Alternative 9: 77.1% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -3.1 \cdot 10^{-87}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{-197}:\\ \;\;\;\;1 + \frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t -3.1e-87) 1.0 (if (<= t 9.6e-197) (+ 1.0 (/ x (* y z))) 1.0)))
assert(z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -3.1e-87) {
		tmp = 1.0;
	} else if (t <= 9.6e-197) {
		tmp = 1.0 + (x / (y * z));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.1d-87)) then
        tmp = 1.0d0
    else if (t <= 9.6d-197) then
        tmp = 1.0d0 + (x / (y * z))
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -3.1e-87) {
		tmp = 1.0;
	} else if (t <= 9.6e-197) {
		tmp = 1.0 + (x / (y * z));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= -3.1e-87:
		tmp = 1.0
	elif t <= 9.6e-197:
		tmp = 1.0 + (x / (y * z))
	else:
		tmp = 1.0
	return tmp
z, t = sort([z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -3.1e-87)
		tmp = 1.0;
	elseif (t <= 9.6e-197)
		tmp = Float64(1.0 + Float64(x / Float64(y * z)));
	else
		tmp = 1.0;
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -3.1e-87)
		tmp = 1.0;
	elseif (t <= 9.6e-197)
		tmp = 1.0 + (x / (y * z));
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, -3.1e-87], 1.0, If[LessEqual[t, 9.6e-197], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-87}:\\
\;\;\;\;1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.09999999999999998e-87 or 9.6000000000000003e-197 < t

    1. Initial program 99.9%

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

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

    if -3.09999999999999998e-87 < t < 9.6000000000000003e-197

    1. Initial program 95.8%

      \[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. associate-/r*88.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.1 \cdot 10^{-87}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{-197}:\\ \;\;\;\;1 + \frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 10: 99.2% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ 1 - \frac{x}{\left(y - t\right) \cdot \left(y - z\right)} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y t) (- y z)))))
assert(z < t);
double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - t) * (y - z)));
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 - t) * (y - z)))
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - t) * (y - z)));
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	return 1.0 - (x / ((y - t) * (y - z)))
z, t = sort([z, t])
function code(x, y, z, t)
	return Float64(1.0 - Float64(x / Float64(Float64(y - t) * Float64(y - z))))
end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
	tmp = 1.0 - (x / ((y - t) * (y - z)));
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1 - \frac{x}{\left(y - t\right) \cdot \left(y - z\right)}
\end{array}
Derivation
  1. Initial program 98.8%

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

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

Alternative 11: 98.4% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ 1 - \frac{\frac{x}{y - t}}{y - z} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (- 1.0 (/ (/ x (- y t)) (- y z))))
assert(z < t);
double code(double x, double y, double z, double t) {
	return 1.0 - ((x / (y - t)) / (y - z));
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 - t)) / (y - z))
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
	return 1.0 - ((x / (y - t)) / (y - z));
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	return 1.0 - ((x / (y - t)) / (y - z))
z, t = sort([z, t])
function code(x, y, z, t)
	return Float64(1.0 - Float64(Float64(x / Float64(y - t)) / Float64(y - z)))
end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
	tmp = 1.0 - ((x / (y - t)) / (y - z));
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := N[(1.0 - N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1 - \frac{\frac{x}{y - t}}{y - z}
\end{array}
Derivation
  1. Initial program 98.8%

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

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

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

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

Alternative 12: 75.4% accurate, 11.0× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ 1 \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 1.0)
assert(z < t);
double code(double x, double y, double z, double t) {
	return 1.0;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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
assert z < t;
public static double code(double x, double y, double z, double t) {
	return 1.0;
}
[z, t] = sort([z, t])
def code(x, y, z, t):
	return 1.0
z, t = sort([z, t])
function code(x, y, z, t)
	return 1.0
end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
	tmp = 1.0;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
1
\end{array}
Derivation
  1. Initial program 98.8%

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

    \[\leadsto \color{blue}{1} \]
  3. Final simplification75.8%

    \[\leadsto 1 \]

Reproduce

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