
(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 13 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 (- t z)) (- a t)))))
(if (<= t_1 -4e-271)
(+ x (+ y (/ (- t z) (/ (- a t) y))))
(if (<= t_1 0.0)
(+ x (* y (- (/ z t) (/ a t))))
(+ x (fma (/ (- t z) (- a t)) y y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_1 <= -4e-271) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else if (t_1 <= 0.0) {
tmp = x + (y * ((z / t) - (a / t)));
} else {
tmp = x + fma(((t - z) / (a - t)), y, y);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if (t_1 <= -4e-271) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); elseif (t_1 <= 0.0) tmp = Float64(x + Float64(y * Float64(Float64(z / t) - Float64(a / t)))); else tmp = Float64(x + fma(Float64(Float64(t - z) / Float64(a - t)), y, y)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-271], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(x + N[(y * N[(N[(z / t), $MachinePrecision] - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{-271}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;x + y \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(\frac{t - z}{a - t}, y, y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999985e-271Initial program 84.5%
associate--l+84.5%
associate-/l*94.5%
Simplified94.5%
if -3.99999999999999985e-271 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.5%
associate--l+37.2%
associate-/l*28.1%
Simplified28.1%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
associate-/l*99.7%
mul-1-neg99.7%
remove-double-neg99.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around 0 99.9%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 83.7%
associate--l+83.7%
sub-neg83.7%
+-commutative83.7%
associate-/l*95.1%
distribute-neg-frac95.1%
associate-/r/95.5%
fma-def95.5%
sub-neg95.5%
+-commutative95.5%
distribute-neg-in95.5%
unsub-neg95.5%
remove-double-neg95.5%
Simplified95.5%
Final simplification95.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (or (<= t_1 -4e-271) (not (<= t_1 0.0)))
(+ x (+ y (/ (- t z) (/ (- a t) y))))
(+ x (* y (- (/ z t) (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -4e-271) || !(t_1 <= 0.0)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x + (y * ((z / t) - (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 * (t - z)) / (a - t))
if ((t_1 <= (-4d-271)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else
tmp = x + (y * ((z / t) - (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 * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -4e-271) || !(t_1 <= 0.0)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x + (y * ((z / t) - (a / t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if (t_1 <= -4e-271) or not (t_1 <= 0.0): tmp = x + (y + ((t - z) / ((a - t) / y))) else: tmp = x + (y * ((z / t) - (a / t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -4e-271) || !(t_1 <= 0.0)) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); else tmp = Float64(x + Float64(y * Float64(Float64(z / t) - Float64(a / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if ((t_1 <= -4e-271) || ~((t_1 <= 0.0))) tmp = x + (y + ((t - z) / ((a - t) / y))); else tmp = x + (y * ((z / t) - (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[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e-271], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z / t), $MachinePrecision] - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{-271} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999985e-271 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 84.1%
associate--l+84.1%
associate-/l*94.8%
Simplified94.8%
if -3.99999999999999985e-271 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.5%
associate--l+37.2%
associate-/l*28.1%
Simplified28.1%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
associate-/l*99.7%
mul-1-neg99.7%
remove-double-neg99.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around 0 99.9%
Final simplification95.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7e-56) (not (<= a 8.6e-63))) (+ x (- y (/ y (/ (- a t) z)))) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7e-56) || !(a <= 8.6e-63)) {
tmp = x + (y - (y / ((a - t) / 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 <= (-7d-56)) .or. (.not. (a <= 8.6d-63))) then
tmp = x + (y - (y / ((a - t) / 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 <= -7e-56) || !(a <= 8.6e-63)) {
tmp = x + (y - (y / ((a - t) / z)));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7e-56) or not (a <= 8.6e-63): tmp = x + (y - (y / ((a - t) / z))) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7e-56) || !(a <= 8.6e-63)) tmp = Float64(x + Float64(y - Float64(y / Float64(Float64(a - t) / z)))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7e-56) || ~((a <= 8.6e-63))) tmp = x + (y - (y / ((a - t) / z))); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7e-56], N[Not[LessEqual[a, 8.6e-63]], $MachinePrecision]], N[(x + N[(y - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{-56} \lor \neg \left(a \leq 8.6 \cdot 10^{-63}\right):\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a - t}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -6.9999999999999996e-56 or 8.5999999999999997e-63 < a Initial program 78.9%
associate--l+79.5%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in z around inf 81.7%
associate-/l*91.6%
Simplified91.6%
if -6.9999999999999996e-56 < a < 8.5999999999999997e-63Initial program 76.2%
associate--l+81.8%
associate-/l*83.8%
Simplified83.8%
Taylor expanded in t around -inf 87.8%
+-commutative87.8%
sub-neg87.8%
mul-1-neg87.8%
mul-1-neg87.8%
unsub-neg87.8%
mul-1-neg87.8%
sub-neg87.8%
distribute-lft-out--87.9%
Simplified87.9%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.1e+90) (not (<= t 3.1e+106))) (+ x (* y (- (/ z t) (/ a t)))) (+ x (- y (/ y (/ (- a t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.1e+90) || !(t <= 3.1e+106)) {
tmp = x + (y * ((z / t) - (a / t)));
} else {
tmp = x + (y - (y / ((a - 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 ((t <= (-2.1d+90)) .or. (.not. (t <= 3.1d+106))) then
tmp = x + (y * ((z / t) - (a / t)))
else
tmp = x + (y - (y / ((a - 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 ((t <= -2.1e+90) || !(t <= 3.1e+106)) {
tmp = x + (y * ((z / t) - (a / t)));
} else {
tmp = x + (y - (y / ((a - t) / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.1e+90) or not (t <= 3.1e+106): tmp = x + (y * ((z / t) - (a / t))) else: tmp = x + (y - (y / ((a - t) / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.1e+90) || !(t <= 3.1e+106)) tmp = Float64(x + Float64(y * Float64(Float64(z / t) - Float64(a / t)))); else tmp = Float64(x + Float64(y - Float64(y / Float64(Float64(a - t) / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.1e+90) || ~((t <= 3.1e+106))) tmp = x + (y * ((z / t) - (a / t))); else tmp = x + (y - (y / ((a - t) / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.1e+90], N[Not[LessEqual[t, 3.1e+106]], $MachinePrecision]], N[(x + N[(y * N[(N[(z / t), $MachinePrecision] - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+90} \lor \neg \left(t \leq 3.1 \cdot 10^{+106}\right):\\
\;\;\;\;x + y \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a - t}{z}}\right)\\
\end{array}
\end{array}
if t < -2.09999999999999981e90 or 3.0999999999999999e106 < t Initial program 55.1%
associate--l+61.1%
associate-/l*78.6%
Simplified78.6%
Taylor expanded in t around inf 76.0%
sub-neg76.0%
+-commutative76.0%
mul-1-neg76.0%
unsub-neg76.0%
associate-/l*83.5%
mul-1-neg83.5%
remove-double-neg83.5%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in y around 0 90.9%
if -2.09999999999999981e90 < t < 3.0999999999999999e106Initial program 87.8%
associate--l+88.9%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 87.8%
associate-/l*91.3%
Simplified91.3%
Final simplification91.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.35e+57)
(+ x y)
(if (<= a 1.48e-37)
(+ x (/ y (/ t z)))
(if (<= a 52.0) (- y (/ z (/ a y))) (if (<= a 9e+107) x (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.35e+57) {
tmp = x + y;
} else if (a <= 1.48e-37) {
tmp = x + (y / (t / z));
} else if (a <= 52.0) {
tmp = y - (z / (a / y));
} else if (a <= 9e+107) {
tmp = x;
} 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.35d+57)) then
tmp = x + y
else if (a <= 1.48d-37) then
tmp = x + (y / (t / z))
else if (a <= 52.0d0) then
tmp = y - (z / (a / y))
else if (a <= 9d+107) then
tmp = x
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.35e+57) {
tmp = x + y;
} else if (a <= 1.48e-37) {
tmp = x + (y / (t / z));
} else if (a <= 52.0) {
tmp = y - (z / (a / y));
} else if (a <= 9e+107) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.35e+57: tmp = x + y elif a <= 1.48e-37: tmp = x + (y / (t / z)) elif a <= 52.0: tmp = y - (z / (a / y)) elif a <= 9e+107: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.35e+57) tmp = Float64(x + y); elseif (a <= 1.48e-37) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (a <= 52.0) tmp = Float64(y - Float64(z / Float64(a / y))); elseif (a <= 9e+107) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.35e+57) tmp = x + y; elseif (a <= 1.48e-37) tmp = x + (y / (t / z)); elseif (a <= 52.0) tmp = y - (z / (a / y)); elseif (a <= 9e+107) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.35e+57], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.48e-37], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 52.0], N[(y - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e+107], x, N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+57}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.48 \cdot 10^{-37}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;a \leq 52:\\
\;\;\;\;y - \frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+107}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.3499999999999999e57 or 9e107 < a Initial program 75.3%
associate--l+75.2%
sub-neg75.2%
+-commutative75.2%
associate-/l*94.0%
distribute-neg-frac94.0%
associate-/r/93.8%
fma-def93.8%
sub-neg93.8%
+-commutative93.8%
distribute-neg-in93.8%
unsub-neg93.8%
remove-double-neg93.8%
Simplified93.8%
Taylor expanded in a around inf 85.5%
if -1.3499999999999999e57 < a < 1.48e-37Initial program 78.0%
associate--l+82.3%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in t around inf 80.1%
sub-neg80.1%
+-commutative80.1%
mul-1-neg80.1%
unsub-neg80.1%
associate-/l*79.4%
mul-1-neg79.4%
remove-double-neg79.4%
associate-/l*80.1%
Simplified80.1%
Taylor expanded in y around 0 82.4%
Taylor expanded in z around inf 79.0%
associate-/l*79.0%
Simplified79.0%
if 1.48e-37 < a < 52Initial program 99.6%
associate-*l/99.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
Taylor expanded in x around 0 78.4%
associate-*r/78.4%
*-commutative78.4%
associate-/r/78.6%
Simplified78.6%
if 52 < a < 9e107Initial program 80.2%
associate--l+84.7%
sub-neg84.7%
+-commutative84.7%
associate-/l*93.3%
distribute-neg-frac93.3%
associate-/r/97.8%
fma-def97.9%
sub-neg97.9%
+-commutative97.9%
distribute-neg-in97.9%
unsub-neg97.9%
remove-double-neg97.9%
Simplified97.9%
Taylor expanded in x around inf 72.8%
Final simplification80.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.35e+57)
(+ x y)
(if (<= a 1.48e-37)
(+ x (/ (* y (- z a)) t))
(if (<= a 52.0) (- y (/ z (/ a y))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.35e+57) {
tmp = x + y;
} else if (a <= 1.48e-37) {
tmp = x + ((y * (z - a)) / t);
} else if (a <= 52.0) {
tmp = y - (z / (a / y));
} 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.35d+57)) then
tmp = x + y
else if (a <= 1.48d-37) then
tmp = x + ((y * (z - a)) / t)
else if (a <= 52.0d0) then
tmp = y - (z / (a / y))
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.35e+57) {
tmp = x + y;
} else if (a <= 1.48e-37) {
tmp = x + ((y * (z - a)) / t);
} else if (a <= 52.0) {
tmp = y - (z / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.35e+57: tmp = x + y elif a <= 1.48e-37: tmp = x + ((y * (z - a)) / t) elif a <= 52.0: tmp = y - (z / (a / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.35e+57) tmp = Float64(x + y); elseif (a <= 1.48e-37) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); elseif (a <= 52.0) tmp = Float64(y - Float64(z / Float64(a / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.35e+57) tmp = x + y; elseif (a <= 1.48e-37) tmp = x + ((y * (z - a)) / t); elseif (a <= 52.0) tmp = y - (z / (a / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.35e+57], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.48e-37], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 52.0], N[(y - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+57}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.48 \cdot 10^{-37}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{elif}\;a \leq 52:\\
\;\;\;\;y - \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.3499999999999999e57 or 52 < a Initial program 76.2%
associate--l+76.9%
sub-neg76.9%
+-commutative76.9%
associate-/l*93.8%
distribute-neg-frac93.8%
associate-/r/94.5%
fma-def94.5%
sub-neg94.5%
+-commutative94.5%
distribute-neg-in94.5%
unsub-neg94.5%
remove-double-neg94.5%
Simplified94.5%
Taylor expanded in a around inf 82.4%
if -1.3499999999999999e57 < a < 1.48e-37Initial program 78.0%
associate--l+82.3%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in t around -inf 82.5%
+-commutative82.5%
sub-neg82.5%
mul-1-neg82.5%
mul-1-neg82.5%
unsub-neg82.5%
mul-1-neg82.5%
sub-neg82.5%
distribute-lft-out--82.5%
Simplified82.5%
if 1.48e-37 < a < 52Initial program 99.6%
associate-*l/99.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
Taylor expanded in x around 0 78.4%
associate-*r/78.4%
*-commutative78.4%
associate-/r/78.6%
Simplified78.6%
Final simplification82.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.12e-30) (not (<= a 1.14e-57))) (- (+ x y) (* y (/ z a))) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.12e-30) || !(a <= 1.14e-57)) {
tmp = (x + y) - (y * (z / a));
} 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.12d-30)) .or. (.not. (a <= 1.14d-57))) then
tmp = (x + y) - (y * (z / a))
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.12e-30) || !(a <= 1.14e-57)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.12e-30) or not (a <= 1.14e-57): tmp = (x + y) - (y * (z / a)) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.12e-30) || !(a <= 1.14e-57)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.12e-30) || ~((a <= 1.14e-57))) tmp = (x + y) - (y * (z / a)); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.12e-30], N[Not[LessEqual[a, 1.14e-57]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{-30} \lor \neg \left(a \leq 1.14 \cdot 10^{-57}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -1.12e-30 or 1.14000000000000006e-57 < a Initial program 79.2%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in t around 0 89.0%
if -1.12e-30 < a < 1.14000000000000006e-57Initial program 76.0%
associate--l+81.2%
associate-/l*84.0%
Simplified84.0%
Taylor expanded in t around -inf 86.9%
+-commutative86.9%
sub-neg86.9%
mul-1-neg86.9%
mul-1-neg86.9%
unsub-neg86.9%
mul-1-neg86.9%
sub-neg86.9%
distribute-lft-out--86.9%
Simplified86.9%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.2e+60) (+ x y) (if (<= a 1.1e+108) (+ x (/ y (/ t z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e+60) {
tmp = x + y;
} else if (a <= 1.1e+108) {
tmp = x + (y / (t / z));
} 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 <= (-3.2d+60)) then
tmp = x + y
else if (a <= 1.1d+108) then
tmp = x + (y / (t / z))
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 <= -3.2e+60) {
tmp = x + y;
} else if (a <= 1.1e+108) {
tmp = x + (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.2e+60: tmp = x + y elif a <= 1.1e+108: tmp = x + (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.2e+60) tmp = Float64(x + y); elseif (a <= 1.1e+108) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.2e+60) tmp = x + y; elseif (a <= 1.1e+108) tmp = x + (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e+60], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.1e+108], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+60}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{+108}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.19999999999999991e60 or 1.1000000000000001e108 < a Initial program 75.3%
associate--l+75.2%
sub-neg75.2%
+-commutative75.2%
associate-/l*94.0%
distribute-neg-frac94.0%
associate-/r/93.8%
fma-def93.8%
sub-neg93.8%
+-commutative93.8%
distribute-neg-in93.8%
unsub-neg93.8%
remove-double-neg93.8%
Simplified93.8%
Taylor expanded in a around inf 85.5%
if -3.19999999999999991e60 < a < 1.1000000000000001e108Initial program 79.3%
associate--l+83.4%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in t around inf 74.3%
sub-neg74.3%
+-commutative74.3%
mul-1-neg74.3%
unsub-neg74.3%
associate-/l*73.8%
mul-1-neg73.8%
remove-double-neg73.8%
associate-/l*75.0%
Simplified75.0%
Taylor expanded in y around 0 77.0%
Taylor expanded in z around inf 75.0%
associate-/l*75.6%
Simplified75.6%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.8e+259) (* y (/ (- z) a)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e+259) {
tmp = y * (-z / a);
} 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 (z <= (-1.8d+259)) then
tmp = y * (-z / a)
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 (z <= -1.8e+259) {
tmp = y * (-z / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.8e+259: tmp = y * (-z / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.8e+259) tmp = Float64(y * Float64(Float64(-z) / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.8e+259) tmp = y * (-z / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.8e+259], N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+259}:\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.8000000000000001e259Initial program 87.6%
associate-*l/76.4%
Simplified76.4%
Taylor expanded in t around 0 69.8%
Taylor expanded in z around inf 63.4%
mul-1-neg63.4%
associate-*r/57.5%
distribute-rgt-neg-in57.5%
distribute-neg-frac57.5%
Simplified57.5%
if -1.8000000000000001e259 < z Initial program 77.2%
associate--l+79.9%
sub-neg79.9%
+-commutative79.9%
associate-/l*88.9%
distribute-neg-frac88.9%
associate-/r/90.7%
fma-def90.7%
sub-neg90.7%
+-commutative90.7%
distribute-neg-in90.7%
unsub-neg90.7%
remove-double-neg90.7%
Simplified90.7%
Taylor expanded in a around inf 63.8%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e+255) (* z (/ (- y) a)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+255) {
tmp = z * (-y / a);
} 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 (z <= (-5.5d+255)) then
tmp = z * (-y / a)
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 (z <= -5.5e+255) {
tmp = z * (-y / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+255: tmp = z * (-y / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+255) tmp = Float64(z * Float64(Float64(-y) / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e+255) tmp = z * (-y / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+255], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+255}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.4999999999999998e255Initial program 87.6%
associate-*l/76.4%
Simplified76.4%
associate-/r/99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 81.6%
Taylor expanded in z around inf 63.4%
mul-1-neg63.4%
associate-*l/69.2%
*-commutative69.2%
distribute-rgt-neg-in69.2%
Simplified69.2%
if -5.4999999999999998e255 < z Initial program 77.2%
associate--l+79.9%
sub-neg79.9%
+-commutative79.9%
associate-/l*88.9%
distribute-neg-frac88.9%
associate-/r/90.7%
fma-def90.7%
sub-neg90.7%
+-commutative90.7%
distribute-neg-in90.7%
unsub-neg90.7%
remove-double-neg90.7%
Simplified90.7%
Taylor expanded in a around inf 63.8%
Final simplification64.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.02e+211) y (if (<= y 3.4e+119) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.02e+211) {
tmp = y;
} else if (y <= 3.4e+119) {
tmp = x;
} else {
tmp = 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 (y <= (-1.02d+211)) then
tmp = y
else if (y <= 3.4d+119) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.02e+211) {
tmp = y;
} else if (y <= 3.4e+119) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.02e+211: tmp = y elif y <= 3.4e+119: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.02e+211) tmp = y; elseif (y <= 3.4e+119) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.02e+211) tmp = y; elseif (y <= 3.4e+119) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.02e+211], y, If[LessEqual[y, 3.4e+119], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+211}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+119}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.02e211 or 3.40000000000000013e119 < y Initial program 56.3%
associate-*l/77.2%
Simplified77.2%
Taylor expanded in t around 0 64.7%
Taylor expanded in x around 0 50.5%
associate-*r/63.1%
*-commutative63.1%
associate-/r/62.3%
Simplified62.3%
Taylor expanded in z around 0 35.1%
if -1.02e211 < y < 3.40000000000000013e119Initial program 84.4%
associate--l+87.8%
sub-neg87.8%
+-commutative87.8%
associate-/l*92.6%
distribute-neg-frac92.6%
associate-/r/92.1%
fma-def92.1%
sub-neg92.1%
+-commutative92.1%
distribute-neg-in92.1%
unsub-neg92.1%
remove-double-neg92.1%
Simplified92.1%
Taylor expanded in x around inf 67.2%
Final simplification59.7%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 77.8%
associate--l+80.4%
sub-neg80.4%
+-commutative80.4%
associate-/l*89.6%
distribute-neg-frac89.6%
associate-/r/89.8%
fma-def89.8%
sub-neg89.8%
+-commutative89.8%
distribute-neg-in89.8%
unsub-neg89.8%
remove-double-neg89.8%
Simplified89.8%
Taylor expanded in a around inf 60.5%
Final simplification60.5%
(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}
Initial program 77.8%
associate--l+80.4%
sub-neg80.4%
+-commutative80.4%
associate-/l*89.6%
distribute-neg-frac89.6%
associate-/r/89.8%
fma-def89.8%
sub-neg89.8%
+-commutative89.8%
distribute-neg-in89.8%
unsub-neg89.8%
remove-double-neg89.8%
Simplified89.8%
Taylor expanded in x around inf 53.9%
Final simplification53.9%
(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 2023257
(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))))