
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= (+ (/ x y) (/ (+ 2.0 (* (* 2.0 z) (- 1.0 t))) (* z t))) INFINITY) (fma (fma z (- 1.0 t) 1.0) (/ 2.0 (* z t)) (/ x y)) (- (/ x y) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t))) <= ((double) INFINITY)) {
tmp = fma(fma(z, (1.0 - t), 1.0), (2.0 / (z * t)), (x / y));
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(2.0 * z) * Float64(1.0 - t))) / Float64(z * t))) <= Inf) tmp = fma(fma(z, Float64(1.0 - t), 1.0), Float64(2.0 / Float64(z * t)), Float64(x / y)); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(2.0 * z), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * N[(1.0 - t), $MachinePrecision] + 1.0), $MachinePrecision] * N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} + \frac{2 + \left(2 \cdot z\right) \cdot \left(1 - t\right)}{z \cdot t} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) (/ (+ 2.0 (* (* 2.0 z) (- 1.0 t))) (* z t))))) (if (<= t_1 INFINITY) t_1 (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(2.0 * z) * Float64(1.0 - t))) / Float64(z * t))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(2.0 * z), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2 + \left(2 \cdot z\right) \cdot \left(1 - t\right)}{z \cdot t}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ (/ 2.0 t) z)))
(t_2 (+ (/ 2.0 t) -2.0))
(t_3 (+ (/ x y) (/ 2.0 t))))
(if (<= (/ x y) -1.8e+14)
t_3
(if (<= (/ x y) -8e-123)
t_1
(if (<= (/ x y) -6.8e-173)
t_2
(if (<= (/ x y) -8.5e-272)
t_1
(if (<= (/ x y) 2e-323) t_2 (if (<= (/ x y) 1.45e-6) t_1 t_3))))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + ((2.0 / t) / z);
double t_2 = (2.0 / t) + -2.0;
double t_3 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -1.8e+14) {
tmp = t_3;
} else if ((x / y) <= -8e-123) {
tmp = t_1;
} else if ((x / y) <= -6.8e-173) {
tmp = t_2;
} else if ((x / y) <= -8.5e-272) {
tmp = t_1;
} else if ((x / y) <= 2e-323) {
tmp = t_2;
} else if ((x / y) <= 1.45e-6) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (-2.0d0) + ((2.0d0 / t) / z)
t_2 = (2.0d0 / t) + (-2.0d0)
t_3 = (x / y) + (2.0d0 / t)
if ((x / y) <= (-1.8d+14)) then
tmp = t_3
else if ((x / y) <= (-8d-123)) then
tmp = t_1
else if ((x / y) <= (-6.8d-173)) then
tmp = t_2
else if ((x / y) <= (-8.5d-272)) then
tmp = t_1
else if ((x / y) <= 2d-323) then
tmp = t_2
else if ((x / y) <= 1.45d-6) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + ((2.0 / t) / z);
double t_2 = (2.0 / t) + -2.0;
double t_3 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -1.8e+14) {
tmp = t_3;
} else if ((x / y) <= -8e-123) {
tmp = t_1;
} else if ((x / y) <= -6.8e-173) {
tmp = t_2;
} else if ((x / y) <= -8.5e-272) {
tmp = t_1;
} else if ((x / y) <= 2e-323) {
tmp = t_2;
} else if ((x / y) <= 1.45e-6) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + ((2.0 / t) / z) t_2 = (2.0 / t) + -2.0 t_3 = (x / y) + (2.0 / t) tmp = 0 if (x / y) <= -1.8e+14: tmp = t_3 elif (x / y) <= -8e-123: tmp = t_1 elif (x / y) <= -6.8e-173: tmp = t_2 elif (x / y) <= -8.5e-272: tmp = t_1 elif (x / y) <= 2e-323: tmp = t_2 elif (x / y) <= 1.45e-6: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(Float64(2.0 / t) / z)) t_2 = Float64(Float64(2.0 / t) + -2.0) t_3 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -1.8e+14) tmp = t_3; elseif (Float64(x / y) <= -8e-123) tmp = t_1; elseif (Float64(x / y) <= -6.8e-173) tmp = t_2; elseif (Float64(x / y) <= -8.5e-272) tmp = t_1; elseif (Float64(x / y) <= 2e-323) tmp = t_2; elseif (Float64(x / y) <= 1.45e-6) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + ((2.0 / t) / z); t_2 = (2.0 / t) + -2.0; t_3 = (x / y) + (2.0 / t); tmp = 0.0; if ((x / y) <= -1.8e+14) tmp = t_3; elseif ((x / y) <= -8e-123) tmp = t_1; elseif ((x / y) <= -6.8e-173) tmp = t_2; elseif ((x / y) <= -8.5e-272) tmp = t_1; elseif ((x / y) <= 2e-323) tmp = t_2; elseif ((x / y) <= 1.45e-6) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1.8e+14], t$95$3, If[LessEqual[N[(x / y), $MachinePrecision], -8e-123], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -6.8e-173], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -8.5e-272], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 2e-323], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 1.45e-6], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{\frac{2}{t}}{z}\\
t_2 := \frac{2}{t} + -2\\
t_3 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -1.8 \cdot 10^{+14}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;\frac{x}{y} \leq -8 \cdot 10^{-123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq -6.8 \cdot 10^{-173}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{x}{y} \leq -8.5 \cdot 10^{-272}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-323}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.45 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= (/ x y) -52000000000000.0)
t_1
(if (<= (/ x y) -8.2e-35)
(/ 2.0 (* z t))
(if (<= (/ x y) 2.0) (+ (/ 2.0 t) -2.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -52000000000000.0) {
tmp = t_1;
} else if ((x / y) <= -8.2e-35) {
tmp = 2.0 / (z * t);
} else if ((x / y) <= 2.0) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (2.0d0 / t)
if ((x / y) <= (-52000000000000.0d0)) then
tmp = t_1
else if ((x / y) <= (-8.2d-35)) then
tmp = 2.0d0 / (z * t)
else if ((x / y) <= 2.0d0) then
tmp = (2.0d0 / t) + (-2.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -52000000000000.0) {
tmp = t_1;
} else if ((x / y) <= -8.2e-35) {
tmp = 2.0 / (z * t);
} else if ((x / y) <= 2.0) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if (x / y) <= -52000000000000.0: tmp = t_1 elif (x / y) <= -8.2e-35: tmp = 2.0 / (z * t) elif (x / y) <= 2.0: tmp = (2.0 / t) + -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -52000000000000.0) tmp = t_1; elseif (Float64(x / y) <= -8.2e-35) tmp = Float64(2.0 / Float64(z * t)); elseif (Float64(x / y) <= 2.0) tmp = Float64(Float64(2.0 / t) + -2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if ((x / y) <= -52000000000000.0) tmp = t_1; elseif ((x / y) <= -8.2e-35) tmp = 2.0 / (z * t); elseif ((x / y) <= 2.0) tmp = (2.0 / t) + -2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -52000000000000.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -8.2e-35], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.0], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -52000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq -8.2 \cdot 10^{-35}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))) (t_2 (- (/ x y) 2.0)))
(if (<= t -1.0)
t_2
(if (<= t -2.65e-163)
t_1
(if (<= t 1.82e-37)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (<= t 14.6)
t_1
(if (<= t 1300.0) (+ -2.0 (/ (/ 2.0 t) z)) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -1.0) {
tmp = t_2;
} else if (t <= -2.65e-163) {
tmp = t_1;
} else if (t <= 1.82e-37) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 14.6) {
tmp = t_1;
} else if (t <= 1300.0) {
tmp = -2.0 + ((2.0 / t) / z);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) + (2.0d0 / t)
t_2 = (x / y) - 2.0d0
if (t <= (-1.0d0)) then
tmp = t_2
else if (t <= (-2.65d-163)) then
tmp = t_1
else if (t <= 1.82d-37) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if (t <= 14.6d0) then
tmp = t_1
else if (t <= 1300.0d0) then
tmp = (-2.0d0) + ((2.0d0 / t) / z)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -1.0) {
tmp = t_2;
} else if (t <= -2.65e-163) {
tmp = t_1;
} else if (t <= 1.82e-37) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 14.6) {
tmp = t_1;
} else if (t <= 1300.0) {
tmp = -2.0 + ((2.0 / t) / z);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) t_2 = (x / y) - 2.0 tmp = 0 if t <= -1.0: tmp = t_2 elif t <= -2.65e-163: tmp = t_1 elif t <= 1.82e-37: tmp = (2.0 + (2.0 / z)) / t elif t <= 14.6: tmp = t_1 elif t <= 1300.0: tmp = -2.0 + ((2.0 / t) / z) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -1.0) tmp = t_2; elseif (t <= -2.65e-163) tmp = t_1; elseif (t <= 1.82e-37) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (t <= 14.6) tmp = t_1; elseif (t <= 1300.0) tmp = Float64(-2.0 + Float64(Float64(2.0 / t) / z)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -1.0) tmp = t_2; elseif (t <= -2.65e-163) tmp = t_1; elseif (t <= 1.82e-37) tmp = (2.0 + (2.0 / z)) / t; elseif (t <= 14.6) tmp = t_1; elseif (t <= 1300.0) tmp = -2.0 + ((2.0 / t) / z); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.0], t$95$2, If[LessEqual[t, -2.65e-163], t$95$1, If[LessEqual[t, 1.82e-37], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 14.6], t$95$1, If[LessEqual[t, 1300.0], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -2.65 \cdot 10^{-163}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.82 \cdot 10^{-37}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 14.6:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1300:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5.6) (not (<= (/ x y) 5800000.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5.6) || !((x / y) <= 5800000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-5.6d0)) .or. (.not. ((x / y) <= 5800000.0d0))) then
tmp = x / y
else
tmp = (2.0d0 / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5.6) || !((x / y) <= 5800000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5.6) or not ((x / y) <= 5800000.0): tmp = x / y else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5.6) || !(Float64(x / y) <= 5800000.0)) tmp = Float64(x / y); else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5.6) || ~(((x / y) <= 5800000.0))) tmp = x / y; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5.6], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5800000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5.6 \lor \neg \left(\frac{x}{y} \leq 5800000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.0125) (not (<= (/ x y) 440.0))) (- (/ x y) 2.0) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.0125) || !((x / y) <= 440.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-0.0125d0)) .or. (.not. ((x / y) <= 440.0d0))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.0125) || !((x / y) <= 440.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -0.0125) or not ((x / y) <= 440.0): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -0.0125) || !(Float64(x / y) <= 440.0)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -0.0125) || ~(((x / y) <= 440.0))) tmp = (x / y) - 2.0; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -0.0125], N[Not[LessEqual[N[(x / y), $MachinePrecision], 440.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.0125 \lor \neg \left(\frac{x}{y} \leq 440\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.45e-163) (not (<= t 1.15e-37))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.45e-163) || !(t <= 1.15e-37)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2.45d-163)) .or. (.not. (t <= 1.15d-37))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (2.0d0 + (2.0d0 / z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.45e-163) || !(t <= 1.15e-37)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.45e-163) or not (t <= 1.15e-37): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.45e-163) || !(t <= 1.15e-37)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.45e-163) || ~((t <= 1.15e-37))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.45e-163], N[Not[LessEqual[t, 1.15e-37]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{-163} \lor \neg \left(t \leq 1.15 \cdot 10^{-37}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.000105) (not (<= z 2.5e-44))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.000105) || !(z <= 2.5e-44)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-0.000105d0)) .or. (.not. (z <= 2.5d-44))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.000105) || !(z <= 2.5e-44)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.000105) or not (z <= 2.5e-44): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.000105) || !(z <= 2.5e-44)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.000105) || ~((z <= 2.5e-44))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.000105], N[Not[LessEqual[z, 2.5e-44]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.000105 \lor \neg \left(z \leq 2.5 \cdot 10^{-44}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2900000000.0) (not (<= (/ x y) 2.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2900000000.0) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-2900000000.0d0)) .or. (.not. ((x / y) <= 2.0d0))) then
tmp = x / y
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2900000000.0) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2900000000.0) or not ((x / y) <= 2.0): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2900000000.0) || !(Float64(x / y) <= 2.0)) tmp = Float64(x / y); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2900000000.0) || ~(((x / y) <= 2.0))) tmp = x / y; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2900000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2900000000 \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 1.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.0d0)) then
tmp = -2.0d0
else if (t <= 1.0d0) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 1.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 1.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.0) tmp = -2.0; elseif (t <= 1.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 1.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024008
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))