
(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 (<= t 2.3e+205) (+ (* y (+ (/ (- t z) (- a t)) 1.0)) x) (- x (/ y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.3e+205) {
tmp = (y * (((t - z) / (a - t)) + 1.0)) + 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 (t <= 2.3d+205) then
tmp = (y * (((t - z) / (a - t)) + 1.0d0)) + 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 (t <= 2.3e+205) {
tmp = (y * (((t - z) / (a - t)) + 1.0)) + x;
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.3e+205: tmp = (y * (((t - z) / (a - t)) + 1.0)) + x else: tmp = x - (y / (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.3e+205) tmp = Float64(Float64(y * Float64(Float64(Float64(t - z) / Float64(a - t)) + 1.0)) + 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 (t <= 2.3e+205) tmp = (y * (((t - z) / (a - t)) + 1.0)) + x; else tmp = x - (y / (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.3e+205], N[(N[(y * N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.3 \cdot 10^{+205}:\\
\;\;\;\;y \cdot \left(\frac{t - z}{a - t} + 1\right) + x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\end{array}
\end{array}
if t < 2.30000000000000007e205Initial program 81.7%
+-commutative81.7%
associate--l+81.7%
sub-neg81.7%
distribute-frac-neg81.7%
*-commutative81.7%
distribute-rgt-neg-in81.7%
associate-/l*88.5%
sub-neg88.5%
distribute-neg-in88.5%
remove-double-neg88.5%
+-commutative88.5%
sub-neg88.5%
Simplified88.5%
Taylor expanded in y around 0 93.3%
+-commutative93.3%
associate--l+91.7%
div-sub91.7%
Simplified91.7%
if 2.30000000000000007e205 < t Initial program 53.5%
+-commutative53.5%
associate--l+53.5%
sub-neg53.5%
distribute-frac-neg53.5%
*-commutative53.5%
distribute-rgt-neg-in53.5%
associate-/l*62.7%
sub-neg62.7%
distribute-neg-in62.7%
remove-double-neg62.7%
+-commutative62.7%
sub-neg62.7%
Simplified62.7%
Taylor expanded in y around 0 81.9%
+-commutative81.9%
associate--l+71.7%
div-sub71.7%
Simplified71.7%
Taylor expanded in t around inf 81.7%
mul-1-neg81.7%
associate-/l*99.7%
distribute-neg-frac99.7%
mul-1-neg99.7%
unsub-neg99.7%
Simplified99.7%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.6e+112)
(+ y x)
(if (<= a -2.7e-91)
(+ x (* y (/ z t)))
(if (<= a -6e-92)
(+ x (+ y (/ (* t y) a)))
(if (<= a 1.7e-10) (+ x (/ (* y (- z a)) t)) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e+112) {
tmp = y + x;
} else if (a <= -2.7e-91) {
tmp = x + (y * (z / t));
} else if (a <= -6e-92) {
tmp = x + (y + ((t * y) / a));
} else if (a <= 1.7e-10) {
tmp = x + ((y * (z - a)) / 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 <= (-2.6d+112)) then
tmp = y + x
else if (a <= (-2.7d-91)) then
tmp = x + (y * (z / t))
else if (a <= (-6d-92)) then
tmp = x + (y + ((t * y) / a))
else if (a <= 1.7d-10) then
tmp = x + ((y * (z - a)) / 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 <= -2.6e+112) {
tmp = y + x;
} else if (a <= -2.7e-91) {
tmp = x + (y * (z / t));
} else if (a <= -6e-92) {
tmp = x + (y + ((t * y) / a));
} else if (a <= 1.7e-10) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.6e+112: tmp = y + x elif a <= -2.7e-91: tmp = x + (y * (z / t)) elif a <= -6e-92: tmp = x + (y + ((t * y) / a)) elif a <= 1.7e-10: tmp = x + ((y * (z - a)) / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e+112) tmp = Float64(y + x); elseif (a <= -2.7e-91) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (a <= -6e-92) tmp = Float64(x + Float64(y + Float64(Float64(t * y) / a))); elseif (a <= 1.7e-10) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.6e+112) tmp = y + x; elseif (a <= -2.7e-91) tmp = x + (y * (z / t)); elseif (a <= -6e-92) tmp = x + (y + ((t * y) / a)); elseif (a <= 1.7e-10) tmp = x + ((y * (z - a)) / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e+112], N[(y + x), $MachinePrecision], If[LessEqual[a, -2.7e-91], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -6e-92], N[(x + N[(y + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.7e-10], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+112}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-91}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-92}:\\
\;\;\;\;x + \left(y + \frac{t \cdot y}{a}\right)\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.6000000000000001e112 or 1.70000000000000007e-10 < a Initial program 78.2%
+-commutative78.2%
associate--l+78.2%
sub-neg78.2%
distribute-frac-neg78.2%
*-commutative78.2%
distribute-rgt-neg-in78.2%
associate-/l*91.0%
sub-neg91.0%
distribute-neg-in91.0%
remove-double-neg91.0%
+-commutative91.0%
sub-neg91.0%
Simplified91.0%
Taylor expanded in a around inf 85.1%
+-commutative85.1%
Simplified85.1%
if -2.6000000000000001e112 < a < -2.6999999999999997e-91Initial program 82.6%
+-commutative82.6%
associate--l+82.6%
sub-neg82.6%
distribute-frac-neg82.6%
*-commutative82.6%
distribute-rgt-neg-in82.6%
associate-/l*90.8%
sub-neg90.8%
distribute-neg-in90.8%
remove-double-neg90.8%
+-commutative90.8%
sub-neg90.8%
Simplified90.8%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
associate--l+96.8%
div-sub96.8%
Simplified96.8%
Taylor expanded in a around 0 73.8%
if -2.6999999999999997e-91 < a < -6.00000000000000027e-92Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
distribute-frac-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
associate-/l*100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in t around 0 85.8%
if -6.00000000000000027e-92 < a < 1.70000000000000007e-10Initial program 79.3%
+-commutative79.3%
associate--l+79.3%
sub-neg79.3%
distribute-frac-neg79.3%
*-commutative79.3%
distribute-rgt-neg-in79.3%
associate-/l*80.3%
sub-neg80.3%
distribute-neg-in80.3%
remove-double-neg80.3%
+-commutative80.3%
sub-neg80.3%
Simplified80.3%
Taylor expanded in y around 0 89.6%
+-commutative89.6%
associate--l+86.1%
div-sub86.1%
Simplified86.1%
Taylor expanded in t around -inf 81.8%
Final simplification82.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3e+112)
(+ y x)
(if (<= a 1.02e-168)
(+ x (/ y (/ t z)))
(if (<= a 2.3e-108)
(- x (/ a (/ t y)))
(if (<= a 1.95e-11) (+ x (* z (/ y t))) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3e+112) {
tmp = y + x;
} else if (a <= 1.02e-168) {
tmp = x + (y / (t / z));
} else if (a <= 2.3e-108) {
tmp = x - (a / (t / y));
} else if (a <= 1.95e-11) {
tmp = x + (z * (y / 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 <= (-3d+112)) then
tmp = y + x
else if (a <= 1.02d-168) then
tmp = x + (y / (t / z))
else if (a <= 2.3d-108) then
tmp = x - (a / (t / y))
else if (a <= 1.95d-11) then
tmp = x + (z * (y / 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 <= -3e+112) {
tmp = y + x;
} else if (a <= 1.02e-168) {
tmp = x + (y / (t / z));
} else if (a <= 2.3e-108) {
tmp = x - (a / (t / y));
} else if (a <= 1.95e-11) {
tmp = x + (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3e+112: tmp = y + x elif a <= 1.02e-168: tmp = x + (y / (t / z)) elif a <= 2.3e-108: tmp = x - (a / (t / y)) elif a <= 1.95e-11: tmp = x + (z * (y / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3e+112) tmp = Float64(y + x); elseif (a <= 1.02e-168) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (a <= 2.3e-108) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (a <= 1.95e-11) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3e+112) tmp = y + x; elseif (a <= 1.02e-168) tmp = x + (y / (t / z)); elseif (a <= 2.3e-108) tmp = x - (a / (t / y)); elseif (a <= 1.95e-11) tmp = x + (z * (y / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3e+112], N[(y + x), $MachinePrecision], If[LessEqual[a, 1.02e-168], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.3e-108], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.95e-11], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+112}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{-168}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-108}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{-11}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.99999999999999979e112 or 1.95000000000000005e-11 < a Initial program 78.2%
+-commutative78.2%
associate--l+78.2%
sub-neg78.2%
distribute-frac-neg78.2%
*-commutative78.2%
distribute-rgt-neg-in78.2%
associate-/l*91.0%
sub-neg91.0%
distribute-neg-in91.0%
remove-double-neg91.0%
+-commutative91.0%
sub-neg91.0%
Simplified91.0%
Taylor expanded in a around inf 85.1%
+-commutative85.1%
Simplified85.1%
if -2.99999999999999979e112 < a < 1.01999999999999999e-168Initial program 80.2%
+-commutative80.2%
associate--l+80.2%
sub-neg80.2%
distribute-frac-neg80.2%
*-commutative80.2%
distribute-rgt-neg-in80.2%
associate-/l*83.2%
sub-neg83.2%
distribute-neg-in83.2%
remove-double-neg83.2%
+-commutative83.2%
sub-neg83.2%
Simplified83.2%
Taylor expanded in y around 0 94.7%
+-commutative94.7%
associate--l+90.3%
div-sub90.2%
Simplified90.2%
Taylor expanded in a around 0 78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in z around 0 78.4%
associate-/l*80.0%
Simplified80.0%
if 1.01999999999999999e-168 < a < 2.29999999999999996e-108Initial program 74.0%
+-commutative74.0%
associate--l+74.0%
sub-neg74.0%
distribute-frac-neg74.0%
*-commutative74.0%
distribute-rgt-neg-in74.0%
associate-/l*74.1%
sub-neg74.1%
distribute-neg-in74.1%
remove-double-neg74.1%
+-commutative74.1%
sub-neg74.1%
Simplified74.1%
Taylor expanded in y around 0 80.7%
+-commutative80.7%
associate--l+80.7%
div-sub80.7%
Simplified80.7%
Taylor expanded in t around -inf 63.4%
Taylor expanded in z around 0 67.8%
mul-1-neg67.8%
unsub-neg67.8%
associate-/l*73.8%
Simplified73.8%
if 2.29999999999999996e-108 < a < 1.95000000000000005e-11Initial program 85.4%
+-commutative85.4%
associate--l+85.4%
sub-neg85.4%
distribute-frac-neg85.4%
*-commutative85.4%
distribute-rgt-neg-in85.4%
associate-/l*88.2%
sub-neg88.2%
distribute-neg-in88.2%
remove-double-neg88.2%
+-commutative88.2%
sub-neg88.2%
Simplified88.2%
Taylor expanded in y around 0 85.9%
+-commutative85.9%
associate--l+85.9%
div-sub85.9%
Simplified85.9%
Taylor expanded in a around 0 71.0%
associate-/l*76.0%
associate-/r/76.1%
Simplified76.1%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 6e+204) (+ x (+ y (/ (- t z) (/ (- a t) y)))) (- x (/ y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 6e+204) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} 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 (t <= 6d+204) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
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 (t <= 6e+204) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 6e+204: tmp = x + (y + ((t - z) / ((a - t) / y))) else: tmp = x - (y / (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 6e+204) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); 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 (t <= 6e+204) tmp = x + (y + ((t - z) / ((a - t) / y))); else tmp = x - (y / (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 6e+204], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6 \cdot 10^{+204}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\end{array}
\end{array}
if t < 5.99999999999999965e204Initial program 81.7%
sub-neg81.7%
distribute-frac-neg81.7%
distribute-rgt-neg-out81.7%
associate-/l*88.1%
div-sub88.0%
associate-+r-88.0%
associate-/r/88.0%
distribute-rgt-neg-out88.0%
associate-/r/88.0%
distribute-frac-neg88.0%
associate-+l+88.0%
associate-+r-90.5%
distribute-frac-neg90.5%
Simplified90.5%
if 5.99999999999999965e204 < t Initial program 53.5%
+-commutative53.5%
associate--l+53.5%
sub-neg53.5%
distribute-frac-neg53.5%
*-commutative53.5%
distribute-rgt-neg-in53.5%
associate-/l*62.7%
sub-neg62.7%
distribute-neg-in62.7%
remove-double-neg62.7%
+-commutative62.7%
sub-neg62.7%
Simplified62.7%
Taylor expanded in y around 0 81.9%
+-commutative81.9%
associate--l+71.7%
div-sub71.7%
Simplified71.7%
Taylor expanded in t around inf 81.7%
mul-1-neg81.7%
associate-/l*99.7%
distribute-neg-frac99.7%
mul-1-neg99.7%
unsub-neg99.7%
Simplified99.7%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.8e-176) (not (<= a 2.1e-9))) (- (+ y x) (* z (/ y a))) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e-176) || !(a <= 2.1e-9)) {
tmp = (y + x) - (z * (y / 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 <= (-4.8d-176)) .or. (.not. (a <= 2.1d-9))) then
tmp = (y + x) - (z * (y / 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 <= -4.8e-176) || !(a <= 2.1e-9)) {
tmp = (y + x) - (z * (y / a));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.8e-176) or not (a <= 2.1e-9): tmp = (y + x) - (z * (y / a)) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.8e-176) || !(a <= 2.1e-9)) tmp = Float64(Float64(y + x) - Float64(z * Float64(y / 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 <= -4.8e-176) || ~((a <= 2.1e-9))) tmp = (y + x) - (z * (y / a)); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.8e-176], N[Not[LessEqual[a, 2.1e-9]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(z * N[(y / 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 -4.8 \cdot 10^{-176} \lor \neg \left(a \leq 2.1 \cdot 10^{-9}\right):\\
\;\;\;\;\left(y + x\right) - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -4.80000000000000012e-176 or 2.10000000000000019e-9 < a Initial program 80.8%
associate-*l/90.1%
Simplified90.1%
Taylor expanded in t around 0 79.4%
expm1-log1p-u72.6%
expm1-udef72.0%
*-commutative72.0%
Applied egg-rr72.0%
expm1-def72.6%
expm1-log1p79.4%
*-rgt-identity79.4%
associate-*r/79.4%
associate-*l*83.4%
associate-*r/83.5%
*-rgt-identity83.5%
Simplified83.5%
if -4.80000000000000012e-176 < a < 2.10000000000000019e-9Initial program 77.0%
+-commutative77.0%
associate--l+77.0%
sub-neg77.0%
distribute-frac-neg77.0%
*-commutative77.0%
distribute-rgt-neg-in77.0%
associate-/l*78.5%
sub-neg78.5%
distribute-neg-in78.5%
remove-double-neg78.5%
+-commutative78.5%
sub-neg78.5%
Simplified78.5%
Taylor expanded in y around 0 90.9%
+-commutative90.9%
associate--l+86.9%
div-sub86.8%
Simplified86.8%
Taylor expanded in t around -inf 84.1%
Final simplification83.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.2e+79) (not (<= a 1.4e-9))) (- (+ y x) (* z (/ y a))) (- x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e+79) || !(a <= 1.4e-9)) {
tmp = (y + x) - (z * (y / 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 <= (-6.2d+79)) .or. (.not. (a <= 1.4d-9))) then
tmp = (y + x) - (z * (y / 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 <= -6.2e+79) || !(a <= 1.4e-9)) {
tmp = (y + x) - (z * (y / a));
} else {
tmp = x - ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.2e+79) or not (a <= 1.4e-9): tmp = (y + x) - (z * (y / a)) else: tmp = x - ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.2e+79) || !(a <= 1.4e-9)) tmp = Float64(Float64(y + x) - Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6.2e+79) || ~((a <= 1.4e-9))) tmp = (y + x) - (z * (y / a)); else tmp = x - ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.2e+79], N[Not[LessEqual[a, 1.4e-9]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+79} \lor \neg \left(a \leq 1.4 \cdot 10^{-9}\right):\\
\;\;\;\;\left(y + x\right) - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if a < -6.1999999999999998e79 or 1.39999999999999992e-9 < a Initial program 78.3%
associate-*l/91.3%
Simplified91.3%
Taylor expanded in t around 0 82.5%
expm1-log1p-u77.8%
expm1-udef77.8%
*-commutative77.8%
Applied egg-rr77.8%
expm1-def77.8%
expm1-log1p82.5%
*-rgt-identity82.5%
associate-*r/82.5%
associate-*l*89.1%
associate-*r/89.1%
*-rgt-identity89.1%
Simplified89.1%
if -6.1999999999999998e79 < a < 1.39999999999999992e-9Initial program 80.3%
sub-neg80.3%
distribute-frac-neg80.3%
distribute-rgt-neg-out80.3%
associate-/l*81.6%
div-sub81.5%
associate-+r-81.5%
associate-/r/81.6%
distribute-rgt-neg-out81.6%
associate-/r/81.5%
distribute-frac-neg81.5%
associate-+l+81.5%
associate-+r-86.4%
distribute-frac-neg86.4%
Simplified86.4%
Taylor expanded in z around inf 87.8%
associate-*r/87.8%
associate-*r*87.8%
neg-mul-187.8%
Simplified87.8%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7e+113) (not (<= a 4.8e-9))) (- (+ y x) (* z (/ y a))) (- x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7e+113) || !(a <= 4.8e-9)) {
tmp = (y + x) - (z * (y / a));
} else {
tmp = x - (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 ((a <= (-7d+113)) .or. (.not. (a <= 4.8d-9))) then
tmp = (y + x) - (z * (y / a))
else
tmp = x - (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 ((a <= -7e+113) || !(a <= 4.8e-9)) {
tmp = (y + x) - (z * (y / a));
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7e+113) or not (a <= 4.8e-9): tmp = (y + x) - (z * (y / a)) else: tmp = x - (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7e+113) || !(a <= 4.8e-9)) tmp = Float64(Float64(y + x) - Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7e+113) || ~((a <= 4.8e-9))) tmp = (y + x) - (z * (y / a)); else tmp = x - (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7e+113], N[Not[LessEqual[a, 4.8e-9]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+113} \lor \neg \left(a \leq 4.8 \cdot 10^{-9}\right):\\
\;\;\;\;\left(y + x\right) - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if a < -7.0000000000000001e113 or 4.8e-9 < a Initial program 77.8%
associate-*l/90.9%
Simplified90.9%
Taylor expanded in t around 0 82.3%
expm1-log1p-u78.2%
expm1-udef78.2%
*-commutative78.2%
Applied egg-rr78.2%
expm1-def78.2%
expm1-log1p82.3%
*-rgt-identity82.3%
associate-*r/82.3%
associate-*l*89.3%
associate-*r/89.3%
*-rgt-identity89.3%
Simplified89.3%
if -7.0000000000000001e113 < a < 4.8e-9Initial program 80.6%
+-commutative80.6%
associate--l+80.6%
sub-neg80.6%
distribute-frac-neg80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
associate-/l*83.2%
sub-neg83.2%
distribute-neg-in83.2%
remove-double-neg83.2%
+-commutative83.2%
sub-neg83.2%
Simplified83.2%
Taylor expanded in y around 0 92.2%
+-commutative92.2%
associate--l+88.8%
div-sub88.8%
Simplified88.8%
Taylor expanded in z around inf 87.1%
mul-1-neg87.1%
associate-/l*89.2%
distribute-neg-frac89.2%
Simplified89.2%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.6e+112) (not (<= a 4.1e-10))) (+ y x) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.6e+112) || !(a <= 4.1e-10)) {
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 <= (-2.6d+112)) .or. (.not. (a <= 4.1d-10))) 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 <= -2.6e+112) || !(a <= 4.1e-10)) {
tmp = y + x;
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.6e+112) or not (a <= 4.1e-10): tmp = y + x else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.6e+112) || !(a <= 4.1e-10)) 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 <= -2.6e+112) || ~((a <= 4.1e-10))) tmp = y + x; else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.6e+112], N[Not[LessEqual[a, 4.1e-10]], $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 -2.6 \cdot 10^{+112} \lor \neg \left(a \leq 4.1 \cdot 10^{-10}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if a < -2.6000000000000001e112 or 4.0999999999999998e-10 < a Initial program 78.2%
+-commutative78.2%
associate--l+78.2%
sub-neg78.2%
distribute-frac-neg78.2%
*-commutative78.2%
distribute-rgt-neg-in78.2%
associate-/l*91.0%
sub-neg91.0%
distribute-neg-in91.0%
remove-double-neg91.0%
+-commutative91.0%
sub-neg91.0%
Simplified91.0%
Taylor expanded in a around inf 85.1%
+-commutative85.1%
Simplified85.1%
if -2.6000000000000001e112 < a < 4.0999999999999998e-10Initial program 80.3%
+-commutative80.3%
associate--l+80.3%
sub-neg80.3%
distribute-frac-neg80.3%
*-commutative80.3%
distribute-rgt-neg-in80.3%
associate-/l*82.9%
sub-neg82.9%
distribute-neg-in82.9%
remove-double-neg82.9%
+-commutative82.9%
sub-neg82.9%
Simplified82.9%
Taylor expanded in y around 0 92.0%
+-commutative92.0%
associate--l+88.7%
div-sub88.7%
Simplified88.7%
Taylor expanded in a around 0 73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in z around 0 73.9%
associate-/l*75.8%
Simplified75.8%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.6e+112) (+ y x) (if (<= a 1.8e-11) (+ x (* y (/ z t))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e+112) {
tmp = y + x;
} else if (a <= 1.8e-11) {
tmp = x + (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 <= (-2.6d+112)) then
tmp = y + x
else if (a <= 1.8d-11) then
tmp = x + (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 <= -2.6e+112) {
tmp = y + x;
} else if (a <= 1.8e-11) {
tmp = x + (y * (z / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.6e+112: tmp = y + x elif a <= 1.8e-11: tmp = x + (y * (z / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e+112) tmp = Float64(y + x); elseif (a <= 1.8e-11) tmp = Float64(x + 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 <= -2.6e+112) tmp = y + x; elseif (a <= 1.8e-11) tmp = x + (y * (z / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e+112], N[(y + x), $MachinePrecision], If[LessEqual[a, 1.8e-11], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+112}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-11}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.6000000000000001e112 or 1.79999999999999992e-11 < a Initial program 78.2%
+-commutative78.2%
associate--l+78.2%
sub-neg78.2%
distribute-frac-neg78.2%
*-commutative78.2%
distribute-rgt-neg-in78.2%
associate-/l*91.0%
sub-neg91.0%
distribute-neg-in91.0%
remove-double-neg91.0%
+-commutative91.0%
sub-neg91.0%
Simplified91.0%
Taylor expanded in a around inf 85.1%
+-commutative85.1%
Simplified85.1%
if -2.6000000000000001e112 < a < 1.79999999999999992e-11Initial program 80.3%
+-commutative80.3%
associate--l+80.3%
sub-neg80.3%
distribute-frac-neg80.3%
*-commutative80.3%
distribute-rgt-neg-in80.3%
associate-/l*82.9%
sub-neg82.9%
distribute-neg-in82.9%
remove-double-neg82.9%
+-commutative82.9%
sub-neg82.9%
Simplified82.9%
Taylor expanded in y around 0 92.0%
+-commutative92.0%
associate--l+88.7%
div-sub88.7%
Simplified88.7%
Taylor expanded in a around 0 74.4%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1e-174) (+ y x) (if (<= a 9e-18) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1e-174) {
tmp = y + x;
} else if (a <= 9e-18) {
tmp = x;
} 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 <= (-1d-174)) then
tmp = y + x
else if (a <= 9d-18) then
tmp = x
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 <= -1e-174) {
tmp = y + x;
} else if (a <= 9e-18) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1e-174: tmp = y + x elif a <= 9e-18: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1e-174) tmp = Float64(y + x); elseif (a <= 9e-18) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1e-174) tmp = y + x; elseif (a <= 9e-18) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1e-174], N[(y + x), $MachinePrecision], If[LessEqual[a, 9e-18], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{-174}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1e-174 or 8.99999999999999987e-18 < a Initial program 80.8%
+-commutative80.8%
associate--l+80.8%
sub-neg80.8%
distribute-frac-neg80.8%
*-commutative80.8%
distribute-rgt-neg-in80.8%
associate-/l*91.2%
sub-neg91.2%
distribute-neg-in91.2%
remove-double-neg91.2%
+-commutative91.2%
sub-neg91.2%
Simplified91.2%
Taylor expanded in a around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -1e-174 < a < 8.99999999999999987e-18Initial program 77.0%
+-commutative77.0%
associate--l+77.0%
sub-neg77.0%
distribute-frac-neg77.0%
*-commutative77.0%
distribute-rgt-neg-in77.0%
associate-/l*78.5%
sub-neg78.5%
distribute-neg-in78.5%
remove-double-neg78.5%
+-commutative78.5%
sub-neg78.5%
Simplified78.5%
Taylor expanded in y around 0 55.5%
Final simplification69.6%
(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 79.4%
+-commutative79.4%
associate--l+79.4%
sub-neg79.4%
distribute-frac-neg79.4%
*-commutative79.4%
distribute-rgt-neg-in79.4%
associate-/l*86.4%
sub-neg86.4%
distribute-neg-in86.4%
remove-double-neg86.4%
+-commutative86.4%
sub-neg86.4%
Simplified86.4%
Taylor expanded in y around 0 52.8%
Final simplification52.8%
(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 2023293
(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))))