
(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 10 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
(let* ((t_1 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (or (<= t_1 -1e-240) (not (<= t_1 0.0)))
(+ x (* y (+ (/ (- t z) (- a t)) 1.0)))
(+ x (/ (* y (- z a)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -1e-240) || !(t_1 <= 0.0)) {
tmp = x + (y * (((t - z) / (a - t)) + 1.0));
} else {
tmp = x + ((y * (z - a)) / t);
}
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) :: tmp
t_1 = (x + y) - ((y * (z - t)) / (a - t))
if ((t_1 <= (-1d-240)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = x + (y * (((t - z) / (a - t)) + 1.0d0))
else
tmp = x + ((y * (z - a)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -1e-240) || !(t_1 <= 0.0)) {
tmp = x + (y * (((t - z) / (a - t)) + 1.0));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - ((y * (z - t)) / (a - t)) tmp = 0 if (t_1 <= -1e-240) or not (t_1 <= 0.0): tmp = x + (y * (((t - z) / (a - t)) + 1.0)) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -1e-240) || !(t_1 <= 0.0)) tmp = Float64(x + Float64(y * Float64(Float64(Float64(t - z) / Float64(a - t)) + 1.0))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - ((y * (z - t)) / (a - t)); tmp = 0.0; if ((t_1 <= -1e-240) || ~((t_1 <= 0.0))) tmp = x + (y * (((t - z) / (a - t)) + 1.0)); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-240], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(x + N[(y * N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-240} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;x + y \cdot \left(\frac{t - z}{a - t} + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.9e+88)
(+ x y)
(if (<= a -5e-215)
(+ x (/ (* y (- z a)) t))
(if (<= a 2.7e+29)
(+ x (* z (/ y t)))
(if (<= a 2.8e+46) (/ (* y (- z)) (- a t)) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.9e+88) {
tmp = x + y;
} else if (a <= -5e-215) {
tmp = x + ((y * (z - a)) / t);
} else if (a <= 2.7e+29) {
tmp = x + (z * (y / t));
} else if (a <= 2.8e+46) {
tmp = (y * -z) / (a - t);
} else {
tmp = x + 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 <= (-1.9d+88)) then
tmp = x + y
else if (a <= (-5d-215)) then
tmp = x + ((y * (z - a)) / t)
else if (a <= 2.7d+29) then
tmp = x + (z * (y / t))
else if (a <= 2.8d+46) then
tmp = (y * -z) / (a - t)
else
tmp = x + 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 <= -1.9e+88) {
tmp = x + y;
} else if (a <= -5e-215) {
tmp = x + ((y * (z - a)) / t);
} else if (a <= 2.7e+29) {
tmp = x + (z * (y / t));
} else if (a <= 2.8e+46) {
tmp = (y * -z) / (a - t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.9e+88: tmp = x + y elif a <= -5e-215: tmp = x + ((y * (z - a)) / t) elif a <= 2.7e+29: tmp = x + (z * (y / t)) elif a <= 2.8e+46: tmp = (y * -z) / (a - t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.9e+88) tmp = Float64(x + y); elseif (a <= -5e-215) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); elseif (a <= 2.7e+29) tmp = Float64(x + Float64(z * Float64(y / t))); elseif (a <= 2.8e+46) tmp = Float64(Float64(y * Float64(-z)) / Float64(a - t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.9e+88) tmp = x + y; elseif (a <= -5e-215) tmp = x + ((y * (z - a)) / t); elseif (a <= 2.7e+29) tmp = x + (z * (y / t)); elseif (a <= 2.8e+46) tmp = (y * -z) / (a - t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.9e+88], N[(x + y), $MachinePrecision], If[LessEqual[a, -5e-215], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e+29], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e+46], N[(N[(y * (-z)), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+88}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -5 \cdot 10^{-215}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+29}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+46}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.6e+89)
(+ x y)
(if (<= a -1.5e-55)
x
(if (<= a -1.52e-58)
(- y (/ y (/ a z)))
(if (<= a 5.4e+46) (+ x (* z (/ y t))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.6e+89) {
tmp = x + y;
} else if (a <= -1.5e-55) {
tmp = x;
} else if (a <= -1.52e-58) {
tmp = y - (y / (a / z));
} else if (a <= 5.4e+46) {
tmp = x + (z * (y / t));
} else {
tmp = x + 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 <= (-1.6d+89)) then
tmp = x + y
else if (a <= (-1.5d-55)) then
tmp = x
else if (a <= (-1.52d-58)) then
tmp = y - (y / (a / z))
else if (a <= 5.4d+46) then
tmp = x + (z * (y / t))
else
tmp = x + 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 <= -1.6e+89) {
tmp = x + y;
} else if (a <= -1.5e-55) {
tmp = x;
} else if (a <= -1.52e-58) {
tmp = y - (y / (a / z));
} else if (a <= 5.4e+46) {
tmp = x + (z * (y / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.6e+89: tmp = x + y elif a <= -1.5e-55: tmp = x elif a <= -1.52e-58: tmp = y - (y / (a / z)) elif a <= 5.4e+46: tmp = x + (z * (y / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.6e+89) tmp = Float64(x + y); elseif (a <= -1.5e-55) tmp = x; elseif (a <= -1.52e-58) tmp = Float64(y - Float64(y / Float64(a / z))); elseif (a <= 5.4e+46) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.6e+89) tmp = x + y; elseif (a <= -1.5e-55) tmp = x; elseif (a <= -1.52e-58) tmp = y - (y / (a / z)); elseif (a <= 5.4e+46) tmp = x + (z * (y / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.6e+89], N[(x + y), $MachinePrecision], If[LessEqual[a, -1.5e-55], x, If[LessEqual[a, -1.52e-58], N[(y - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.4e+46], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+89}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -1.5 \cdot 10^{-55}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.52 \cdot 10^{-58}:\\
\;\;\;\;y - \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{+46}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.2e+88) (not (<= a 3.7e-50))) (+ x y) (+ x (* y (/ (- z a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e+88) || !(a <= 3.7e-50)) {
tmp = x + y;
} else {
tmp = x + (y * ((z - a) / t));
}
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.2d+88)) .or. (.not. (a <= 3.7d-50))) then
tmp = x + y
else
tmp = x + (y * ((z - a) / t))
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.2e+88) || !(a <= 3.7e-50)) {
tmp = x + y;
} else {
tmp = x + (y * ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.2e+88) or not (a <= 3.7e-50): tmp = x + y else: tmp = x + (y * ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.2e+88) || !(a <= 3.7e-50)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.2e+88) || ~((a <= 3.7e-50))) tmp = x + y; else tmp = x + (y * ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.2e+88], N[Not[LessEqual[a, 3.7e-50]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{+88} \lor \neg \left(a \leq 3.7 \cdot 10^{-50}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7e-8) (not (<= t 660000000000.0))) (+ x (* y (/ (- z a) t))) (- (+ x y) (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e-8) || !(t <= 660000000000.0)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) - (y / (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 ((t <= (-7d-8)) .or. (.not. (t <= 660000000000.0d0))) then
tmp = x + (y * ((z - a) / t))
else
tmp = (x + y) - (y / (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 ((t <= -7e-8) || !(t <= 660000000000.0)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7e-8) or not (t <= 660000000000.0): tmp = x + (y * ((z - a) / t)) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7e-8) || !(t <= 660000000000.0)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7e-8) || ~((t <= 660000000000.0))) tmp = x + (y * ((z - a) / t)); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7e-8], N[Not[LessEqual[t, 660000000000.0]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-8} \lor \neg \left(t \leq 660000000000\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.6e+89) (not (<= a 8.5e+46))) (- (+ x y) (/ y (/ a z))) (- x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e+89) || !(a <= 8.5e+46)) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x - (y * (z / (a - t)));
}
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.6d+89)) .or. (.not. (a <= 8.5d+46))) then
tmp = (x + y) - (y / (a / z))
else
tmp = x - (y * (z / (a - t)))
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.6e+89) || !(a <= 8.5e+46)) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x - (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.6e+89) or not (a <= 8.5e+46): tmp = (x + y) - (y / (a / z)) else: tmp = x - (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.6e+89) || !(a <= 8.5e+46)) tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); else tmp = Float64(x - Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.6e+89) || ~((a <= 8.5e+46))) tmp = (x + y) - (y / (a / z)); else tmp = x - (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.6e+89], N[Not[LessEqual[a, 8.5e+46]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+89} \lor \neg \left(a \leq 8.5 \cdot 10^{+46}\right):\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t -38.0) (+ x (/ y (/ (- t) (- a z)))) (if (<= t 3.4e+21) (- (+ x y) (/ y (/ a z))) (+ x (* y (/ (- z a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -38.0) {
tmp = x + (y / (-t / (a - z)));
} else if (t <= 3.4e+21) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x + (y * ((z - a) / t));
}
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 (t <= (-38.0d0)) then
tmp = x + (y / (-t / (a - z)))
else if (t <= 3.4d+21) then
tmp = (x + y) - (y / (a / z))
else
tmp = x + (y * ((z - a) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -38.0) {
tmp = x + (y / (-t / (a - z)));
} else if (t <= 3.4e+21) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x + (y * ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -38.0: tmp = x + (y / (-t / (a - z))) elif t <= 3.4e+21: tmp = (x + y) - (y / (a / z)) else: tmp = x + (y * ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -38.0) tmp = Float64(x + Float64(y / Float64(Float64(-t) / Float64(a - z)))); elseif (t <= 3.4e+21) tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); else tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -38.0) tmp = x + (y / (-t / (a - z))); elseif (t <= 3.4e+21) tmp = (x + y) - (y / (a / z)); else tmp = x + (y * ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -38.0], N[(x + N[(y / N[((-t) / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+21], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -38:\\
\;\;\;\;x + \frac{y}{\frac{-t}{a - z}}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+21}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.2e+88) (not (<= a 4.2e+46))) (+ x y) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.2e+88) || !(a <= 4.2e+46)) {
tmp = x + y;
} else {
tmp = x + (z * (y / t));
}
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 <= (-3.2d+88)) .or. (.not. (a <= 4.2d+46))) then
tmp = x + y
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 a) {
double tmp;
if ((a <= -3.2e+88) || !(a <= 4.2e+46)) {
tmp = x + y;
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.2e+88) or not (a <= 4.2e+46): tmp = x + y else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.2e+88) || !(a <= 4.2e+46)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.2e+88) || ~((a <= 4.2e+46))) tmp = x + y; else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.2e+88], N[Not[LessEqual[a, 4.2e+46]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+88} \lor \neg \left(a \leq 4.2 \cdot 10^{+46}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.5e+88) (not (<= a 3e-50))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.5e+88) || !(a <= 3e-50)) {
tmp = x + 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 ((a <= (-5.5d+88)) .or. (.not. (a <= 3d-50))) then
tmp = x + 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 ((a <= -5.5e+88) || !(a <= 3e-50)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.5e+88) or not (a <= 3e-50): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.5e+88) || !(a <= 3e-50)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.5e+88) || ~((a <= 3e-50))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.5e+88], N[Not[LessEqual[a, 3e-50]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+88} \lor \neg \left(a \leq 3 \cdot 10^{-50}\right):\\
\;\;\;\;x + 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 2023343
(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))))