Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3

Percentage Accurate: 84.8% → 96.5%
Time: 6.2s
Alternatives: 7
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 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: 84.8% accurate, 1.0× speedup?

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

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

Alternative 1: 96.5% accurate, 1.0× speedup?

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

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

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

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
    2. distribute-rgt-out--77.2%

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

      \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
    4. associate-*l/93.3%

      \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
    5. *-inverses93.3%

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

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

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

    \[\leadsto x - \color{blue}{\frac{z \cdot x}{y}} \]
  5. Step-by-step derivation
    1. *-commutative96.2%

      \[\leadsto x - \frac{\color{blue}{x \cdot z}}{y} \]
    2. associate-/l*96.6%

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

    \[\leadsto x - \color{blue}{\frac{x}{\frac{y}{z}}} \]
  7. Final simplification96.6%

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

Alternative 2: 70.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -58000 \lor \neg \left(z \leq 4 \cdot 10^{-98} \lor \neg \left(z \leq 6 \cdot 10^{-80}\right) \land z \leq 1.4 \cdot 10^{+67}\right):\\ \;\;\;\;\left(-x\right) \cdot \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -58000.0)
         (not (or (<= z 4e-98) (and (not (<= z 6e-80)) (<= z 1.4e+67)))))
   (* (- x) (/ z y))
   x))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -58000.0) || !((z <= 4e-98) || (!(z <= 6e-80) && (z <= 1.4e+67)))) {
		tmp = -x * (z / y);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-58000.0d0)) .or. (.not. (z <= 4d-98) .or. (.not. (z <= 6d-80)) .and. (z <= 1.4d+67))) then
        tmp = -x * (z / y)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -58000.0) || !((z <= 4e-98) || (!(z <= 6e-80) && (z <= 1.4e+67)))) {
		tmp = -x * (z / y);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -58000.0) or not ((z <= 4e-98) or (not (z <= 6e-80) and (z <= 1.4e+67))):
		tmp = -x * (z / y)
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -58000.0) || !((z <= 4e-98) || (!(z <= 6e-80) && (z <= 1.4e+67))))
		tmp = Float64(Float64(-x) * Float64(z / y));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -58000.0) || ~(((z <= 4e-98) || (~((z <= 6e-80)) && (z <= 1.4e+67)))))
		tmp = -x * (z / y);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -58000.0], N[Not[Or[LessEqual[z, 4e-98], And[N[Not[LessEqual[z, 6e-80]], $MachinePrecision], LessEqual[z, 1.4e+67]]]], $MachinePrecision]], N[((-x) * N[(z / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -58000 \lor \neg \left(z \leq 4 \cdot 10^{-98} \lor \neg \left(z \leq 6 \cdot 10^{-80}\right) \land z \leq 1.4 \cdot 10^{+67}\right):\\
\;\;\;\;\left(-x\right) \cdot \frac{z}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -58000 or 3.99999999999999976e-98 < z < 6.00000000000000014e-80 or 1.3999999999999999e67 < z

    1. Initial program 91.8%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--77.5%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/91.9%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses91.9%

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

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

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 80.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg80.0%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/76.8%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in76.8%

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

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

    if -58000 < z < 3.99999999999999976e-98 or 6.00000000000000014e-80 < z < 1.3999999999999999e67

    1. Initial program 81.5%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--76.9%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/94.4%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses94.4%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity94.4%

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -58000 \lor \neg \left(z \leq 4 \cdot 10^{-98} \lor \neg \left(z \leq 6 \cdot 10^{-80}\right) \land z \leq 1.4 \cdot 10^{+67}\right):\\ \;\;\;\;\left(-x\right) \cdot \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 70.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -78000 \lor \neg \left(z \leq 3.4 \cdot 10^{-98}\right) \land \left(z \leq 3.6 \cdot 10^{-80} \lor \neg \left(z \leq 1.02 \cdot 10^{+68}\right)\right):\\ \;\;\;\;\frac{x}{\frac{-y}{z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -78000.0)
         (and (not (<= z 3.4e-98)) (or (<= z 3.6e-80) (not (<= z 1.02e+68)))))
   (/ x (/ (- y) z))
   x))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -78000.0) || (!(z <= 3.4e-98) && ((z <= 3.6e-80) || !(z <= 1.02e+68)))) {
		tmp = x / (-y / z);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-78000.0d0)) .or. (.not. (z <= 3.4d-98)) .and. (z <= 3.6d-80) .or. (.not. (z <= 1.02d+68))) then
        tmp = x / (-y / z)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -78000.0) || (!(z <= 3.4e-98) && ((z <= 3.6e-80) || !(z <= 1.02e+68)))) {
		tmp = x / (-y / z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -78000.0) or (not (z <= 3.4e-98) and ((z <= 3.6e-80) or not (z <= 1.02e+68))):
		tmp = x / (-y / z)
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -78000.0) || (!(z <= 3.4e-98) && ((z <= 3.6e-80) || !(z <= 1.02e+68))))
		tmp = Float64(x / Float64(Float64(-y) / z));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -78000.0) || (~((z <= 3.4e-98)) && ((z <= 3.6e-80) || ~((z <= 1.02e+68)))))
		tmp = x / (-y / z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -78000.0], And[N[Not[LessEqual[z, 3.4e-98]], $MachinePrecision], Or[LessEqual[z, 3.6e-80], N[Not[LessEqual[z, 1.02e+68]], $MachinePrecision]]]], N[(x / N[((-y) / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -78000 \lor \neg \left(z \leq 3.4 \cdot 10^{-98}\right) \land \left(z \leq 3.6 \cdot 10^{-80} \lor \neg \left(z \leq 1.02 \cdot 10^{+68}\right)\right):\\
\;\;\;\;\frac{x}{\frac{-y}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -78000 or 3.4000000000000001e-98 < z < 3.6e-80 or 1.02e68 < z

    1. Initial program 91.8%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--77.5%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/91.9%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses91.9%

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

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

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 80.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg80.0%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/76.8%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in76.8%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{z}}} \cdot \left(-x\right) \]
      2. add-sqr-sqrt44.0%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \]
      3. sqrt-unprod35.9%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \]
      4. sqr-neg35.9%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \sqrt{\color{blue}{x \cdot x}} \]
      5. sqrt-unprod0.8%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \]
      6. add-sqr-sqrt1.3%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{x} \]
      7. associate-/r/1.3%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-\frac{y}{z}}{-x}}} \]
      9. clear-num1.3%

        \[\leadsto \color{blue}{\frac{-x}{-\frac{y}{z}}} \]
      10. add-sqr-sqrt0.6%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\frac{y}{z}} \]
      11. sqrt-unprod28.7%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\frac{y}{z}} \]
      12. sqr-neg28.7%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot x}}}{-\frac{y}{z}} \]
      13. sqrt-unprod33.3%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\frac{y}{z}} \]
      14. add-sqr-sqrt77.7%

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

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

    if -78000 < z < 3.4000000000000001e-98 or 3.6e-80 < z < 1.02e68

    1. Initial program 81.5%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--76.9%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/94.4%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses94.4%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity94.4%

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -78000 \lor \neg \left(z \leq 3.4 \cdot 10^{-98}\right) \land \left(z \leq 3.6 \cdot 10^{-80} \lor \neg \left(z \leq 1.02 \cdot 10^{+68}\right)\right):\\ \;\;\;\;\frac{x}{\frac{-y}{z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 71.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\frac{-y}{z}}\\ \mathbf{if}\;z \leq -112000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-98}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-79}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+65}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot \left(-x\right)}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ x (/ (- y) z))))
   (if (<= z -112000.0)
     t_0
     (if (<= z 5.6e-98)
       x
       (if (<= z 2.1e-79) t_0 (if (<= z 1.55e+65) x (/ (* z (- x)) y)))))))
