
(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:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (x y z) :precision binary64 (if (<= z 1.52e+88) (- x (* x (/ z y))) (/ (* x (- y z)) y)))
double code(double x, double y, double z) {
double tmp;
if (z <= 1.52e+88) {
tmp = x - (x * (z / y));
} else {
tmp = (x * (y - z)) / 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.52d+88) then
tmp = x - (x * (z / y))
else
tmp = (x * (y - z)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 1.52e+88) {
tmp = x - (x * (z / y));
} else {
tmp = (x * (y - z)) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 1.52e+88: tmp = x - (x * (z / y)) else: tmp = (x * (y - z)) / y return tmp
function code(x, y, z) tmp = 0.0 if (z <= 1.52e+88) tmp = Float64(x - Float64(x * Float64(z / y))); else tmp = Float64(Float64(x * Float64(y - z)) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 1.52e+88) tmp = x - (x * (z / y)); else tmp = (x * (y - z)) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 1.52e+88], N[(x - N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.52 \cdot 10^{+88}:\\
\;\;\;\;x - x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (or (<= z -3e+105)
(and (not (<= z -1150000000000.0))
(or (<= z -3.7e-68) (not (<= z 5.2e-27)))))
(* x (/ (- z) y))
x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3e+105) || (!(z <= -1150000000000.0) && ((z <= -3.7e-68) || !(z <= 5.2e-27)))) {
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 <= (-3d+105)) .or. (.not. (z <= (-1150000000000.0d0))) .and. (z <= (-3.7d-68)) .or. (.not. (z <= 5.2d-27))) 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 <= -3e+105) || (!(z <= -1150000000000.0) && ((z <= -3.7e-68) || !(z <= 5.2e-27)))) {
tmp = x * (-z / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3e+105) or (not (z <= -1150000000000.0) and ((z <= -3.7e-68) or not (z <= 5.2e-27))): tmp = x * (-z / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3e+105) || (!(z <= -1150000000000.0) && ((z <= -3.7e-68) || !(z <= 5.2e-27)))) tmp = Float64(x * Float64(Float64(-z) / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3e+105) || (~((z <= -1150000000000.0)) && ((z <= -3.7e-68) || ~((z <= 5.2e-27))))) tmp = x * (-z / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3e+105], And[N[Not[LessEqual[z, -1150000000000.0]], $MachinePrecision], Or[LessEqual[z, -3.7e-68], N[Not[LessEqual[z, 5.2e-27]], $MachinePrecision]]]], N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+105} \lor \neg \left(z \leq -1150000000000\right) \land \left(z \leq -3.7 \cdot 10^{-68} \lor \neg \left(z \leq 5.2 \cdot 10^{-27}\right)\right):\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= z -2.6e+105)
(/ (- x) (/ y z))
(if (or (<= z -800000000000.0) (and (not (<= z -2.1e-68)) (<= z 2.6e-26)))
x
(* x (/ (- z) y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e+105) {
tmp = -x / (y / z);
} else if ((z <= -800000000000.0) || (!(z <= -2.1e-68) && (z <= 2.6e-26))) {
tmp = x;
} else {
tmp = x * (-z / 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.6d+105)) then
tmp = -x / (y / z)
else if ((z <= (-800000000000.0d0)) .or. (.not. (z <= (-2.1d-68))) .and. (z <= 2.6d-26)) then
tmp = x
else
tmp = x * (-z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e+105) {
tmp = -x / (y / z);
} else if ((z <= -800000000000.0) || (!(z <= -2.1e-68) && (z <= 2.6e-26))) {
tmp = x;
} else {
tmp = x * (-z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.6e+105: tmp = -x / (y / z) elif (z <= -800000000000.0) or (not (z <= -2.1e-68) and (z <= 2.6e-26)): tmp = x else: tmp = x * (-z / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.6e+105) tmp = Float64(Float64(-x) / Float64(y / z)); elseif ((z <= -800000000000.0) || (!(z <= -2.1e-68) && (z <= 2.6e-26))) tmp = x; else tmp = Float64(x * Float64(Float64(-z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.6e+105) tmp = -x / (y / z); elseif ((z <= -800000000000.0) || (~((z <= -2.1e-68)) && (z <= 2.6e-26))) tmp = x; else tmp = x * (-z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.6e+105], N[((-x) / N[(y / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -800000000000.0], And[N[Not[LessEqual[z, -2.1e-68]], $MachinePrecision], LessEqual[z, 2.6e-26]]], x, N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+105}:\\
\;\;\;\;\frac{-x}{\frac{y}{z}}\\
\mathbf{elif}\;z \leq -800000000000 \lor \neg \left(z \leq -2.1 \cdot 10^{-68}\right) \land z \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (- z) (/ y x))))
(if (<= z -2.35e+105)
t_0
(if (<= z -55000000000.0)
x
(if (<= z -3.8e-68) (* x (/ (- z) y)) (if (<= z 1.45e-27) x t_0))))))
double code(double x, double y, double z) {
double t_0 = -z / (y / x);
double tmp;
if (z <= -2.35e+105) {
tmp = t_0;
} else if (z <= -55000000000.0) {
tmp = x;
} else if (z <= -3.8e-68) {
tmp = x * (-z / y);
} else if (z <= 1.45e-27) {
tmp = x;
} else {
tmp = t_0;
}
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 = -z / (y / x)
if (z <= (-2.35d+105)) then
tmp = t_0
else if (z <= (-55000000000.0d0)) then
tmp = x
else if (z <= (-3.8d-68)) then
tmp = x * (-z / y)
else if (z <= 1.45d-27) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -z / (y / x);
double tmp;
if (z <= -2.35e+105) {
tmp = t_0;
} else if (z <= -55000000000.0) {
tmp = x;
} else if (z <= -3.8e-68) {
tmp = x * (-z / y);
} else if (z <= 1.45e-27) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -z / (y / x) tmp = 0 if z <= -2.35e+105: tmp = t_0 elif z <= -55000000000.0: tmp = x elif z <= -3.8e-68: tmp = x * (-z / y) elif z <= 1.45e-27: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(-z) / Float64(y / x)) tmp = 0.0 if (z <= -2.35e+105) tmp = t_0; elseif (z <= -55000000000.0) tmp = x; elseif (z <= -3.8e-68) tmp = Float64(x * Float64(Float64(-z) / y)); elseif (z <= 1.45e-27) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -z / (y / x); tmp = 0.0; if (z <= -2.35e+105) tmp = t_0; elseif (z <= -55000000000.0) tmp = x; elseif (z <= -3.8e-68) tmp = x * (-z / y); elseif (z <= 1.45e-27) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[((-z) / N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e+105], t$95$0, If[LessEqual[z, -55000000000.0], x, If[LessEqual[z, -3.8e-68], N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-27], x, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-z}{\frac{y}{x}}\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{+105}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -55000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-68}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= z -2.35e+105)
(/ (- z) (/ y x))
(if (<= z -240000000000.0)
x
(if (<= z -3.8e-68)
(* x (/ (- z) y))
(if (<= z 2.7e-27) x (* z (/ (- x) y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.35e+105) {
tmp = -z / (y / x);
} else if (z <= -240000000000.0) {
tmp = x;
} else if (z <= -3.8e-68) {
tmp = x * (-z / y);
} else if (z <= 2.7e-27) {
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) :: tmp
if (z <= (-2.35d+105)) then
tmp = -z / (y / x)
else if (z <= (-240000000000.0d0)) then
tmp = x
else if (z <= (-3.8d-68)) then
tmp = x * (-z / y)
else if (z <= 2.7d-27) 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 tmp;
if (z <= -2.35e+105) {
tmp = -z / (y / x);
} else if (z <= -240000000000.0) {
tmp = x;
} else if (z <= -3.8e-68) {
tmp = x * (-z / y);
} else if (z <= 2.7e-27) {
tmp = x;
} else {
tmp = z * (-x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.35e+105: tmp = -z / (y / x) elif z <= -240000000000.0: tmp = x elif z <= -3.8e-68: tmp = x * (-z / y) elif z <= 2.7e-27: tmp = x else: tmp = z * (-x / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.35e+105) tmp = Float64(Float64(-z) / Float64(y / x)); elseif (z <= -240000000000.0) tmp = x; elseif (z <= -3.8e-68) tmp = Float64(x * Float64(Float64(-z) / y)); elseif (z <= 2.7e-27) tmp = x; else tmp = Float64(z * Float64(Float64(-x) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.35e+105) tmp = -z / (y / x); elseif (z <= -240000000000.0) tmp = x; elseif (z <= -3.8e-68) tmp = x * (-z / y); elseif (z <= 2.7e-27) tmp = x; else tmp = z * (-x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.35e+105], N[((-z) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -240000000000.0], x, If[LessEqual[z, -3.8e-68], N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-27], x, N[(z * N[((-x) / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{+105}:\\
\;\;\;\;\frac{-z}{\frac{y}{x}}\\
\mathbf{elif}\;z \leq -240000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-68}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-x}{y}\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* z (- x)) y)))
(if (<= z -2.35e+105)
t_0
(if (<= z -9000000000.0)
x
(if (<= z -1.65e-68) (* x (/ (- z) y)) (if (<= z 2.25e-26) x t_0))))))
double code(double x, double y, double z) {
double t_0 = (z * -x) / y;
double tmp;
if (z <= -2.35e+105) {
tmp = t_0;
} else if (z <= -9000000000.0) {
tmp = x;
} else if (z <= -1.65e-68) {
tmp = x * (-z / y);
} else if (z <= 2.25e-26) {
tmp = x;
} else {
tmp = t_0;
}
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 = (z * -x) / y
if (z <= (-2.35d+105)) then
tmp = t_0
else if (z <= (-9000000000.0d0)) then
tmp = x
else if (z <= (-1.65d-68)) then
tmp = x * (-z / y)
else if (z <= 2.25d-26) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * -x) / y;
double tmp;
if (z <= -2.35e+105) {
tmp = t_0;
} else if (z <= -9000000000.0) {
tmp = x;
} else if (z <= -1.65e-68) {
tmp = x * (-z / y);
} else if (z <= 2.25e-26) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (z * -x) / y tmp = 0 if z <= -2.35e+105: tmp = t_0 elif z <= -9000000000.0: tmp = x elif z <= -1.65e-68: tmp = x * (-z / y) elif z <= 2.25e-26: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(-x)) / y) tmp = 0.0 if (z <= -2.35e+105) tmp = t_0; elseif (z <= -9000000000.0) tmp = x; elseif (z <= -1.65e-68) tmp = Float64(x * Float64(Float64(-z) / y)); elseif (z <= 2.25e-26) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * -x) / y; tmp = 0.0; if (z <= -2.35e+105) tmp = t_0; elseif (z <= -9000000000.0) tmp = x; elseif (z <= -1.65e-68) tmp = x * (-z / y); elseif (z <= 2.25e-26) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * (-x)), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[z, -2.35e+105], t$95$0, If[LessEqual[z, -9000000000.0], x, If[LessEqual[z, -1.65e-68], N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e-26], x, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z \cdot \left(-x\right)}{y}\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{+105}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -9000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-68}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (* x (- 1.0 (/ z y))))
double code(double x, double y, double z) {
return x * (1.0 - (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 * (1.0d0 - (z / y))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - (z / y));
}
def code(x, y, z): return x * (1.0 - (z / y))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(z / y))) end
function tmp = code(x, y, z) tmp = x * (1.0 - (z / y)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \frac{z}{y}\right)
\end{array}
(FPCore (x y z) :precision binary64 (- x (* x (/ z y))))
double code(double x, double y, double z) {
return x - (x * (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 - (x * (z / y))
end function
public static double code(double x, double y, double z) {
return x - (x * (z / y));
}
def code(x, y, z): return x - (x * (z / y))
function code(x, y, z) return Float64(x - Float64(x * Float64(z / y))) end
function tmp = code(x, y, z) tmp = x - (x * (z / y)); end
code[x_, y_, z_] := N[(x - N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - x \cdot \frac{z}{y}
\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}
(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}
herbie shell --seed 2023343
(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))