
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / 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 - z) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / 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 - z) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -3.7e-15) (not (<= z 9e+81))) (* x (/ (+ y (- 1.0 z)) z)) (* (/ x z) (+ 1.0 (- y z)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.7e-15) || !(z <= 9e+81)) {
tmp = x * ((y + (1.0 - z)) / z);
} else {
tmp = (x / z) * (1.0 + (y - z));
}
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 <= (-3.7d-15)) .or. (.not. (z <= 9d+81))) then
tmp = x * ((y + (1.0d0 - z)) / z)
else
tmp = (x / z) * (1.0d0 + (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.7e-15) || !(z <= 9e+81)) {
tmp = x * ((y + (1.0 - z)) / z);
} else {
tmp = (x / z) * (1.0 + (y - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.7e-15) or not (z <= 9e+81): tmp = x * ((y + (1.0 - z)) / z) else: tmp = (x / z) * (1.0 + (y - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.7e-15) || !(z <= 9e+81)) tmp = Float64(x * Float64(Float64(y + Float64(1.0 - z)) / z)); else tmp = Float64(Float64(x / z) * Float64(1.0 + Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.7e-15) || ~((z <= 9e+81))) tmp = x * ((y + (1.0 - z)) / z); else tmp = (x / z) * (1.0 + (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.7e-15], N[Not[LessEqual[z, 9e+81]], $MachinePrecision]], N[(x * N[(N[(y + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-15} \lor \neg \left(z \leq 9 \cdot 10^{+81}\right):\\
\;\;\;\;x \cdot \frac{y + \left(1 - z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(1 + \left(y - z\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -2e+50)
(- x)
(if (<= z -4.5e-14)
t_0
(if (<= z -2.25e-91)
(/ x z)
(if (<= z -4.9e-167)
t_0
(if (<= z -9e-238)
(/ x z)
(if (<= z 3.1e-100)
t_0
(if (<= z 2.1e-67) (/ x z) (if (<= z 440.0) t_0 (- x)))))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -2e+50) {
tmp = -x;
} else if (z <= -4.5e-14) {
tmp = t_0;
} else if (z <= -2.25e-91) {
tmp = x / z;
} else if (z <= -4.9e-167) {
tmp = t_0;
} else if (z <= -9e-238) {
tmp = x / z;
} else if (z <= 3.1e-100) {
tmp = t_0;
} else if (z <= 2.1e-67) {
tmp = x / z;
} else if (z <= 440.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y * (x / z)
if (z <= (-2d+50)) then
tmp = -x
else if (z <= (-4.5d-14)) then
tmp = t_0
else if (z <= (-2.25d-91)) then
tmp = x / z
else if (z <= (-4.9d-167)) then
tmp = t_0
else if (z <= (-9d-238)) then
tmp = x / z
else if (z <= 3.1d-100) then
tmp = t_0
else if (z <= 2.1d-67) then
tmp = x / z
else if (z <= 440.0d0) then
tmp = t_0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -2e+50) {
tmp = -x;
} else if (z <= -4.5e-14) {
tmp = t_0;
} else if (z <= -2.25e-91) {
tmp = x / z;
} else if (z <= -4.9e-167) {
tmp = t_0;
} else if (z <= -9e-238) {
tmp = x / z;
} else if (z <= 3.1e-100) {
tmp = t_0;
} else if (z <= 2.1e-67) {
tmp = x / z;
} else if (z <= 440.0) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -2e+50: tmp = -x elif z <= -4.5e-14: tmp = t_0 elif z <= -2.25e-91: tmp = x / z elif z <= -4.9e-167: tmp = t_0 elif z <= -9e-238: tmp = x / z elif z <= 3.1e-100: tmp = t_0 elif z <= 2.1e-67: tmp = x / z elif z <= 440.0: tmp = t_0 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (z <= -2e+50) tmp = Float64(-x); elseif (z <= -4.5e-14) tmp = t_0; elseif (z <= -2.25e-91) tmp = Float64(x / z); elseif (z <= -4.9e-167) tmp = t_0; elseif (z <= -9e-238) tmp = Float64(x / z); elseif (z <= 3.1e-100) tmp = t_0; elseif (z <= 2.1e-67) tmp = Float64(x / z); elseif (z <= 440.0) tmp = t_0; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); tmp = 0.0; if (z <= -2e+50) tmp = -x; elseif (z <= -4.5e-14) tmp = t_0; elseif (z <= -2.25e-91) tmp = x / z; elseif (z <= -4.9e-167) tmp = t_0; elseif (z <= -9e-238) tmp = x / z; elseif (z <= 3.1e-100) tmp = t_0; elseif (z <= 2.1e-67) tmp = x / z; elseif (z <= 440.0) tmp = t_0; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+50], (-x), If[LessEqual[z, -4.5e-14], t$95$0, If[LessEqual[z, -2.25e-91], N[(x / z), $MachinePrecision], If[LessEqual[z, -4.9e-167], t$95$0, If[LessEqual[z, -9e-238], N[(x / z), $MachinePrecision], If[LessEqual[z, 3.1e-100], t$95$0, If[LessEqual[z, 2.1e-67], N[(x / z), $MachinePrecision], If[LessEqual[z, 440.0], t$95$0, (-x)]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+50}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-14}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-91}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{-167}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-238}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-67}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 440:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -1.65e+50)
(- x)
(if (<= z -4.5e-14)
(* x (/ y z))
(if (<= z -2.8e-90)
(/ x z)
(if (<= z -5.5e-162)
t_0
(if (<= z -1.4e-240)
(/ x z)
(if (<= z 2.1e-115)
t_0
(if (<= z 2.3e-68) (/ x z) (if (<= z 440.0) t_0 (- x)))))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.65e+50) {
tmp = -x;
} else if (z <= -4.5e-14) {
tmp = x * (y / z);
} else if (z <= -2.8e-90) {
tmp = x / z;
} else if (z <= -5.5e-162) {
tmp = t_0;
} else if (z <= -1.4e-240) {
tmp = x / z;
} else if (z <= 2.1e-115) {
tmp = t_0;
} else if (z <= 2.3e-68) {
tmp = x / z;
} else if (z <= 440.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y * (x / z)
if (z <= (-1.65d+50)) then
tmp = -x
else if (z <= (-4.5d-14)) then
tmp = x * (y / z)
else if (z <= (-2.8d-90)) then
tmp = x / z
else if (z <= (-5.5d-162)) then
tmp = t_0
else if (z <= (-1.4d-240)) then
tmp = x / z
else if (z <= 2.1d-115) then
tmp = t_0
else if (z <= 2.3d-68) then
tmp = x / z
else if (z <= 440.0d0) then
tmp = t_0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.65e+50) {
tmp = -x;
} else if (z <= -4.5e-14) {
tmp = x * (y / z);
} else if (z <= -2.8e-90) {
tmp = x / z;
} else if (z <= -5.5e-162) {
tmp = t_0;
} else if (z <= -1.4e-240) {
tmp = x / z;
} else if (z <= 2.1e-115) {
tmp = t_0;
} else if (z <= 2.3e-68) {
tmp = x / z;
} else if (z <= 440.0) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -1.65e+50: tmp = -x elif z <= -4.5e-14: tmp = x * (y / z) elif z <= -2.8e-90: tmp = x / z elif z <= -5.5e-162: tmp = t_0 elif z <= -1.4e-240: tmp = x / z elif z <= 2.1e-115: tmp = t_0 elif z <= 2.3e-68: tmp = x / z elif z <= 440.0: tmp = t_0 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (z <= -1.65e+50) tmp = Float64(-x); elseif (z <= -4.5e-14) tmp = Float64(x * Float64(y / z)); elseif (z <= -2.8e-90) tmp = Float64(x / z); elseif (z <= -5.5e-162) tmp = t_0; elseif (z <= -1.4e-240) tmp = Float64(x / z); elseif (z <= 2.1e-115) tmp = t_0; elseif (z <= 2.3e-68) tmp = Float64(x / z); elseif (z <= 440.0) tmp = t_0; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); tmp = 0.0; if (z <= -1.65e+50) tmp = -x; elseif (z <= -4.5e-14) tmp = x * (y / z); elseif (z <= -2.8e-90) tmp = x / z; elseif (z <= -5.5e-162) tmp = t_0; elseif (z <= -1.4e-240) tmp = x / z; elseif (z <= 2.1e-115) tmp = t_0; elseif (z <= 2.3e-68) tmp = x / z; elseif (z <= 440.0) tmp = t_0; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+50], (-x), If[LessEqual[z, -4.5e-14], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e-90], N[(x / z), $MachinePrecision], If[LessEqual[z, -5.5e-162], t$95$0, If[LessEqual[z, -1.4e-240], N[(x / z), $MachinePrecision], If[LessEqual[z, 2.1e-115], t$95$0, If[LessEqual[z, 2.3e-68], N[(x / z), $MachinePrecision], If[LessEqual[z, 440.0], t$95$0, (-x)]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+50}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-90}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-162}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-240}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-115}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 440:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -5e-19) (not (<= z 3.2e-49))) (* x (/ (+ y (- 1.0 z)) z)) (/ (+ x (* x y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5e-19) || !(z <= 3.2e-49)) {
tmp = x * ((y + (1.0 - z)) / z);
} else {
tmp = (x + (x * y)) / z;
}
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 <= (-5d-19)) .or. (.not. (z <= 3.2d-49))) then
tmp = x * ((y + (1.0d0 - z)) / z)
else
tmp = (x + (x * y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5e-19) || !(z <= 3.2e-49)) {
tmp = x * ((y + (1.0 - z)) / z);
} else {
tmp = (x + (x * y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5e-19) or not (z <= 3.2e-49): tmp = x * ((y + (1.0 - z)) / z) else: tmp = (x + (x * y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5e-19) || !(z <= 3.2e-49)) tmp = Float64(x * Float64(Float64(y + Float64(1.0 - z)) / z)); else tmp = Float64(Float64(x + Float64(x * y)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5e-19) || ~((z <= 3.2e-49))) tmp = x * ((y + (1.0 - z)) / z); else tmp = (x + (x * y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5e-19], N[Not[LessEqual[z, 3.2e-49]], $MachinePrecision]], N[(x * N[(N[(y + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-19} \lor \neg \left(z \leq 3.2 \cdot 10^{-49}\right):\\
\;\;\;\;x \cdot \frac{y + \left(1 - z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= x 1.5e-54) (/ (+ (* x y) (* x (- 1.0 z))) z) (* (/ x z) (+ 1.0 (- y z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.5e-54) {
tmp = ((x * y) + (x * (1.0 - z))) / z;
} else {
tmp = (x / z) * (1.0 + (y - z));
}
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.5d-54) then
tmp = ((x * y) + (x * (1.0d0 - z))) / z
else
tmp = (x / z) * (1.0d0 + (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.5e-54) {
tmp = ((x * y) + (x * (1.0 - z))) / z;
} else {
tmp = (x / z) * (1.0 + (y - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.5e-54: tmp = ((x * y) + (x * (1.0 - z))) / z else: tmp = (x / z) * (1.0 + (y - z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.5e-54) tmp = Float64(Float64(Float64(x * y) + Float64(x * Float64(1.0 - z))) / z); else tmp = Float64(Float64(x / z) * Float64(1.0 + Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.5e-54) tmp = ((x * y) + (x * (1.0 - z))) / z; else tmp = (x / z) * (1.0 + (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.5e-54], N[(N[(N[(x * y), $MachinePrecision] + N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{x \cdot y + x \cdot \left(1 - z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(1 + \left(y - z\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= z -5.6e+52) (- x) (if (<= z 0.0045) (/ (+ x (* x y)) z) (- (/ x z) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.6e+52) {
tmp = -x;
} else if (z <= 0.0045) {
tmp = (x + (x * y)) / z;
} else {
tmp = (x / z) - 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 <= (-5.6d+52)) then
tmp = -x
else if (z <= 0.0045d0) then
tmp = (x + (x * y)) / z
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.6e+52) {
tmp = -x;
} else if (z <= 0.0045) {
tmp = (x + (x * y)) / z;
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.6e+52: tmp = -x elif z <= 0.0045: tmp = (x + (x * y)) / z else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.6e+52) tmp = Float64(-x); elseif (z <= 0.0045) tmp = Float64(Float64(x + Float64(x * y)) / z); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.6e+52) tmp = -x; elseif (z <= 0.0045) tmp = (x + (x * y)) / z; else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.6e+52], (-x), If[LessEqual[z, 0.0045], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+52}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq 0.0045:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ 1.0 (- y z)))) (if (<= x 1.4e-54) (/ (* x t_0) z) (* (/ x z) t_0))))
double code(double x, double y, double z) {
double t_0 = 1.0 + (y - z);
double tmp;
if (x <= 1.4e-54) {
tmp = (x * t_0) / z;
} else {
tmp = (x / z) * 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 = 1.0d0 + (y - z)
if (x <= 1.4d-54) then
tmp = (x * t_0) / z
else
tmp = (x / z) * t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 + (y - z);
double tmp;
if (x <= 1.4e-54) {
tmp = (x * t_0) / z;
} else {
tmp = (x / z) * t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 + (y - z) tmp = 0 if x <= 1.4e-54: tmp = (x * t_0) / z else: tmp = (x / z) * t_0 return tmp
function code(x, y, z) t_0 = Float64(1.0 + Float64(y - z)) tmp = 0.0 if (x <= 1.4e-54) tmp = Float64(Float64(x * t_0) / z); else tmp = Float64(Float64(x / z) * t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 + (y - z); tmp = 0.0; if (x <= 1.4e-54) tmp = (x * t_0) / z; else tmp = (x / z) * t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.4e-54], N[(N[(x * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y - z\right)\\
\mathbf{if}\;x \leq 1.4 \cdot 10^{-54}:\\
\;\;\;\;\frac{x \cdot t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot t_0\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -70000.0) (not (<= y 4.6e+67))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -70000.0) || !(y <= 4.6e+67)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - 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 <= (-70000.0d0)) .or. (.not. (y <= 4.6d+67))) then
tmp = y * (x / z)
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -70000.0) || !(y <= 4.6e+67)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -70000.0) or not (y <= 4.6e+67): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -70000.0) || !(y <= 4.6e+67)) tmp = Float64(y * Float64(x / z)); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -70000.0) || ~((y <= 4.6e+67))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -70000.0], N[Not[LessEqual[y, 4.6e+67]], $MachinePrecision]], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -70000 \lor \neg \left(y \leq 4.6 \cdot 10^{+67}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -940000.0) (not (<= y 4.7e+67))) (/ (* x y) z) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -940000.0) || !(y <= 4.7e+67)) {
tmp = (x * y) / z;
} else {
tmp = (x / z) - 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 <= (-940000.0d0)) .or. (.not. (y <= 4.7d+67))) then
tmp = (x * y) / z
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -940000.0) || !(y <= 4.7e+67)) {
tmp = (x * y) / z;
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -940000.0) or not (y <= 4.7e+67): tmp = (x * y) / z else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -940000.0) || !(y <= 4.7e+67)) tmp = Float64(Float64(x * y) / z); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -940000.0) || ~((y <= 4.7e+67))) tmp = (x * y) / z; else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -940000.0], N[Not[LessEqual[y, 4.7e+67]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -940000 \lor \neg \left(y \leq 4.7 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y -4200000.0) (/ y (/ z x)) (if (<= y 4.6e+67) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4200000.0) {
tmp = y / (z / x);
} else if (y <= 4.6e+67) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
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 <= (-4200000.0d0)) then
tmp = y / (z / x)
else if (y <= 4.6d+67) then
tmp = (x / z) - x
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -4200000.0) {
tmp = y / (z / x);
} else if (y <= 4.6e+67) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4200000.0: tmp = y / (z / x) elif y <= 4.6e+67: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4200000.0) tmp = Float64(y / Float64(z / x)); elseif (y <= 4.6e+67) tmp = Float64(Float64(x / z) - x); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4200000.0) tmp = y / (z / x); elseif (y <= 4.6e+67) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4200000.0], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+67], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4200000:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+67}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -4.5e-14) (not (<= z 1.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.5e-14) || !(z <= 1.0)) {
tmp = -x;
} else {
tmp = x / z;
}
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 <= (-4.5d-14)) .or. (.not. (z <= 1.0d0))) then
tmp = -x
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4.5e-14) || !(z <= 1.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.5e-14) or not (z <= 1.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.5e-14) || !(z <= 1.0)) tmp = Float64(-x); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4.5e-14) || ~((z <= 1.0))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.5e-14], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-14} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\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 Float64(-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 (- (* (+ 1.0 y) (/ x z)) x)))
(if (< x -2.71483106713436e-162)
t_0
(if (< x 3.874108816439546e-197)
(* (* x (+ (- y z) 1.0)) (/ 1.0 z))
t_0))))
double code(double x, double y, double z) {
double t_0 = ((1.0 + y) * (x / z)) - x;
double tmp;
if (x < -2.71483106713436e-162) {
tmp = t_0;
} else if (x < 3.874108816439546e-197) {
tmp = (x * ((y - z) + 1.0)) * (1.0 / 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 = ((1.0d0 + y) * (x / z)) - x
if (x < (-2.71483106713436d-162)) then
tmp = t_0
else if (x < 3.874108816439546d-197) then
tmp = (x * ((y - z) + 1.0d0)) * (1.0d0 / z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((1.0 + y) * (x / z)) - x;
double tmp;
if (x < -2.71483106713436e-162) {
tmp = t_0;
} else if (x < 3.874108816439546e-197) {
tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((1.0 + y) * (x / z)) - x tmp = 0 if x < -2.71483106713436e-162: tmp = t_0 elif x < 3.874108816439546e-197: tmp = (x * ((y - z) + 1.0)) * (1.0 / z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(1.0 + y) * Float64(x / z)) - x) tmp = 0.0 if (x < -2.71483106713436e-162) tmp = t_0; elseif (x < 3.874108816439546e-197) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) * Float64(1.0 / z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((1.0 + y) * (x / z)) - x; tmp = 0.0; if (x < -2.71483106713436e-162) tmp = t_0; elseif (x < 3.874108816439546e-197) tmp = (x * ((y - z) + 1.0)) * (1.0 / z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(1.0 + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]}, If[Less[x, -2.71483106713436e-162], t$95$0, If[Less[x, 3.874108816439546e-197], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + y\right) \cdot \frac{x}{z} - x\\
\mathbf{if}\;x < -2.71483106713436 \cdot 10^{-162}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x < 3.874108816439546 \cdot 10^{-197}:\\
\;\;\;\;\left(x \cdot \left(\left(y - z\right) + 1\right)\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2023347
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(if (< x -2.71483106713436e-162) (- (* (+ 1.0 y) (/ x z)) x) (if (< x 3.874108816439546e-197) (* (* x (+ (- y z) 1.0)) (/ 1.0 z)) (- (* (+ 1.0 y) (/ x z)) x)))
(/ (* x (+ (- y z) 1.0)) z))