double code(double x, double y, double z) {
	double t_0 = x / (-y / z);
	double tmp;
	if (z <= -112000.0) {
		tmp = t_0;
	} else if (z <= 5.6e-98) {
		tmp = x;
	} else if (z <= 2.1e-79) {
		tmp = t_0;
	} else if (z <= 1.55e+65) {
		tmp = x;
	} else {
		tmp = (z * -x) / y;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / (-y / z)
    if (z <= (-112000.0d0)) then
        tmp = t_0
    else if (z <= 5.6d-98) then
        tmp = x
    else if (z <= 2.1d-79) then
        tmp = t_0
    else if (z <= 1.55d+65) then
        tmp = x
    else
        tmp = (z * -x) / y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x / (-y / z);
	double tmp;
	if (z <= -112000.0) {
		tmp = t_0;
	} else if (z <= 5.6e-98) {
		tmp = x;
	} else if (z <= 2.1e-79) {
		tmp = t_0;
	} else if (z <= 1.55e+65) {
		tmp = x;
	} else {
		tmp = (z * -x) / y;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x / (-y / z)
	tmp = 0
	if z <= -112000.0:
		tmp = t_0
	elif z <= 5.6e-98:
		tmp = x
	elif z <= 2.1e-79:
		tmp = t_0
	elif z <= 1.55e+65:
		tmp = x
	else:
		tmp = (z * -x) / y
	return tmp
function code(x, y, z)
	t_0 = Float64(x / Float64(Float64(-y) / z))
	tmp = 0.0
	if (z <= -112000.0)
		tmp = t_0;
	elseif (z <= 5.6e-98)
		tmp = x;
	elseif (z <= 2.1e-79)
		tmp = t_0;
	elseif (z <= 1.55e+65)
		tmp = x;
	else
		tmp = Float64(Float64(z * Float64(-x)) / y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x / (-y / z);
	tmp = 0.0;
	if (z <= -112000.0)
		tmp = t_0;
	elseif (z <= 5.6e-98)
		tmp = x;
	elseif (z <= 2.1e-79)
		tmp = t_0;
	elseif (z <= 1.55e+65)
		tmp = x;
	else
		tmp = (z * -x) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x / N[((-y) / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -112000.0], t$95$0, If[LessEqual[z, 5.6e-98], x, If[LessEqual[z, 2.1e-79], t$95$0, If[LessEqual[z, 1.55e+65], x, N[(N[(z * (-x)), $MachinePrecision] / y), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\frac{-y}{z}}\\
\mathbf{if}\;z \leq -112000:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 5.6 \cdot 10^{-98}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-79}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+65}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -112000 or 5.5999999999999998e-98 < z < 2.0999999999999999e-79

    1. Initial program 94.3%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--80.6%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/94.3%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses94.3%

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

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

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 76.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg76.3%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/77.6%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in77.6%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{z}}} \cdot \left(-x\right) \]
      2. add-sqr-sqrt43.1%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \]
      3. sqrt-unprod38.2%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \]
      4. sqr-neg38.2%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \sqrt{\color{blue}{x \cdot x}} \]
      5. sqrt-unprod0.8%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \]
      6. add-sqr-sqrt1.3%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{x} \]
      7. associate-/r/1.3%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-\frac{y}{z}}{-x}}} \]
      9. clear-num1.3%

        \[\leadsto \color{blue}{\frac{-x}{-\frac{y}{z}}} \]
      10. add-sqr-sqrt0.6%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\frac{y}{z}} \]
      11. sqrt-unprod29.9%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\frac{y}{z}} \]
      12. sqr-neg29.9%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot x}}}{-\frac{y}{z}} \]
      13. sqrt-unprod34.2%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\frac{y}{z}} \]
      14. add-sqr-sqrt77.9%

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

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

    if -112000 < z < 5.5999999999999998e-98 or 2.0999999999999999e-79 < z < 1.54999999999999995e65

    1. Initial program 81.5%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--76.9%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/94.4%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses94.4%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity94.4%

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

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

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

    if 1.54999999999999995e65 < z

    1. Initial program 88.6%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--73.3%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/88.7%

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

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity88.7%

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

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 85.0%

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

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

        \[\leadsto \frac{\color{blue}{-z \cdot x}}{y} \]
      3. distribute-rgt-neg-in85.0%

        \[\leadsto \frac{\color{blue}{z \cdot \left(-x\right)}}{y} \]
    6. Simplified85.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -112000:\\ \;\;\;\;\frac{x}{\frac{-y}{z}}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-98}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-79}:\\ \;\;\;\;\frac{x}{\frac{-y}{z}}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+65}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot \left(-x\right)}{y}\\ \end{array} \]

