
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.6e-50) (not (<= a 6e-84))) (fma (/ (- t z) (- a t)) y (+ y x)) (+ x (/ -1.0 (* (/ 1.0 (- a z)) (/ t y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e-50) || !(a <= 6e-84)) {
tmp = fma(((t - z) / (a - t)), y, (y + x));
} else {
tmp = x + (-1.0 / ((1.0 / (a - z)) * (t / y)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.6e-50) || !(a <= 6e-84)) tmp = fma(Float64(Float64(t - z) / Float64(a - t)), y, Float64(y + x)); else tmp = Float64(x + Float64(-1.0 / Float64(Float64(1.0 / Float64(a - z)) * Float64(t / y)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.6e-50], N[Not[LessEqual[a, 6e-84]], $MachinePrecision]], N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + N[(y + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 / N[(N[(1.0 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{-50} \lor \neg \left(a \leq 6 \cdot 10^{-84}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a - t}, y, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{\frac{1}{a - z} \cdot \frac{t}{y}}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.75e-45) (not (<= a 8e-81))) (- (+ y x) (* y (/ z a))) (+ x (/ -1.0 (* (/ 1.0 (- a z)) (/ t y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.75e-45) || !(a <= 8e-81)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x + (-1.0 / ((1.0 / (a - z)) * (t / y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.75d-45)) .or. (.not. (a <= 8d-81))) then
tmp = (y + x) - (y * (z / a))
else
tmp = x + ((-1.0d0) / ((1.0d0 / (a - z)) * (t / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.75e-45) || !(a <= 8e-81)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x + (-1.0 / ((1.0 / (a - z)) * (t / y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.75e-45) or not (a <= 8e-81): tmp = (y + x) - (y * (z / a)) else: tmp = x + (-1.0 / ((1.0 / (a - z)) * (t / y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.75e-45) || !(a <= 8e-81)) tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(-1.0 / Float64(Float64(1.0 / Float64(a - z)) * Float64(t / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.75e-45) || ~((a <= 8e-81))) tmp = (y + x) - (y * (z / a)); else tmp = x + (-1.0 / ((1.0 / (a - z)) * (t / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.75e-45], N[Not[LessEqual[a, 8e-81]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 / N[(N[(1.0 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.75 \cdot 10^{-45} \lor \neg \left(a \leq 8 \cdot 10^{-81}\right):\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{\frac{1}{a - z} \cdot \frac{t}{y}}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8e-51) (not (<= a 7.5e-81))) (+ (+ y x) (* y (/ (- t z) (- a t)))) (+ x (/ -1.0 (* (/ 1.0 (- a z)) (/ t y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8e-51) || !(a <= 7.5e-81)) {
tmp = (y + x) + (y * ((t - z) / (a - t)));
} else {
tmp = x + (-1.0 / ((1.0 / (a - z)) * (t / y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-8d-51)) .or. (.not. (a <= 7.5d-81))) then
tmp = (y + x) + (y * ((t - z) / (a - t)))
else
tmp = x + ((-1.0d0) / ((1.0d0 / (a - z)) * (t / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8e-51) || !(a <= 7.5e-81)) {
tmp = (y + x) + (y * ((t - z) / (a - t)));
} else {
tmp = x + (-1.0 / ((1.0 / (a - z)) * (t / y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -8e-51) or not (a <= 7.5e-81): tmp = (y + x) + (y * ((t - z) / (a - t))) else: tmp = x + (-1.0 / ((1.0 / (a - z)) * (t / y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8e-51) || !(a <= 7.5e-81)) tmp = Float64(Float64(y + x) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); else tmp = Float64(x + Float64(-1.0 / Float64(Float64(1.0 / Float64(a - z)) * Float64(t / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -8e-51) || ~((a <= 7.5e-81))) tmp = (y + x) + (y * ((t - z) / (a - t))); else tmp = x + (-1.0 / ((1.0 / (a - z)) * (t / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8e-51], N[Not[LessEqual[a, 7.5e-81]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 / N[(N[(1.0 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-51} \lor \neg \left(a \leq 7.5 \cdot 10^{-81}\right):\\
\;\;\;\;\left(y + x\right) + y \cdot \frac{t - z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{\frac{1}{a - z} \cdot \frac{t}{y}}\\
\end{array}
\end{array}
(FPCore (x y z t a)
:precision binary64
(if (<= a -8e-104)
(+ y x)
(if (<= a -3.35e-289)
x
(if (<= a 2.6e-239)
(* z (/ y t))
(if (<= a 2.35e-216) x (if (<= a 5e-214) (* y (/ z t)) (+ y x)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8e-104) {
tmp = y + x;
} else if (a <= -3.35e-289) {
tmp = x;
} else if (a <= 2.6e-239) {
tmp = z * (y / t);
} else if (a <= 2.35e-216) {
tmp = x;
} else if (a <= 5e-214) {
tmp = y * (z / t);
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-8d-104)) then
tmp = y + x
else if (a <= (-3.35d-289)) then
tmp = x
else if (a <= 2.6d-239) then
tmp = z * (y / t)
else if (a <= 2.35d-216) then
tmp = x
else if (a <= 5d-214) then
tmp = y * (z / t)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8e-104) {
tmp = y + x;
} else if (a <= -3.35e-289) {
tmp = x;
} else if (a <= 2.6e-239) {
tmp = z * (y / t);
} else if (a <= 2.35e-216) {
tmp = x;
} else if (a <= 5e-214) {
tmp = y * (z / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8e-104: tmp = y + x elif a <= -3.35e-289: tmp = x elif a <= 2.6e-239: tmp = z * (y / t) elif a <= 2.35e-216: tmp = x elif a <= 5e-214: tmp = y * (z / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8e-104) tmp = Float64(y + x); elseif (a <= -3.35e-289) tmp = x; elseif (a <= 2.6e-239) tmp = Float64(z * Float64(y / t)); elseif (a <= 2.35e-216) tmp = x; elseif (a <= 5e-214) tmp = Float64(y * Float64(z / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8e-104) tmp = y + x; elseif (a <= -3.35e-289) tmp = x; elseif (a <= 2.6e-239) tmp = z * (y / t); elseif (a <= 2.35e-216) tmp = x; elseif (a <= 5e-214) tmp = y * (z / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8e-104], N[(y + x), $MachinePrecision], If[LessEqual[a, -3.35e-289], x, If[LessEqual[a, 2.6e-239], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.35e-216], x, If[LessEqual[a, 5e-214], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-104}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -3.35 \cdot 10^{-289}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-239}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-216}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-214}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.6e+60) (not (<= a 5.8e-69))) (+ y x) (- x (/ y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.6e+60) || !(a <= 5.8e-69)) {
tmp = y + x;
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-5.6d+60)) .or. (.not. (a <= 5.8d-69))) then
tmp = y + x
else
tmp = x - (y / (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.6e+60) || !(a <= 5.8e-69)) {
tmp = y + x;
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.6e+60) or not (a <= 5.8e-69): tmp = y + x else: tmp = x - (y / (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.6e+60) || !(a <= 5.8e-69)) tmp = Float64(y + x); else tmp = Float64(x - Float64(y / Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.6e+60) || ~((a <= 5.8e-69))) tmp = y + x; else tmp = x - (y / (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.6e+60], N[Not[LessEqual[a, 5.8e-69]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{+60} \lor \neg \left(a \leq 5.8 \cdot 10^{-69}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.5e-45) (not (<= a 8.2e-81))) (- (+ y x) (* y (/ z a))) (- x (/ y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.5e-45) || !(a <= 8.2e-81)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-4.5d-45)) .or. (.not. (a <= 8.2d-81))) then
tmp = (y + x) - (y * (z / a))
else
tmp = x - (y / (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.5e-45) || !(a <= 8.2e-81)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.5e-45) or not (a <= 8.2e-81): tmp = (y + x) - (y * (z / a)) else: tmp = x - (y / (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.5e-45) || !(a <= 8.2e-81)) tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); else tmp = Float64(x - Float64(y / Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.5e-45) || ~((a <= 8.2e-81))) tmp = (y + x) - (y * (z / a)); else tmp = x - (y / (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.5e-45], N[Not[LessEqual[a, 8.2e-81]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{-45} \lor \neg \left(a \leq 8.2 \cdot 10^{-81}\right):\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.9e-43) (not (<= a 2.4e-69))) (+ y x) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.9e-43) || !(a <= 2.4e-69)) {
tmp = y + x;
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.9d-43)) .or. (.not. (a <= 2.4d-69))) then
tmp = y + x
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.9e-43) || !(a <= 2.4e-69)) {
tmp = y + x;
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.9e-43) or not (a <= 2.4e-69): tmp = y + x else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.9e-43) || !(a <= 2.4e-69)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.9e-43) || ~((a <= 2.4e-69))) tmp = y + x; else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.9e-43], N[Not[LessEqual[a, 2.4e-69]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-43} \lor \neg \left(a \leq 2.4 \cdot 10^{-69}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8.5e-104) (not (<= a 1.9e-117))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e-104) || !(a <= 1.9e-117)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-8.5d-104)) .or. (.not. (a <= 1.9d-117))) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e-104) || !(a <= 1.9e-117)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -8.5e-104) or not (a <= 1.9e-117): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8.5e-104) || !(a <= 1.9e-117)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -8.5e-104) || ~((a <= 1.9e-117))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8.5e-104], N[Not[LessEqual[a, 1.9e-117]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-104} \lor \neg \left(a \leq 1.9 \cdot 10^{-117}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= z -8.2e+263) (* y (/ z t)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+263) {
tmp = y * (z / t);
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8.2d+263)) then
tmp = y * (z / t)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+263) {
tmp = y * (z / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.2e+263: tmp = y * (z / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.2e+263) tmp = Float64(y * Float64(z / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.2e+263) tmp = y * (z / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e+263], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+263}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= x -4e-151) x (if (<= x 1.5e-221) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4e-151) {
tmp = x;
} else if (x <= 1.5e-221) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-4d-151)) then
tmp = x
else if (x <= 1.5d-221) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4e-151) {
tmp = x;
} else if (x <= 1.5e-221) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4e-151: tmp = x elif x <= 1.5e-221: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4e-151) tmp = x; elseif (x <= 1.5e-221) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -4e-151) tmp = x; elseif (x <= 1.5e-221) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4e-151], x, If[LessEqual[x, 1.5e-221], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-151}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-221}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2024008
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))