
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (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 + y) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (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 + y) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z))))) (if (or (<= t_0 -1e-290) (not (<= t_0 0.0))) t_0 (* z (/ (- (- x) y) y)))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-290) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * ((-x - y) / 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) / (1.0d0 - (y / z))
if ((t_0 <= (-1d-290)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = z * ((-x - y) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-290) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * ((-x - y) / y);
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -1e-290) or not (t_0 <= 0.0): tmp = t_0 else: tmp = z * ((-x - y) / y) return tmp
function code(x, y, z) t_0 = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) tmp = 0.0 if ((t_0 <= -1e-290) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(z * Float64(Float64(Float64(-x) - y) / y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + y) / (1.0 - (y / z)); tmp = 0.0; if ((t_0 <= -1e-290) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = z * ((-x - y) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -1e-290], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(z * N[(N[((-x) - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-290} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{\left(-x\right) - y}{y}\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ x t_0)))
(if (<= x -2.6e-111)
t_1
(if (<= x 5.5e-67)
(/ y t_0)
(if (<= x 5.4e+54) (* z (/ (- (- x) y) y)) t_1)))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = x / t_0;
double tmp;
if (x <= -2.6e-111) {
tmp = t_1;
} else if (x <= 5.5e-67) {
tmp = y / t_0;
} else if (x <= 5.4e+54) {
tmp = z * ((-x - y) / y);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = x / t_0
if (x <= (-2.6d-111)) then
tmp = t_1
else if (x <= 5.5d-67) then
tmp = y / t_0
else if (x <= 5.4d+54) then
tmp = z * ((-x - y) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = x / t_0;
double tmp;
if (x <= -2.6e-111) {
tmp = t_1;
} else if (x <= 5.5e-67) {
tmp = y / t_0;
} else if (x <= 5.4e+54) {
tmp = z * ((-x - y) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = x / t_0 tmp = 0 if x <= -2.6e-111: tmp = t_1 elif x <= 5.5e-67: tmp = y / t_0 elif x <= 5.4e+54: tmp = z * ((-x - y) / y) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(x / t_0) tmp = 0.0 if (x <= -2.6e-111) tmp = t_1; elseif (x <= 5.5e-67) tmp = Float64(y / t_0); elseif (x <= 5.4e+54) tmp = Float64(z * Float64(Float64(Float64(-x) - y) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = x / t_0; tmp = 0.0; if (x <= -2.6e-111) tmp = t_1; elseif (x <= 5.5e-67) tmp = y / t_0; elseif (x <= 5.4e+54) tmp = z * ((-x - y) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / t$95$0), $MachinePrecision]}, If[LessEqual[x, -2.6e-111], t$95$1, If[LessEqual[x, 5.5e-67], N[(y / t$95$0), $MachinePrecision], If[LessEqual[x, 5.4e+54], N[(z * N[(N[((-x) - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{x}{t_0}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{y}{t_0}\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+54}:\\
\;\;\;\;z \cdot \frac{\left(-x\right) - y}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ x t_0)))
(if (<= x -7.6e-112)
t_1
(if (<= x 2.4e-62)
(/ y t_0)
(if (<= x 5.2e+54) (/ (- z) (/ y (+ x y))) t_1)))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = x / t_0;
double tmp;
if (x <= -7.6e-112) {
tmp = t_1;
} else if (x <= 2.4e-62) {
tmp = y / t_0;
} else if (x <= 5.2e+54) {
tmp = -z / (y / (x + y));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = x / t_0
if (x <= (-7.6d-112)) then
tmp = t_1
else if (x <= 2.4d-62) then
tmp = y / t_0
else if (x <= 5.2d+54) then
tmp = -z / (y / (x + y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = x / t_0;
double tmp;
if (x <= -7.6e-112) {
tmp = t_1;
} else if (x <= 2.4e-62) {
tmp = y / t_0;
} else if (x <= 5.2e+54) {
tmp = -z / (y / (x + y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = x / t_0 tmp = 0 if x <= -7.6e-112: tmp = t_1 elif x <= 2.4e-62: tmp = y / t_0 elif x <= 5.2e+54: tmp = -z / (y / (x + y)) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(x / t_0) tmp = 0.0 if (x <= -7.6e-112) tmp = t_1; elseif (x <= 2.4e-62) tmp = Float64(y / t_0); elseif (x <= 5.2e+54) tmp = Float64(Float64(-z) / Float64(y / Float64(x + y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = x / t_0; tmp = 0.0; if (x <= -7.6e-112) tmp = t_1; elseif (x <= 2.4e-62) tmp = y / t_0; elseif (x <= 5.2e+54) tmp = -z / (y / (x + y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / t$95$0), $MachinePrecision]}, If[LessEqual[x, -7.6e-112], t$95$1, If[LessEqual[x, 2.4e-62], N[(y / t$95$0), $MachinePrecision], If[LessEqual[x, 5.2e+54], N[((-z) / N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{x}{t_0}\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{t_0}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{-z}{\frac{y}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= y -7.5e+54)
(- z)
(if (<= y 5.1e-58)
(+ x y)
(if (<= y 2.4e+23)
(* x (/ (- z) y))
(if (or (<= y 1.02e+49) (not (<= y 5.2e+75))) (- z) (+ x y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.5e+54) {
tmp = -z;
} else if (y <= 5.1e-58) {
tmp = x + y;
} else if (y <= 2.4e+23) {
tmp = x * (-z / y);
} else if ((y <= 1.02e+49) || !(y <= 5.2e+75)) {
tmp = -z;
} else {
tmp = 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 (y <= (-7.5d+54)) then
tmp = -z
else if (y <= 5.1d-58) then
tmp = x + y
else if (y <= 2.4d+23) then
tmp = x * (-z / y)
else if ((y <= 1.02d+49) .or. (.not. (y <= 5.2d+75))) then
tmp = -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7.5e+54) {
tmp = -z;
} else if (y <= 5.1e-58) {
tmp = x + y;
} else if (y <= 2.4e+23) {
tmp = x * (-z / y);
} else if ((y <= 1.02e+49) || !(y <= 5.2e+75)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.5e+54: tmp = -z elif y <= 5.1e-58: tmp = x + y elif y <= 2.4e+23: tmp = x * (-z / y) elif (y <= 1.02e+49) or not (y <= 5.2e+75): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.5e+54) tmp = Float64(-z); elseif (y <= 5.1e-58) tmp = Float64(x + y); elseif (y <= 2.4e+23) tmp = Float64(x * Float64(Float64(-z) / y)); elseif ((y <= 1.02e+49) || !(y <= 5.2e+75)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.5e+54) tmp = -z; elseif (y <= 5.1e-58) tmp = x + y; elseif (y <= 2.4e+23) tmp = x * (-z / y); elseif ((y <= 1.02e+49) || ~((y <= 5.2e+75))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.5e+54], (-z), If[LessEqual[y, 5.1e-58], N[(x + y), $MachinePrecision], If[LessEqual[y, 2.4e+23], N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.02e+49], N[Not[LessEqual[y, 5.2e+75]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+54}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{-58}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+23}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+49} \lor \neg \left(y \leq 5.2 \cdot 10^{+75}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= y -2.1e+54)
(- z)
(if (<= y 5.1e-58)
(+ x y)
(if (<= y 4.3e+23)
(* z (/ (- x) y))
(if (or (<= y 5.2e+48) (not (<= y 1.6e+77))) (- z) (+ x y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.1e+54) {
tmp = -z;
} else if (y <= 5.1e-58) {
tmp = x + y;
} else if (y <= 4.3e+23) {
tmp = z * (-x / y);
} else if ((y <= 5.2e+48) || !(y <= 1.6e+77)) {
tmp = -z;
} else {
tmp = 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 (y <= (-2.1d+54)) then
tmp = -z
else if (y <= 5.1d-58) then
tmp = x + y
else if (y <= 4.3d+23) then
tmp = z * (-x / y)
else if ((y <= 5.2d+48) .or. (.not. (y <= 1.6d+77))) then
tmp = -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.1e+54) {
tmp = -z;
} else if (y <= 5.1e-58) {
tmp = x + y;
} else if (y <= 4.3e+23) {
tmp = z * (-x / y);
} else if ((y <= 5.2e+48) || !(y <= 1.6e+77)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.1e+54: tmp = -z elif y <= 5.1e-58: tmp = x + y elif y <= 4.3e+23: tmp = z * (-x / y) elif (y <= 5.2e+48) or not (y <= 1.6e+77): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.1e+54) tmp = Float64(-z); elseif (y <= 5.1e-58) tmp = Float64(x + y); elseif (y <= 4.3e+23) tmp = Float64(z * Float64(Float64(-x) / y)); elseif ((y <= 5.2e+48) || !(y <= 1.6e+77)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.1e+54) tmp = -z; elseif (y <= 5.1e-58) tmp = x + y; elseif (y <= 4.3e+23) tmp = z * (-x / y); elseif ((y <= 5.2e+48) || ~((y <= 1.6e+77))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.1e+54], (-z), If[LessEqual[y, 5.1e-58], N[(x + y), $MachinePrecision], If[LessEqual[y, 4.3e+23], N[(z * N[((-x) / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 5.2e+48], N[Not[LessEqual[y, 1.6e+77]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+54}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{-58}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{+23}:\\
\;\;\;\;z \cdot \frac{-x}{y}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+48} \lor \neg \left(y \leq 1.6 \cdot 10^{+77}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= y -6.7e+56)
(- z)
(if (<= y 2.15e-79)
(+ x y)
(if (<= y 3.8e+23)
(/ x (- 1.0 (/ y z)))
(if (or (<= y 7e+48) (not (<= y 7.5e+75))) (- z) (+ x y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.7e+56) {
tmp = -z;
} else if (y <= 2.15e-79) {
tmp = x + y;
} else if (y <= 3.8e+23) {
tmp = x / (1.0 - (y / z));
} else if ((y <= 7e+48) || !(y <= 7.5e+75)) {
tmp = -z;
} else {
tmp = 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 (y <= (-6.7d+56)) then
tmp = -z
else if (y <= 2.15d-79) then
tmp = x + y
else if (y <= 3.8d+23) then
tmp = x / (1.0d0 - (y / z))
else if ((y <= 7d+48) .or. (.not. (y <= 7.5d+75))) then
tmp = -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6.7e+56) {
tmp = -z;
} else if (y <= 2.15e-79) {
tmp = x + y;
} else if (y <= 3.8e+23) {
tmp = x / (1.0 - (y / z));
} else if ((y <= 7e+48) || !(y <= 7.5e+75)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.7e+56: tmp = -z elif y <= 2.15e-79: tmp = x + y elif y <= 3.8e+23: tmp = x / (1.0 - (y / z)) elif (y <= 7e+48) or not (y <= 7.5e+75): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.7e+56) tmp = Float64(-z); elseif (y <= 2.15e-79) tmp = Float64(x + y); elseif (y <= 3.8e+23) tmp = Float64(x / Float64(1.0 - Float64(y / z))); elseif ((y <= 7e+48) || !(y <= 7.5e+75)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6.7e+56) tmp = -z; elseif (y <= 2.15e-79) tmp = x + y; elseif (y <= 3.8e+23) tmp = x / (1.0 - (y / z)); elseif ((y <= 7e+48) || ~((y <= 7.5e+75))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.7e+56], (-z), If[LessEqual[y, 2.15e-79], N[(x + y), $MachinePrecision], If[LessEqual[y, 3.8e+23], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 7e+48], N[Not[LessEqual[y, 7.5e+75]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.7 \cdot 10^{+56}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-79}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+48} \lor \neg \left(y \leq 7.5 \cdot 10^{+75}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ x t_0)))
(if (<= x -3.8e-111)
t_1
(if (<= x 1.15) (/ y t_0) (if (<= x 1.92e+40) (- z) t_1)))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = x / t_0;
double tmp;
if (x <= -3.8e-111) {
tmp = t_1;
} else if (x <= 1.15) {
tmp = y / t_0;
} else if (x <= 1.92e+40) {
tmp = -z;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = x / t_0
if (x <= (-3.8d-111)) then
tmp = t_1
else if (x <= 1.15d0) then
tmp = y / t_0
else if (x <= 1.92d+40) then
tmp = -z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = x / t_0;
double tmp;
if (x <= -3.8e-111) {
tmp = t_1;
} else if (x <= 1.15) {
tmp = y / t_0;
} else if (x <= 1.92e+40) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = x / t_0 tmp = 0 if x <= -3.8e-111: tmp = t_1 elif x <= 1.15: tmp = y / t_0 elif x <= 1.92e+40: tmp = -z else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(x / t_0) tmp = 0.0 if (x <= -3.8e-111) tmp = t_1; elseif (x <= 1.15) tmp = Float64(y / t_0); elseif (x <= 1.92e+40) tmp = Float64(-z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = x / t_0; tmp = 0.0; if (x <= -3.8e-111) tmp = t_1; elseif (x <= 1.15) tmp = y / t_0; elseif (x <= 1.92e+40) tmp = -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / t$95$0), $MachinePrecision]}, If[LessEqual[x, -3.8e-111], t$95$1, If[LessEqual[x, 1.15], N[(y / t$95$0), $MachinePrecision], If[LessEqual[x, 1.92e+40], (-z), t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{x}{t_0}\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.15:\\
\;\;\;\;\frac{y}{t_0}\\
\mathbf{elif}\;x \leq 1.92 \cdot 10^{+40}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (or (<= y -5.9e+57)
(and (not (<= y 2.3e-58)) (or (<= y 2.1e+50) (not (<= y 3.2e+76)))))
(- z)
(+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.9e+57) || (!(y <= 2.3e-58) && ((y <= 2.1e+50) || !(y <= 3.2e+76)))) {
tmp = -z;
} else {
tmp = 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 ((y <= (-5.9d+57)) .or. (.not. (y <= 2.3d-58)) .and. (y <= 2.1d+50) .or. (.not. (y <= 3.2d+76))) then
tmp = -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.9e+57) || (!(y <= 2.3e-58) && ((y <= 2.1e+50) || !(y <= 3.2e+76)))) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.9e+57) or (not (y <= 2.3e-58) and ((y <= 2.1e+50) or not (y <= 3.2e+76))): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.9e+57) || (!(y <= 2.3e-58) && ((y <= 2.1e+50) || !(y <= 3.2e+76)))) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.9e+57) || (~((y <= 2.3e-58)) && ((y <= 2.1e+50) || ~((y <= 3.2e+76))))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.9e+57], And[N[Not[LessEqual[y, 2.3e-58]], $MachinePrecision], Or[LessEqual[y, 2.1e+50], N[Not[LessEqual[y, 3.2e+76]], $MachinePrecision]]]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.9 \cdot 10^{+57} \lor \neg \left(y \leq 2.3 \cdot 10^{-58}\right) \land \left(y \leq 2.1 \cdot 10^{+50} \lor \neg \left(y \leq 3.2 \cdot 10^{+76}\right)\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -1350.0) (not (<= y 3.2e-58))) (- z) x))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1350.0) || !(y <= 3.2e-58)) {
tmp = -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 ((y <= (-1350.0d0)) .or. (.not. (y <= 3.2d-58))) then
tmp = -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1350.0) || !(y <= 3.2e-58)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1350.0) or not (y <= 3.2e-58): tmp = -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1350.0) || !(y <= 3.2e-58)) tmp = Float64(-z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1350.0) || ~((y <= 3.2e-58))) tmp = -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1350.0], N[Not[LessEqual[y, 3.2e-58]], $MachinePrecision]], (-z), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1350 \lor \neg \left(y \leq 3.2 \cdot 10^{-58}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= x -1.12e-113) x (if (<= x 1.35e-109) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.12e-113) {
tmp = x;
} else if (x <= 1.35e-109) {
tmp = 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 <= (-1.12d-113)) then
tmp = x
else if (x <= 1.35d-109) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.12e-113) {
tmp = x;
} else if (x <= 1.35e-109) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.12e-113: tmp = x elif x <= 1.35e-109: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.12e-113) tmp = x; elseif (x <= 1.35e-109) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.12e-113) tmp = x; elseif (x <= 1.35e-109) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.12e-113], x, If[LessEqual[x, 1.35e-109], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{-113}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-109}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\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
(let* ((t_0 (* (/ (+ y x) (- y)) z)))
(if (< y -3.7429310762689856e+171)
t_0
(if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} 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 = ((y + x) / -y) * z
if (y < (-3.7429310762689856d+171)) then
tmp = t_0
else if (y < 3.5534662456086734d+168) then
tmp = (x + y) / (1.0d0 - (y / z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y + x) / -y) * z tmp = 0 if y < -3.7429310762689856e+171: tmp = t_0 elif y < 3.5534662456086734e+168: tmp = (x + y) / (1.0 - (y / z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y + x) / Float64(-y)) * z) tmp = 0.0 if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y + x) / -y) * z; tmp = 0.0; if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = (x + y) / (1.0 - (y / z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + x), $MachinePrecision] / (-y)), $MachinePrecision] * z), $MachinePrecision]}, If[Less[y, -3.7429310762689856e+171], t$95$0, If[Less[y, 3.5534662456086734e+168], N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y + x}{-y} \cdot z\\
\mathbf{if}\;y < -3.7429310762689856 \cdot 10^{+171}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y < 3.5534662456086734 \cdot 10^{+168}:\\
\;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2024008
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
:precision binary64
:herbie-target
(if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) (* (/ (+ y x) (- y)) z)))
(/ (+ x y) (- 1.0 (/ y z))))