Alternative 5: 92.9% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.90000000000000003e166

    1. Initial program 84.9%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--77.5%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/94.9%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses94.9%

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

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

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

    if 1.90000000000000003e166 < z

    1. Initial program 96.6%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--74.9%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/81.4%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses81.4%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity81.4%

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

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 96.6%

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

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

        \[\leadsto \frac{\color{blue}{-z \cdot x}}{y} \]
      3. distribute-rgt-neg-in96.6%

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

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

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

Alternative 6: 51.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+93}:\\
\;\;\;\;y \cdot \frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.2000000000000006e93

    1. Initial program 70.6%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{y}{x}}} \]
      2. div-inv59.8%

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{y}{x}}} \]
      3. clear-num59.9%

        \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
    4. Applied egg-rr59.9%

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

    if -9.2000000000000006e93 < x

    1. Initial program 89.5%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--76.7%

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/93.2%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses93.2%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity93.2%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified93.2%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.2 \cdot 10^{+93}:\\ \;\;\;\;y \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 50.7% accurate, 7.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
	return x;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x
end function
public static double code(double x, double y, double z) {
	return x;
}
def code(x, y, z):
	return x
function code(x, y, z)
	return x
end
function tmp = code(x, y, z)
	tmp = x;
end
code[x_, y_, z_] := x
\begin{array}{l}

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

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

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
    2. distribute-rgt-out--77.2%

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

      \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
    4. associate-*l/93.3%

      \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
    5. *-inverses93.3%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification50.4%

    \[\leadsto x \]

