
(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 (if (or (<= t -5.8e+69) (not (<= t 2.4e+99))) (+ x (/ y (/ t (- z a)))) (fma (/ (- t z) (- a t)) y (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.8e+69) || !(t <= 2.4e+99)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = fma(((t - z) / (a - t)), y, (x + y));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.8e+69) || !(t <= 2.4e+99)) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = fma(Float64(Float64(t - z) / Float64(a - t)), y, Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.8e+69], N[Not[LessEqual[t, 2.4e+99]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+69} \lor \neg \left(t \leq 2.4 \cdot 10^{+99}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a - t}, y, x + y\right)\\
\end{array}
\end{array}
if t < -5.7999999999999997e69 or 2.4000000000000001e99 < t Initial program 54.6%
sub-neg54.6%
distribute-frac-neg54.6%
distribute-rgt-neg-out54.6%
+-commutative54.6%
associate-*l/68.0%
distribute-rgt-neg-in68.0%
distribute-lft-neg-in68.0%
distribute-frac-neg68.0%
fma-def68.0%
sub-neg68.0%
distribute-neg-in68.0%
remove-double-neg68.0%
+-commutative68.0%
sub-neg68.0%
Simplified68.0%
Taylor expanded in t around inf 66.7%
associate-+r+83.7%
distribute-rgt1-in83.7%
metadata-eval83.7%
mul0-lft83.7%
associate-/l*91.8%
Simplified91.8%
if -5.7999999999999997e69 < t < 2.4000000000000001e99Initial program 88.9%
sub-neg88.9%
distribute-frac-neg88.9%
distribute-rgt-neg-out88.9%
+-commutative88.9%
associate-*l/92.0%
distribute-rgt-neg-in92.0%
distribute-lft-neg-in92.0%
distribute-frac-neg92.0%
fma-def92.0%
sub-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
+-commutative92.0%
sub-neg92.0%
Simplified92.0%
Final simplification92.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y t)))))
(if (<= a -4.2e-20)
(+ x y)
(if (<= a 0.0068)
t_1
(if (<= a 5.1e+37)
(* y (- 1.0 (/ z a)))
(if (<= a 5e+79) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / t));
double tmp;
if (a <= -4.2e-20) {
tmp = x + y;
} else if (a <= 0.0068) {
tmp = t_1;
} else if (a <= 5.1e+37) {
tmp = y * (1.0 - (z / a));
} else if (a <= 5e+79) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (z * (y / t))
if (a <= (-4.2d-20)) then
tmp = x + y
else if (a <= 0.0068d0) then
tmp = t_1
else if (a <= 5.1d+37) then
tmp = y * (1.0d0 - (z / a))
else if (a <= 5d+79) then
tmp = t_1
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 t_1 = x + (z * (y / t));
double tmp;
if (a <= -4.2e-20) {
tmp = x + y;
} else if (a <= 0.0068) {
tmp = t_1;
} else if (a <= 5.1e+37) {
tmp = y * (1.0 - (z / a));
} else if (a <= 5e+79) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / t)) tmp = 0 if a <= -4.2e-20: tmp = x + y elif a <= 0.0068: tmp = t_1 elif a <= 5.1e+37: tmp = y * (1.0 - (z / a)) elif a <= 5e+79: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / t))) tmp = 0.0 if (a <= -4.2e-20) tmp = Float64(x + y); elseif (a <= 0.0068) tmp = t_1; elseif (a <= 5.1e+37) tmp = Float64(y * Float64(1.0 - Float64(z / a))); elseif (a <= 5e+79) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / t)); tmp = 0.0; if (a <= -4.2e-20) tmp = x + y; elseif (a <= 0.0068) tmp = t_1; elseif (a <= 5.1e+37) tmp = y * (1.0 - (z / a)); elseif (a <= 5e+79) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.2e-20], N[(x + y), $MachinePrecision], If[LessEqual[a, 0.0068], t$95$1, If[LessEqual[a, 5.1e+37], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e+79], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{t}\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{-20}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 0.0068:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5.1 \cdot 10^{+37}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.1999999999999998e-20 or 5e79 < a Initial program 79.9%
associate-*l/92.1%
Simplified92.1%
Taylor expanded in a around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -4.1999999999999998e-20 < a < 0.00679999999999999962 or 5.10000000000000032e37 < a < 5e79Initial program 76.5%
associate-*l/77.8%
Simplified77.8%
Taylor expanded in t around inf 81.3%
sub-neg81.3%
mul-1-neg81.3%
unsub-neg81.3%
associate-/l*75.6%
mul-1-neg75.6%
remove-double-neg75.6%
associate-/l*77.1%
Simplified77.1%
Taylor expanded in a around 0 75.0%
associate-*l/76.6%
*-commutative76.6%
Simplified76.6%
if 0.00679999999999999962 < a < 5.10000000000000032e37Initial program 90.5%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in t around 0 90.6%
Taylor expanded in x around 0 79.9%
associate-*r/80.0%
*-commutative80.0%
cancel-sign-sub-inv80.0%
*-lft-identity80.0%
distribute-rgt-in80.0%
sub-neg80.0%
Simplified80.0%
Final simplification78.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y t)))))
(if (<= a -6e-20)
(+ x y)
(if (<= a 0.0065)
t_1
(if (<= a 9.2e+37)
(- y (/ y (/ a z)))
(if (<= a 5.5e+79) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / t));
double tmp;
if (a <= -6e-20) {
tmp = x + y;
} else if (a <= 0.0065) {
tmp = t_1;
} else if (a <= 9.2e+37) {
tmp = y - (y / (a / z));
} else if (a <= 5.5e+79) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (z * (y / t))
if (a <= (-6d-20)) then
tmp = x + y
else if (a <= 0.0065d0) then
tmp = t_1
else if (a <= 9.2d+37) then
tmp = y - (y / (a / z))
else if (a <= 5.5d+79) then
tmp = t_1
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 t_1 = x + (z * (y / t));
double tmp;
if (a <= -6e-20) {
tmp = x + y;
} else if (a <= 0.0065) {
tmp = t_1;
} else if (a <= 9.2e+37) {
tmp = y - (y / (a / z));
} else if (a <= 5.5e+79) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / t)) tmp = 0 if a <= -6e-20: tmp = x + y elif a <= 0.0065: tmp = t_1 elif a <= 9.2e+37: tmp = y - (y / (a / z)) elif a <= 5.5e+79: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / t))) tmp = 0.0 if (a <= -6e-20) tmp = Float64(x + y); elseif (a <= 0.0065) tmp = t_1; elseif (a <= 9.2e+37) tmp = Float64(y - Float64(y / Float64(a / z))); elseif (a <= 5.5e+79) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / t)); tmp = 0.0; if (a <= -6e-20) tmp = x + y; elseif (a <= 0.0065) tmp = t_1; elseif (a <= 9.2e+37) tmp = y - (y / (a / z)); elseif (a <= 5.5e+79) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6e-20], N[(x + y), $MachinePrecision], If[LessEqual[a, 0.0065], t$95$1, If[LessEqual[a, 9.2e+37], N[(y - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.5e+79], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{t}\\
\mathbf{if}\;a \leq -6 \cdot 10^{-20}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 0.0065:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{+37}:\\
\;\;\;\;y - \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -6.00000000000000057e-20 or 5.50000000000000007e79 < a Initial program 79.9%
associate-*l/92.1%
Simplified92.1%
Taylor expanded in a around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -6.00000000000000057e-20 < a < 0.0064999999999999997 or 9.2000000000000001e37 < a < 5.50000000000000007e79Initial program 76.5%
associate-*l/77.8%
Simplified77.8%
Taylor expanded in t around inf 81.3%
sub-neg81.3%
mul-1-neg81.3%
unsub-neg81.3%
associate-/l*75.6%
mul-1-neg75.6%
remove-double-neg75.6%
associate-/l*77.1%
Simplified77.1%
Taylor expanded in a around 0 75.0%
associate-*l/76.6%
*-commutative76.6%
Simplified76.6%
if 0.0064999999999999997 < a < 9.2000000000000001e37Initial program 90.5%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in t around 0 90.6%
Taylor expanded in x around 0 79.9%
associate-/l*80.2%
Simplified80.2%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e+67) (not (<= t 4.2e+99))) (+ x (/ y (/ t (- z a)))) (+ (+ x y) (* y (/ (- t z) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e+67) || !(t <= 4.2e+99)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) + (y * ((t - 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 <= (-1.6d+67)) .or. (.not. (t <= 4.2d+99))) then
tmp = x + (y / (t / (z - a)))
else
tmp = (x + y) + (y * ((t - 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 <= -1.6e+67) || !(t <= 4.2e+99)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) + (y * ((t - z) / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.6e+67) or not (t <= 4.2e+99): tmp = x + (y / (t / (z - a))) else: tmp = (x + y) + (y * ((t - z) / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.6e+67) || !(t <= 4.2e+99)) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = Float64(Float64(x + y) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.6e+67) || ~((t <= 4.2e+99))) tmp = x + (y / (t / (z - a))); else tmp = (x + y) + (y * ((t - z) / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.6e+67], N[Not[LessEqual[t, 4.2e+99]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+67} \lor \neg \left(t \leq 4.2 \cdot 10^{+99}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{t - z}{a - t}\\
\end{array}
\end{array}
if t < -1.59999999999999991e67 or 4.2000000000000002e99 < t Initial program 54.6%
sub-neg54.6%
distribute-frac-neg54.6%
distribute-rgt-neg-out54.6%
+-commutative54.6%
associate-*l/68.0%
distribute-rgt-neg-in68.0%
distribute-lft-neg-in68.0%
distribute-frac-neg68.0%
fma-def68.0%
sub-neg68.0%
distribute-neg-in68.0%
remove-double-neg68.0%
+-commutative68.0%
sub-neg68.0%
Simplified68.0%
Taylor expanded in t around inf 66.7%
associate-+r+83.7%
distribute-rgt1-in83.7%
metadata-eval83.7%
mul0-lft83.7%
associate-/l*91.8%
Simplified91.8%
if -1.59999999999999991e67 < t < 4.2000000000000002e99Initial program 88.9%
associate-*l/92.0%
Simplified92.0%
Final simplification92.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.8e-20)
(- (+ x y) (* y (/ z a)))
(if (<= a 2.5e-70)
(+ (- x (/ (* y a) t)) (/ y (/ t z)))
(- (+ x y) (/ y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.8e-20) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 2.5e-70) {
tmp = (x - ((y * a) / t)) + (y / (t / z));
} 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 (a <= (-7.8d-20)) then
tmp = (x + y) - (y * (z / a))
else if (a <= 2.5d-70) then
tmp = (x - ((y * a) / t)) + (y / (t / z))
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 (a <= -7.8e-20) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 2.5e-70) {
tmp = (x - ((y * a) / t)) + (y / (t / z));
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.8e-20: tmp = (x + y) - (y * (z / a)) elif a <= 2.5e-70: tmp = (x - ((y * a) / t)) + (y / (t / z)) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.8e-20) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= 2.5e-70) tmp = Float64(Float64(x - Float64(Float64(y * a) / t)) + Float64(y / Float64(t / z))); 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 (a <= -7.8e-20) tmp = (x + y) - (y * (z / a)); elseif (a <= 2.5e-70) tmp = (x - ((y * a) / t)) + (y / (t / z)); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.8e-20], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e-70], N[(N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{-20}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-70}:\\
\;\;\;\;\left(x - \frac{y \cdot a}{t}\right) + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -7.80000000000000014e-20Initial program 78.9%
associate-*l/89.4%
Simplified89.4%
Taylor expanded in t around 0 85.6%
if -7.80000000000000014e-20 < a < 2.4999999999999999e-70Initial program 75.3%
associate-*l/76.7%
Simplified76.7%
Taylor expanded in t around inf 81.5%
sub-neg81.5%
mul-1-neg81.5%
unsub-neg81.5%
associate-/l*75.9%
mul-1-neg75.9%
remove-double-neg75.9%
associate-/l*77.5%
Simplified77.5%
Taylor expanded in a around 0 83.2%
if 2.4999999999999999e-70 < a Initial program 83.7%
associate-*l/94.5%
Simplified94.5%
Taylor expanded in t around 0 79.5%
associate-/l*86.3%
Simplified86.3%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -6.5e+195) (and (not (<= y -2.9e+103)) (<= y 1.68e+233))) (+ x y) (* y (/ z t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.5e+195) || (!(y <= -2.9e+103) && (y <= 1.68e+233))) {
tmp = x + y;
} else {
tmp = y * (z / 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 ((y <= (-6.5d+195)) .or. (.not. (y <= (-2.9d+103))) .and. (y <= 1.68d+233)) then
tmp = x + y
else
tmp = y * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.5e+195) || (!(y <= -2.9e+103) && (y <= 1.68e+233))) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -6.5e+195) or (not (y <= -2.9e+103) and (y <= 1.68e+233)): tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -6.5e+195) || (!(y <= -2.9e+103) && (y <= 1.68e+233))) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -6.5e+195) || (~((y <= -2.9e+103)) && (y <= 1.68e+233))) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -6.5e+195], And[N[Not[LessEqual[y, -2.9e+103]], $MachinePrecision], LessEqual[y, 1.68e+233]]], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+195} \lor \neg \left(y \leq -2.9 \cdot 10^{+103}\right) \land y \leq 1.68 \cdot 10^{+233}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if y < -6.5000000000000003e195 or -2.8999999999999998e103 < y < 1.67999999999999993e233Initial program 82.1%
associate-*l/87.0%
Simplified87.0%
Taylor expanded in a around inf 68.2%
+-commutative68.2%
Simplified68.2%
if -6.5000000000000003e195 < y < -2.8999999999999998e103 or 1.67999999999999993e233 < y Initial program 60.3%
associate-*l/73.4%
Simplified73.4%
Taylor expanded in t around inf 61.2%
sub-neg61.2%
mul-1-neg61.2%
unsub-neg61.2%
associate-/l*51.9%
mul-1-neg51.9%
remove-double-neg51.9%
associate-/l*60.6%
Simplified60.6%
Taylor expanded in y around inf 63.1%
Taylor expanded in z around inf 54.9%
Final simplification66.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.65e-61) (not (<= a 1.82e-72))) (- (+ x y) (* y (/ z a))) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.65e-61) || !(a <= 1.82e-72)) {
tmp = (x + y) - (y * (z / a));
} 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 <= (-2.65d-61)) .or. (.not. (a <= 1.82d-72))) then
tmp = (x + y) - (y * (z / a))
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 <= -2.65e-61) || !(a <= 1.82e-72)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.65e-61) or not (a <= 1.82e-72): tmp = (x + y) - (y * (z / a)) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.65e-61) || !(a <= 1.82e-72)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); 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 <= -2.65e-61) || ~((a <= 1.82e-72))) tmp = (x + y) - (y * (z / a)); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.65e-61], N[Not[LessEqual[a, 1.82e-72]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.65 \cdot 10^{-61} \lor \neg \left(a \leq 1.82 \cdot 10^{-72}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -2.65e-61 or 1.8200000000000001e-72 < a Initial program 79.8%
associate-*l/89.5%
Simplified89.5%
Taylor expanded in t around 0 83.3%
if -2.65e-61 < a < 1.8200000000000001e-72Initial program 76.7%
associate-*l/78.3%
Simplified78.3%
Taylor expanded in t around inf 82.8%
sub-neg82.8%
mul-1-neg82.8%
unsub-neg82.8%
associate-/l*76.6%
mul-1-neg76.6%
remove-double-neg76.6%
associate-/l*78.5%
Simplified78.5%
Taylor expanded in a around 0 77.4%
associate-*l/79.4%
*-commutative79.4%
Simplified79.4%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -7.5e-61) (- (+ x y) (* y (/ z a))) (if (<= a 2e-72) (+ x (* z (/ y t))) (- (+ x y) (/ y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.5e-61) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 2e-72) {
tmp = x + (z * (y / 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 (a <= (-7.5d-61)) then
tmp = (x + y) - (y * (z / a))
else if (a <= 2d-72) then
tmp = x + (z * (y / 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 (a <= -7.5e-61) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 2e-72) {
tmp = x + (z * (y / t));
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.5e-61: tmp = (x + y) - (y * (z / a)) elif a <= 2e-72: tmp = x + (z * (y / t)) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.5e-61) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= 2e-72) tmp = Float64(x + Float64(z * Float64(y / 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 (a <= -7.5e-61) tmp = (x + y) - (y * (z / a)); elseif (a <= 2e-72) tmp = x + (z * (y / t)); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.5e-61], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2e-72], N[(x + N[(z * N[(y / 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}\;a \leq -7.5 \cdot 10^{-61}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-72}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -7.50000000000000047e-61Initial program 76.1%
associate-*l/84.8%
Simplified84.8%
Taylor expanded in t around 0 80.4%
if -7.50000000000000047e-61 < a < 1.9999999999999999e-72Initial program 76.7%
associate-*l/78.3%
Simplified78.3%
Taylor expanded in t around inf 82.8%
sub-neg82.8%
mul-1-neg82.8%
unsub-neg82.8%
associate-/l*76.6%
mul-1-neg76.6%
remove-double-neg76.6%
associate-/l*78.5%
Simplified78.5%
Taylor expanded in a around 0 77.4%
associate-*l/79.4%
*-commutative79.4%
Simplified79.4%
if 1.9999999999999999e-72 < a Initial program 83.7%
associate-*l/94.5%
Simplified94.5%
Taylor expanded in t around 0 79.5%
associate-/l*86.3%
Simplified86.3%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -7.8e-20) (- (+ x y) (* y (/ z a))) (if (<= a 2.5e-68) (+ x (/ y (/ t (- z a)))) (- (+ x y) (/ y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.8e-20) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 2.5e-68) {
tmp = x + (y / (t / (z - a)));
} 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 (a <= (-7.8d-20)) then
tmp = (x + y) - (y * (z / a))
else if (a <= 2.5d-68) then
tmp = x + (y / (t / (z - a)))
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 (a <= -7.8e-20) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 2.5e-68) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.8e-20: tmp = (x + y) - (y * (z / a)) elif a <= 2.5e-68: tmp = x + (y / (t / (z - a))) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.8e-20) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= 2.5e-68) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); 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 (a <= -7.8e-20) tmp = (x + y) - (y * (z / a)); elseif (a <= 2.5e-68) tmp = x + (y / (t / (z - a))); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.8e-20], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e-68], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{-20}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-68}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -7.80000000000000014e-20Initial program 78.9%
associate-*l/89.4%
Simplified89.4%
Taylor expanded in t around 0 85.6%
if -7.80000000000000014e-20 < a < 2.49999999999999986e-68Initial program 75.3%
sub-neg75.3%
distribute-frac-neg75.3%
distribute-rgt-neg-out75.3%
+-commutative75.3%
associate-*l/76.7%
distribute-rgt-neg-in76.7%
distribute-lft-neg-in76.7%
distribute-frac-neg76.7%
fma-def76.7%
sub-neg76.7%
distribute-neg-in76.7%
remove-double-neg76.7%
+-commutative76.7%
sub-neg76.7%
Simplified76.7%
Taylor expanded in t around inf 69.8%
associate-+r+81.5%
distribute-rgt1-in81.5%
metadata-eval81.5%
mul0-lft81.5%
associate-/l*83.1%
Simplified83.1%
if 2.49999999999999986e-68 < a Initial program 83.7%
associate-*l/94.5%
Simplified94.5%
Taylor expanded in t around 0 79.5%
associate-/l*86.3%
Simplified86.3%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.6e+109) (* y (- 1.0 (/ z a))) (if (<= y 2.8e+234) (+ x y) (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.6e+109) {
tmp = y * (1.0 - (z / a));
} else if (y <= 2.8e+234) {
tmp = x + y;
} else {
tmp = y * (z / 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 (y <= (-5.6d+109)) then
tmp = y * (1.0d0 - (z / a))
else if (y <= 2.8d+234) then
tmp = x + y
else
tmp = y * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.6e+109) {
tmp = y * (1.0 - (z / a));
} else if (y <= 2.8e+234) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.6e+109: tmp = y * (1.0 - (z / a)) elif y <= 2.8e+234: tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.6e+109) tmp = Float64(y * Float64(1.0 - Float64(z / a))); elseif (y <= 2.8e+234) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.6e+109) tmp = y * (1.0 - (z / a)); elseif (y <= 2.8e+234) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.6e+109], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+234], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+109}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+234}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if y < -5.6000000000000004e109Initial program 47.5%
associate-*l/76.5%
Simplified76.5%
Taylor expanded in t around 0 63.2%
Taylor expanded in x around 0 42.6%
associate-*r/56.0%
*-commutative56.0%
cancel-sign-sub-inv56.0%
*-lft-identity56.0%
distribute-rgt-in56.0%
sub-neg56.0%
Simplified56.0%
if -5.6000000000000004e109 < y < 2.7999999999999998e234Initial program 86.7%
associate-*l/87.7%
Simplified87.7%
Taylor expanded in a around inf 68.9%
+-commutative68.9%
Simplified68.9%
if 2.7999999999999998e234 < y Initial program 64.6%
associate-*l/73.3%
Simplified73.3%
Taylor expanded in t around inf 72.1%
sub-neg72.1%
mul-1-neg72.1%
unsub-neg72.1%
associate-/l*53.2%
mul-1-neg53.2%
remove-double-neg53.2%
associate-/l*57.7%
Simplified57.7%
Taylor expanded in y around inf 71.8%
Taylor expanded in z around inf 58.1%
Final simplification65.9%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.85e-101) x (if (<= x 7.3e-183) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.85e-101) {
tmp = x;
} else if (x <= 7.3e-183) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-2.85d-101)) then
tmp = x
else if (x <= 7.3d-183) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.85e-101) {
tmp = x;
} else if (x <= 7.3e-183) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.85e-101: tmp = x elif x <= 7.3e-183: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.85e-101) tmp = x; elseif (x <= 7.3e-183) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.85e-101) tmp = x; elseif (x <= 7.3e-183) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.85e-101], x, If[LessEqual[x, 7.3e-183], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.85 \cdot 10^{-101}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.3 \cdot 10^{-183}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.84999999999999992e-101 or 7.29999999999999998e-183 < x Initial program 80.9%
associate-*l/87.8%
Simplified87.8%
Taylor expanded in x around inf 57.6%
if -2.84999999999999992e-101 < x < 7.29999999999999998e-183Initial program 71.5%
associate-*l/75.9%
Simplified75.9%
Taylor expanded in t around 0 57.0%
Taylor expanded in x around 0 48.5%
Taylor expanded in z around 0 36.8%
Final simplification52.1%
(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 78.5%
associate-*l/84.7%
Simplified84.7%
Taylor expanded in a around inf 60.6%
+-commutative60.6%
Simplified60.6%
Final simplification60.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 78.5%
associate-*l/84.7%
Simplified84.7%
Taylor expanded in x around inf 46.2%
Final simplification46.2%
(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 2024020
(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))))