
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * 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 = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * 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 = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- y (/ t y))))
(if (<= y -4.6e-75)
(+ x (/ t_1 (* z -3.0)))
(if (<= y 9.2e-225)
(+ x (/ (/ t z) (* y 3.0)))
(+ x (/ (/ t_1 -3.0) z))))))
double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -4.6e-75) {
tmp = x + (t_1 / (z * -3.0));
} else if (y <= 9.2e-225) {
tmp = x + ((t / z) / (y * 3.0));
} else {
tmp = x + ((t_1 / -3.0) / 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) :: t_1
real(8) :: tmp
t_1 = y - (t / y)
if (y <= (-4.6d-75)) then
tmp = x + (t_1 / (z * (-3.0d0)))
else if (y <= 9.2d-225) then
tmp = x + ((t / z) / (y * 3.0d0))
else
tmp = x + ((t_1 / (-3.0d0)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -4.6e-75) {
tmp = x + (t_1 / (z * -3.0));
} else if (y <= 9.2e-225) {
tmp = x + ((t / z) / (y * 3.0));
} else {
tmp = x + ((t_1 / -3.0) / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = y - (t / y) tmp = 0 if y <= -4.6e-75: tmp = x + (t_1 / (z * -3.0)) elif y <= 9.2e-225: tmp = x + ((t / z) / (y * 3.0)) else: tmp = x + ((t_1 / -3.0) / z) return tmp
function code(x, y, z, t) t_1 = Float64(y - Float64(t / y)) tmp = 0.0 if (y <= -4.6e-75) tmp = Float64(x + Float64(t_1 / Float64(z * -3.0))); elseif (y <= 9.2e-225) tmp = Float64(x + Float64(Float64(t / z) / Float64(y * 3.0))); else tmp = Float64(x + Float64(Float64(t_1 / -3.0) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y - (t / y); tmp = 0.0; if (y <= -4.6e-75) tmp = x + (t_1 / (z * -3.0)); elseif (y <= 9.2e-225) tmp = x + ((t / z) / (y * 3.0)); else tmp = x + ((t_1 / -3.0) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e-75], N[(x + N[(t$95$1 / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-225], N[(x + N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t$95$1 / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{t}{y}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{-75}:\\
\;\;\;\;x + \frac{t_1}{z \cdot -3}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-225}:\\
\;\;\;\;x + \frac{\frac{t}{z}}{y \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t_1}{-3}}{z}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(if (<= t 2.9e+159)
(+
x
(+ (* -0.3333333333333333 (/ y z)) (* (/ t z) (/ 0.3333333333333333 y))))
(+ x (/ (- y (/ t y)) (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.9e+159) {
tmp = x + ((-0.3333333333333333 * (y / z)) + ((t / z) * (0.3333333333333333 / y)));
} else {
tmp = x + ((y - (t / y)) / (z * -3.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 <= 2.9d+159) then
tmp = x + (((-0.3333333333333333d0) * (y / z)) + ((t / z) * (0.3333333333333333d0 / y)))
else
tmp = x + ((y - (t / y)) / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.9e+159) {
tmp = x + ((-0.3333333333333333 * (y / z)) + ((t / z) * (0.3333333333333333 / y)));
} else {
tmp = x + ((y - (t / y)) / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.9e+159: tmp = x + ((-0.3333333333333333 * (y / z)) + ((t / z) * (0.3333333333333333 / y))) else: tmp = x + ((y - (t / y)) / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.9e+159) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * Float64(y / z)) + Float64(Float64(t / z) * Float64(0.3333333333333333 / y)))); else tmp = Float64(x + Float64(Float64(y - Float64(t / y)) / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.9e+159) tmp = x + ((-0.3333333333333333 * (y / z)) + ((t / z) * (0.3333333333333333 / y))); else tmp = x + ((y - (t / y)) / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.9e+159], N[(x + N[(N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.9 \cdot 10^{+159}:\\
\;\;\;\;x + \left(-0.3333333333333333 \cdot \frac{y}{z} + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - \frac{t}{y}}{z \cdot -3}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= y -1e-74) (not (<= y 1e-38))) (+ x (* (- y (/ t y)) (/ -0.3333333333333333 z))) (+ x (/ (/ t z) (* y 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-74) || !(y <= 1e-38)) {
tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z));
} else {
tmp = x + ((t / z) / (y * 3.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 ((y <= (-1d-74)) .or. (.not. (y <= 1d-38))) then
tmp = x + ((y - (t / y)) * ((-0.3333333333333333d0) / z))
else
tmp = x + ((t / z) / (y * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-74) || !(y <= 1e-38)) {
tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z));
} else {
tmp = x + ((t / z) / (y * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1e-74) or not (y <= 1e-38): tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)) else: tmp = x + ((t / z) / (y * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1e-74) || !(y <= 1e-38)) tmp = Float64(x + Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(t / z) / Float64(y * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1e-74) || ~((y <= 1e-38))) tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)); else tmp = x + ((t / z) / (y * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e-74], N[Not[LessEqual[y, 1e-38]], $MachinePrecision]], N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-74} \lor \neg \left(y \leq 10^{-38}\right):\\
\;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z}}{y \cdot 3}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= y -3e-73) (not (<= y 3.9e-224))) (+ x (/ (- y (/ t y)) (* z -3.0))) (+ x (/ (/ t z) (* y 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3e-73) || !(y <= 3.9e-224)) {
tmp = x + ((y - (t / y)) / (z * -3.0));
} else {
tmp = x + ((t / z) / (y * 3.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 ((y <= (-3d-73)) .or. (.not. (y <= 3.9d-224))) then
tmp = x + ((y - (t / y)) / (z * (-3.0d0)))
else
tmp = x + ((t / z) / (y * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3e-73) || !(y <= 3.9e-224)) {
tmp = x + ((y - (t / y)) / (z * -3.0));
} else {
tmp = x + ((t / z) / (y * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3e-73) or not (y <= 3.9e-224): tmp = x + ((y - (t / y)) / (z * -3.0)) else: tmp = x + ((t / z) / (y * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3e-73) || !(y <= 3.9e-224)) tmp = Float64(x + Float64(Float64(y - Float64(t / y)) / Float64(z * -3.0))); else tmp = Float64(x + Float64(Float64(t / z) / Float64(y * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3e-73) || ~((y <= 3.9e-224))) tmp = x + ((y - (t / y)) / (z * -3.0)); else tmp = x + ((t / z) / (y * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3e-73], N[Not[LessEqual[y, 3.9e-224]], $MachinePrecision]], N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-73} \lor \neg \left(y \leq 3.9 \cdot 10^{-224}\right):\\
\;\;\;\;x + \frac{y - \frac{t}{y}}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z}}{y \cdot 3}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(if (<= y -1.1e-26)
(+ x (/ (/ y -3.0) z))
(if (<= y 1.36e+69)
(+ x (* (/ t z) (/ 0.3333333333333333 y)))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e-26) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 1.36e+69) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + (y / (z * -3.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 (y <= (-1.1d-26)) then
tmp = x + ((y / (-3.0d0)) / z)
else if (y <= 1.36d+69) then
tmp = x + ((t / z) * (0.3333333333333333d0 / y))
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e-26) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 1.36e+69) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e-26: tmp = x + ((y / -3.0) / z) elif y <= 1.36e+69: tmp = x + ((t / z) * (0.3333333333333333 / y)) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e-26) tmp = Float64(x + Float64(Float64(y / -3.0) / z)); elseif (y <= 1.36e+69) tmp = Float64(x + Float64(Float64(t / z) * Float64(0.3333333333333333 / y))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.1e-26) tmp = x + ((y / -3.0) / z); elseif (y <= 1.36e+69) tmp = x + ((t / z) * (0.3333333333333333 / y)); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e-26], N[(x + N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.36e+69], N[(x + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-26}:\\
\;\;\;\;x + \frac{\frac{y}{-3}}{z}\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{+69}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(if (<= y -1.4e-26)
(+ x (/ 1.0 (* z (/ -3.0 y))))
(if (<= y 1.55e+69)
(+ x (* (/ t z) (/ 0.3333333333333333 y)))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-26) {
tmp = x + (1.0 / (z * (-3.0 / y)));
} else if (y <= 1.55e+69) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + (y / (z * -3.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 (y <= (-1.4d-26)) then
tmp = x + (1.0d0 / (z * ((-3.0d0) / y)))
else if (y <= 1.55d+69) then
tmp = x + ((t / z) * (0.3333333333333333d0 / y))
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-26) {
tmp = x + (1.0 / (z * (-3.0 / y)));
} else if (y <= 1.55e+69) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.4e-26: tmp = x + (1.0 / (z * (-3.0 / y))) elif y <= 1.55e+69: tmp = x + ((t / z) * (0.3333333333333333 / y)) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e-26) tmp = Float64(x + Float64(1.0 / Float64(z * Float64(-3.0 / y)))); elseif (y <= 1.55e+69) tmp = Float64(x + Float64(Float64(t / z) * Float64(0.3333333333333333 / y))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.4e-26) tmp = x + (1.0 / (z * (-3.0 / y))); elseif (y <= 1.55e+69) tmp = x + ((t / z) * (0.3333333333333333 / y)); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e-26], N[(x + N[(1.0 / N[(z * N[(-3.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e+69], N[(x + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-26}:\\
\;\;\;\;x + \frac{1}{z \cdot \frac{-3}{y}}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+69}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= y -1.4e-26) (+ x (/ 1.0 (* z (/ -3.0 y)))) (if (<= y 3.8e+69) (+ x (/ (/ t z) (* y 3.0))) (+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-26) {
tmp = x + (1.0 / (z * (-3.0 / y)));
} else if (y <= 3.8e+69) {
tmp = x + ((t / z) / (y * 3.0));
} else {
tmp = x + (y / (z * -3.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 (y <= (-1.4d-26)) then
tmp = x + (1.0d0 / (z * ((-3.0d0) / y)))
else if (y <= 3.8d+69) then
tmp = x + ((t / z) / (y * 3.0d0))
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-26) {
tmp = x + (1.0 / (z * (-3.0 / y)));
} else if (y <= 3.8e+69) {
tmp = x + ((t / z) / (y * 3.0));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.4e-26: tmp = x + (1.0 / (z * (-3.0 / y))) elif y <= 3.8e+69: tmp = x + ((t / z) / (y * 3.0)) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e-26) tmp = Float64(x + Float64(1.0 / Float64(z * Float64(-3.0 / y)))); elseif (y <= 3.8e+69) tmp = Float64(x + Float64(Float64(t / z) / Float64(y * 3.0))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.4e-26) tmp = x + (1.0 / (z * (-3.0 / y))); elseif (y <= 3.8e+69) tmp = x + ((t / z) / (y * 3.0)); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e-26], N[(x + N[(1.0 / N[(z * N[(-3.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+69], N[(x + N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-26}:\\
\;\;\;\;x + \frac{1}{z \cdot \frac{-3}{y}}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+69}:\\
\;\;\;\;x + \frac{\frac{t}{z}}{y \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* y (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + (y * (-0.3333333333333333 / 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 * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (y * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + (y * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(y * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + (y * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{-0.3333333333333333}{z}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return x + (y / (z * -3.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 = x + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
def code(x, y, z, t): return x + (y / (z * -3.0))
function code(x, y, z, t) return Float64(x + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = x + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z \cdot -3}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (/ (/ y -3.0) z)))
double code(double x, double y, double z, double t) {
return x + ((y / -3.0) / 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 / (-3.0d0)) / z)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y / -3.0) / z);
}
def code(x, y, z, t): return x + ((y / -3.0) / z)
function code(x, y, z, t) return Float64(x + Float64(Float64(y / -3.0) / z)) end
function tmp = code(x, y, z, t) tmp = x + ((y / -3.0) / z); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{y}{-3}}{z}
\end{array}
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / 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 = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024010
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))