Developer target: 96.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z < -2.060202331921739 \cdot 10^{+104}:\\ \;\;\;\;x - \frac{z \cdot x}{y}\\ \mathbf{elif}\;z < 1.6939766013828526 \cdot 10^{+213}:\\ \;\;\;\;\frac{x}{\frac{y}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (< z -2.060202331921739e+104)
   (- x (/ (* z x) y))
   (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y)))))
double code(double x, double y, double z) {
	double tmp;
	if (z < -2.060202331921739e+104) {
		tmp = x - ((z * x) / y);
	} else if (z < 1.6939766013828526e+213) {
		tmp = x / (y / (y - z));
	} else {
		tmp = (y - z) * (x / y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z < (-2.060202331921739d+104)) then
        tmp = x - ((z * x) / y)
    else if (z < 1.6939766013828526d+213) then
        tmp = x / (y / (y - z))
    else
        tmp = (y - z) * (x / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z < -2.060202331921739e+104) {
		tmp = x - ((z * x) / y);
	} else if (z < 1.6939766013828526e+213) {
		tmp = x / (y / (y - z));
	} else {
		tmp = (y - z) * (x / y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z < -2.060202331921739e+104:
		tmp = x - ((z * x) / y)
	elif z < 1.6939766013828526e+213:
		tmp = x / (y / (y - z))
	else:
		tmp = (y - z) * (x / y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z < -2.060202331921739e+104)
		tmp = Float64(x - Float64(Float64(z * x) / y));
	elseif (z < 1.6939766013828526e+213)
		tmp = Float64(x / Float64(y / Float64(y - z)));
	else
		tmp = Float64(Float64(y - z) * Float64(x / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z < -2.060202331921739e+104)
		tmp = x - ((z * x) / y);
	elseif (z < 1.6939766013828526e+213)
		tmp = x / (y / (y - z));
	else
		tmp = (y - z) * (x / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Less[z, -2.060202331921739e+104], N[(x - N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[Less[z, 1.6939766013828526e+213], N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z < -2.060202331921739 \cdot 10^{+104}:\\
\;\;\;\;x - \frac{z \cdot x}{y}\\

\mathbf{elif}\;z < 1.6939766013828526 \cdot 10^{+213}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023181 
(FPCore (x y z)
  :name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
  :precision binary64

  :herbie-target
  (if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))

  (/ (* x (- y z)) y))