
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
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 - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
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 - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (/ (- z x) (/ t y))))
double code(double x, double y, double z, double t) {
return x + ((z - x) / (t / 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 + ((z - x) / (t / y))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) / (t / y));
}
def code(x, y, z, t): return x + ((z - x) / (t / y))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) / Float64(t / y))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) / (t / y)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - x}{\frac{t}{y}}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ (- x) t))))
(if (<= t -2.1e+31)
x
(if (<= t -8.2e-131)
(* y (/ z t))
(if (<= t 1.55e-301)
t_1
(if (<= t 7.5e-268) (/ y (/ t z)) (if (<= t 5.8e-137) t_1 x)))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (-x / t);
double tmp;
if (t <= -2.1e+31) {
tmp = x;
} else if (t <= -8.2e-131) {
tmp = y * (z / t);
} else if (t <= 1.55e-301) {
tmp = t_1;
} else if (t <= 7.5e-268) {
tmp = y / (t / z);
} else if (t <= 5.8e-137) {
tmp = t_1;
} else {
tmp = x;
}
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 * (-x / t)
if (t <= (-2.1d+31)) then
tmp = x
else if (t <= (-8.2d-131)) then
tmp = y * (z / t)
else if (t <= 1.55d-301) then
tmp = t_1
else if (t <= 7.5d-268) then
tmp = y / (t / z)
else if (t <= 5.8d-137) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (-x / t);
double tmp;
if (t <= -2.1e+31) {
tmp = x;
} else if (t <= -8.2e-131) {
tmp = y * (z / t);
} else if (t <= 1.55e-301) {
tmp = t_1;
} else if (t <= 7.5e-268) {
tmp = y / (t / z);
} else if (t <= 5.8e-137) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (-x / t) tmp = 0 if t <= -2.1e+31: tmp = x elif t <= -8.2e-131: tmp = y * (z / t) elif t <= 1.55e-301: tmp = t_1 elif t <= 7.5e-268: tmp = y / (t / z) elif t <= 5.8e-137: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(Float64(-x) / t)) tmp = 0.0 if (t <= -2.1e+31) tmp = x; elseif (t <= -8.2e-131) tmp = Float64(y * Float64(z / t)); elseif (t <= 1.55e-301) tmp = t_1; elseif (t <= 7.5e-268) tmp = Float64(y / Float64(t / z)); elseif (t <= 5.8e-137) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (-x / t); tmp = 0.0; if (t <= -2.1e+31) tmp = x; elseif (t <= -8.2e-131) tmp = y * (z / t); elseif (t <= 1.55e-301) tmp = t_1; elseif (t <= 7.5e-268) tmp = y / (t / z); elseif (t <= 5.8e-137) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[((-x) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+31], x, If[LessEqual[t, -8.2e-131], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e-301], t$95$1, If[LessEqual[t, 7.5e-268], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e-137], t$95$1, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{-x}{t}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-131}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-301}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-268}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-137}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ y (/ (- t) x))))
(if (<= t -1e+32)
x
(if (<= t -8.2e-131)
(* y (/ z t))
(if (<= t 3.35e-301)
t_1
(if (<= t 4.2e-268) (/ y (/ t z)) (if (<= t 7.8e-135) t_1 x)))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (-t / x);
double tmp;
if (t <= -1e+32) {
tmp = x;
} else if (t <= -8.2e-131) {
tmp = y * (z / t);
} else if (t <= 3.35e-301) {
tmp = t_1;
} else if (t <= 4.2e-268) {
tmp = y / (t / z);
} else if (t <= 7.8e-135) {
tmp = t_1;
} else {
tmp = x;
}
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 / x)
if (t <= (-1d+32)) then
tmp = x
else if (t <= (-8.2d-131)) then
tmp = y * (z / t)
else if (t <= 3.35d-301) then
tmp = t_1
else if (t <= 4.2d-268) then
tmp = y / (t / z)
else if (t <= 7.8d-135) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y / (-t / x);
double tmp;
if (t <= -1e+32) {
tmp = x;
} else if (t <= -8.2e-131) {
tmp = y * (z / t);
} else if (t <= 3.35e-301) {
tmp = t_1;
} else if (t <= 4.2e-268) {
tmp = y / (t / z);
} else if (t <= 7.8e-135) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (-t / x) tmp = 0 if t <= -1e+32: tmp = x elif t <= -8.2e-131: tmp = y * (z / t) elif t <= 3.35e-301: tmp = t_1 elif t <= 4.2e-268: tmp = y / (t / z) elif t <= 7.8e-135: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(Float64(-t) / x)) tmp = 0.0 if (t <= -1e+32) tmp = x; elseif (t <= -8.2e-131) tmp = Float64(y * Float64(z / t)); elseif (t <= 3.35e-301) tmp = t_1; elseif (t <= 4.2e-268) tmp = Float64(y / Float64(t / z)); elseif (t <= 7.8e-135) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (-t / x); tmp = 0.0; if (t <= -1e+32) tmp = x; elseif (t <= -8.2e-131) tmp = y * (z / t); elseif (t <= 3.35e-301) tmp = t_1; elseif (t <= 4.2e-268) tmp = y / (t / z); elseif (t <= 7.8e-135) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[((-t) / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e+32], x, If[LessEqual[t, -8.2e-131], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.35e-301], t$95$1, If[LessEqual[t, 4.2e-268], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.8e-135], t$95$1, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{-t}{x}}\\
\mathbf{if}\;t \leq -1 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-131}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 3.35 \cdot 10^{-301}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-268}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-135}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(if (<= t -8.5e+30)
x
(if (<= t -2.6e-130)
(* y (/ z t))
(if (<= t 2.6e-302)
(/ y (/ (- t) x))
(if (<= t 4e-268)
(/ y (/ t z))
(if (<= t 3.9e-134) (/ (* x y) (- t)) x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.5e+30) {
tmp = x;
} else if (t <= -2.6e-130) {
tmp = y * (z / t);
} else if (t <= 2.6e-302) {
tmp = y / (-t / x);
} else if (t <= 4e-268) {
tmp = y / (t / z);
} else if (t <= 3.9e-134) {
tmp = (x * y) / -t;
} else {
tmp = x;
}
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 <= (-8.5d+30)) then
tmp = x
else if (t <= (-2.6d-130)) then
tmp = y * (z / t)
else if (t <= 2.6d-302) then
tmp = y / (-t / x)
else if (t <= 4d-268) then
tmp = y / (t / z)
else if (t <= 3.9d-134) then
tmp = (x * y) / -t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.5e+30) {
tmp = x;
} else if (t <= -2.6e-130) {
tmp = y * (z / t);
} else if (t <= 2.6e-302) {
tmp = y / (-t / x);
} else if (t <= 4e-268) {
tmp = y / (t / z);
} else if (t <= 3.9e-134) {
tmp = (x * y) / -t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8.5e+30: tmp = x elif t <= -2.6e-130: tmp = y * (z / t) elif t <= 2.6e-302: tmp = y / (-t / x) elif t <= 4e-268: tmp = y / (t / z) elif t <= 3.9e-134: tmp = (x * y) / -t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8.5e+30) tmp = x; elseif (t <= -2.6e-130) tmp = Float64(y * Float64(z / t)); elseif (t <= 2.6e-302) tmp = Float64(y / Float64(Float64(-t) / x)); elseif (t <= 4e-268) tmp = Float64(y / Float64(t / z)); elseif (t <= 3.9e-134) tmp = Float64(Float64(x * y) / Float64(-t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -8.5e+30) tmp = x; elseif (t <= -2.6e-130) tmp = y * (z / t); elseif (t <= 2.6e-302) tmp = y / (-t / x); elseif (t <= 4e-268) tmp = y / (t / z); elseif (t <= 3.9e-134) tmp = (x * y) / -t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8.5e+30], x, If[LessEqual[t, -2.6e-130], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e-302], N[(y / N[((-t) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-268], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.9e-134], N[(N[(x * y), $MachinePrecision] / (-t)), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+30}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-130}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-302}:\\
\;\;\;\;\frac{y}{\frac{-t}{x}}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-268}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-134}:\\
\;\;\;\;\frac{x \cdot y}{-t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= x -4e-93) (not (<= x 2.15e-165))) (* x (- 1.0 (/ y t))) (* y (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4e-93) || !(x <= 2.15e-165)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * (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 ((x <= (-4d-93)) .or. (.not. (x <= 2.15d-165))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = y * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4e-93) || !(x <= 2.15e-165)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4e-93) or not (x <= 2.15e-165): tmp = x * (1.0 - (y / t)) else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4e-93) || !(x <= 2.15e-165)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4e-93) || ~((x <= 2.15e-165))) tmp = x * (1.0 - (y / t)); else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4e-93], N[Not[LessEqual[x, 2.15e-165]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-93} \lor \neg \left(x \leq 2.15 \cdot 10^{-165}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= x -5e-80) (not (<= x 1.55e-154))) (* x (- 1.0 (/ y t))) (* y (/ (- z x) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5e-80) || !(x <= 1.55e-154)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * ((z - x) / 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 ((x <= (-5d-80)) .or. (.not. (x <= 1.55d-154))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = y * ((z - x) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5e-80) || !(x <= 1.55e-154)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * ((z - x) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5e-80) or not (x <= 1.55e-154): tmp = x * (1.0 - (y / t)) else: tmp = y * ((z - x) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5e-80) || !(x <= 1.55e-154)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(y * Float64(Float64(z - x) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5e-80) || ~((x <= 1.55e-154))) tmp = x * (1.0 - (y / t)); else tmp = y * ((z - x) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5e-80], N[Not[LessEqual[x, 1.55e-154]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-80} \lor \neg \left(x \leq 1.55 \cdot 10^{-154}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.8e-18) (not (<= x 6e+134))) (* x (- 1.0 (/ y t))) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.8e-18) || !(x <= 6e+134)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z * (y / 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 ((x <= (-5.8d-18)) .or. (.not. (x <= 6d+134))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + (z * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.8e-18) || !(x <= 6e+134)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.8e-18) or not (x <= 6e+134): tmp = x * (1.0 - (y / t)) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.8e-18) || !(x <= 6e+134)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.8e-18) || ~((x <= 6e+134))) tmp = x * (1.0 - (y / t)); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.8e-18], N[Not[LessEqual[x, 6e+134]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-18} \lor \neg \left(x \leq 6 \cdot 10^{+134}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= x -6.6e-93) x (if (<= x 1.4e-150) (* y (/ z t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.6e-93) {
tmp = x;
} else if (x <= 1.4e-150) {
tmp = y * (z / t);
} else {
tmp = x;
}
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 <= (-6.6d-93)) then
tmp = x
else if (x <= 1.4d-150) then
tmp = y * (z / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.6e-93) {
tmp = x;
} else if (x <= 1.4e-150) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.6e-93: tmp = x elif x <= 1.4e-150: tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.6e-93) tmp = x; elseif (x <= 1.4e-150) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.6e-93) tmp = x; elseif (x <= 1.4e-150) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.6e-93], x, If[LessEqual[x, 1.4e-150], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-93}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-150}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
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 + ((z - x) * (y / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
def code(x, y, z, t): return x + ((z - x) * (y / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) * Float64(y / t))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) * (y / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - x\right) \cdot \frac{y}{t}
\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 (+ (* x (/ y t)) (* (- z) (/ y t)))))
double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
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 - ((x * (y / t)) + (-z * (y / t)))
end function
public static double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
def code(x, y, z, t): return x - ((x * (y / t)) + (-z * (y / t)))
function code(x, y, z, t) return Float64(x - Float64(Float64(x * Float64(y / t)) + Float64(Float64(-z) * Float64(y / t)))) end
function tmp = code(x, y, z, t) tmp = x - ((x * (y / t)) + (-z * (y / t))); end
code[x_, y_, z_, t_] := N[(x - N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)
\end{array}
herbie shell --seed 2023350
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))