
(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 14 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 (or (<= t_1 -2e-238) (not (<= t_1 0.0)))
(fma (- z t) (/ y (- t a)) (+ x y))
(+ x (* y (/ (- z 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 <= -2e-238) || !(t_1 <= 0.0)) {
tmp = fma((z - t), (y / (t - a)), (x + y));
} else {
tmp = x + (y * ((z - a) / t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -2e-238) || !(t_1 <= 0.0)) tmp = fma(Float64(z - t), Float64(y / Float64(t - a)), Float64(x + y)); else tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); 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[Or[LessEqual[t$95$1, -2e-238], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $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 -2 \cdot 10^{-238} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2e-238 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 82.0%
sub-neg82.0%
+-commutative82.0%
distribute-frac-neg82.0%
distribute-rgt-neg-out82.0%
associate-/l*91.5%
fma-define91.5%
distribute-frac-neg91.5%
distribute-neg-frac291.5%
sub-neg91.5%
distribute-neg-in91.5%
remove-double-neg91.5%
+-commutative91.5%
sub-neg91.5%
Simplified91.5%
if -2e-238 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 3.8%
Taylor expanded in t around -inf 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.8%
associate-*r/99.8%
Simplified99.8%
Final simplification92.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (/ (+ (/ (- z t) (/ (- t a) y)) (+ x y)) x)))
(t_2 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e-238)
t_2
(if (<= t_2 0.0)
(+ x (* y (/ (- z a) t)))
(if (<= t_2 1e+293) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * ((((z - t) / ((t - a) / y)) + (x + y)) / x);
double t_2 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e-238) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = x + (y * ((z - a) / t));
} else if (t_2 <= 1e+293) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * ((((z - t) / ((t - a) / y)) + (x + y)) / x);
double t_2 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -2e-238) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = x + (y * ((z - a) / t));
} else if (t_2 <= 1e+293) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * ((((z - t) / ((t - a) / y)) + (x + y)) / x) t_2 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -2e-238: tmp = t_2 elif t_2 <= 0.0: tmp = x + (y * ((z - a) / t)) elif t_2 <= 1e+293: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(Float64(Float64(Float64(z - t) / Float64(Float64(t - a) / y)) + Float64(x + y)) / x)) t_2 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e-238) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); elseif (t_2 <= 1e+293) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * ((((z - t) / ((t - a) / y)) + (x + y)) / x); t_2 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -2e-238) tmp = t_2; elseif (t_2 <= 0.0) tmp = x + (y * ((z - a) / t)); elseif (t_2 <= 1e+293) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(N[(N[(z - t), $MachinePrecision] / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e-238], t$95$2, If[LessEqual[t$95$2, 0.0], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+293], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{z - t}{\frac{t - a}{y}} + \left(x + y\right)}{x}\\
t_2 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-238}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{elif}\;t\_2 \leq 10^{+293}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or 9.9999999999999992e292 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 41.2%
sub-neg41.2%
+-commutative41.2%
distribute-frac-neg41.2%
distribute-rgt-neg-out41.2%
associate-/l*80.1%
fma-define80.2%
distribute-frac-neg80.2%
distribute-neg-frac280.2%
sub-neg80.2%
distribute-neg-in80.2%
remove-double-neg80.2%
+-commutative80.2%
sub-neg80.2%
Simplified80.2%
clear-num80.1%
inv-pow80.1%
Applied egg-rr80.1%
unpow-180.1%
Simplified80.1%
Taylor expanded in x around -inf 41.2%
associate-*r*41.2%
neg-mul-141.2%
fma-neg41.2%
*-commutative41.2%
associate-*r/76.2%
*-commutative76.2%
metadata-eval76.2%
Simplified76.2%
Taylor expanded in x around 0 41.2%
distribute-lft-out41.2%
associate-+r+41.2%
associate-*r/72.3%
*-commutative72.3%
associate-/r/72.3%
Simplified72.3%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2e-238 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.9999999999999992e292Initial program 98.5%
if -2e-238 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 3.8%
Taylor expanded in t around -inf 99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.8%
associate-*r/99.8%
Simplified99.8%
Final simplification91.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.5e+89)
(- (* y (/ z t)) (- (* a (/ y t)) x))
(if (<= t 1.02e+86)
(+ (+ x y) (/ (* y (- z t)) (- t a)))
(- x (* y (/ (- a z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e+89) {
tmp = (y * (z / t)) - ((a * (y / t)) - x);
} else if (t <= 1.02e+86) {
tmp = (x + y) + ((y * (z - t)) / (t - a));
} else {
tmp = x - (y * ((a - 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 (t <= (-4.5d+89)) then
tmp = (y * (z / t)) - ((a * (y / t)) - x)
else if (t <= 1.02d+86) then
tmp = (x + y) + ((y * (z - t)) / (t - a))
else
tmp = x - (y * ((a - 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 (t <= -4.5e+89) {
tmp = (y * (z / t)) - ((a * (y / t)) - x);
} else if (t <= 1.02e+86) {
tmp = (x + y) + ((y * (z - t)) / (t - a));
} else {
tmp = x - (y * ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.5e+89: tmp = (y * (z / t)) - ((a * (y / t)) - x) elif t <= 1.02e+86: tmp = (x + y) + ((y * (z - t)) / (t - a)) else: tmp = x - (y * ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.5e+89) tmp = Float64(Float64(y * Float64(z / t)) - Float64(Float64(a * Float64(y / t)) - x)); elseif (t <= 1.02e+86) tmp = Float64(Float64(x + y) + Float64(Float64(y * Float64(z - t)) / Float64(t - a))); else tmp = Float64(x - Float64(y * Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.5e+89) tmp = (y * (z / t)) - ((a * (y / t)) - x); elseif (t <= 1.02e+86) tmp = (x + y) + ((y * (z - t)) / (t - a)); else tmp = x - (y * ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.5e+89], N[(N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e+86], N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+89}:\\
\;\;\;\;y \cdot \frac{z}{t} - \left(a \cdot \frac{y}{t} - x\right)\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+86}:\\
\;\;\;\;\left(x + y\right) + \frac{y \cdot \left(z - t\right)}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{a - z}{t}\\
\end{array}
\end{array}
if t < -4.5e89Initial program 62.0%
Taylor expanded in t around inf 75.5%
sub-neg75.5%
mul-1-neg75.5%
unsub-neg75.5%
associate-/l*82.5%
mul-1-neg82.5%
remove-double-neg82.5%
associate-/l*88.8%
Simplified88.8%
if -4.5e89 < t < 1.01999999999999996e86Initial program 88.2%
if 1.01999999999999996e86 < t Initial program 52.6%
Taylor expanded in t around -inf 80.5%
mul-1-neg80.5%
unsub-neg80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in y around 0 80.9%
associate-*r/85.9%
Simplified85.9%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e-59) (not (<= t 56000000.0))) (+ x (* y (/ (- z a) t))) (- (+ x y) (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e-59) || !(t <= 56000000.0)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) - ((y * z) / a);
}
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 <= (-9d-59)) .or. (.not. (t <= 56000000.0d0))) then
tmp = x + (y * ((z - a) / t))
else
tmp = (x + y) - ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e-59) || !(t <= 56000000.0)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) - ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e-59) or not (t <= 56000000.0): tmp = x + (y * ((z - a) / t)) else: tmp = (x + y) - ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e-59) || !(t <= 56000000.0)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = Float64(Float64(x + y) - Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9e-59) || ~((t <= 56000000.0))) tmp = x + (y * ((z - a) / t)); else tmp = (x + y) - ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e-59], N[Not[LessEqual[t, 56000000.0]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{-59} \lor \neg \left(t \leq 56000000\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -9.00000000000000023e-59 or 5.6e7 < t Initial program 64.1%
Taylor expanded in t around -inf 72.7%
mul-1-neg72.7%
unsub-neg72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in y around 0 73.7%
associate-*r/79.4%
Simplified79.4%
if -9.00000000000000023e-59 < t < 5.6e7Initial program 93.1%
Taylor expanded in t around 0 85.7%
Final simplification82.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.2e+28) (not (<= a 8.8e-13))) (+ x y) (+ x (* y (/ (- z a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e+28) || !(a <= 8.8e-13)) {
tmp = x + y;
} else {
tmp = x + (y * ((z - a) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-6.2d+28)) .or. (.not. (a <= 8.8d-13))) then
tmp = x + y
else
tmp = x + (y * ((z - a) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e+28) || !(a <= 8.8e-13)) {
tmp = x + y;
} else {
tmp = x + (y * ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.2e+28) or not (a <= 8.8e-13): tmp = x + y else: tmp = x + (y * ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.2e+28) || !(a <= 8.8e-13)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6.2e+28) || ~((a <= 8.8e-13))) tmp = x + y; else tmp = x + (y * ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.2e+28], N[Not[LessEqual[a, 8.8e-13]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+28} \lor \neg \left(a \leq 8.8 \cdot 10^{-13}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
if a < -6.2000000000000001e28 or 8.79999999999999986e-13 < a Initial program 79.8%
sub-neg79.8%
+-commutative79.8%
distribute-frac-neg79.8%
distribute-rgt-neg-out79.8%
associate-/l*95.2%
fma-define95.1%
distribute-frac-neg95.1%
distribute-neg-frac295.1%
sub-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
+-commutative95.1%
sub-neg95.1%
Simplified95.1%
Taylor expanded in a around inf 81.6%
+-commutative81.6%
Simplified81.6%
if -6.2000000000000001e28 < a < 8.79999999999999986e-13Initial program 74.8%
Taylor expanded in t around -inf 78.4%
mul-1-neg78.4%
unsub-neg78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y around 0 78.4%
associate-*r/78.5%
Simplified78.5%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -8.2e-59) (- (* y (/ z t)) (- (* a (/ y t)) x)) (if (<= t 2500000.0) (- (+ x y) (/ (* y z) a)) (- x (* y (/ (- a z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.2e-59) {
tmp = (y * (z / t)) - ((a * (y / t)) - x);
} else if (t <= 2500000.0) {
tmp = (x + y) - ((y * z) / a);
} else {
tmp = x - (y * ((a - 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 (t <= (-8.2d-59)) then
tmp = (y * (z / t)) - ((a * (y / t)) - x)
else if (t <= 2500000.0d0) then
tmp = (x + y) - ((y * z) / a)
else
tmp = x - (y * ((a - 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 (t <= -8.2e-59) {
tmp = (y * (z / t)) - ((a * (y / t)) - x);
} else if (t <= 2500000.0) {
tmp = (x + y) - ((y * z) / a);
} else {
tmp = x - (y * ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.2e-59: tmp = (y * (z / t)) - ((a * (y / t)) - x) elif t <= 2500000.0: tmp = (x + y) - ((y * z) / a) else: tmp = x - (y * ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.2e-59) tmp = Float64(Float64(y * Float64(z / t)) - Float64(Float64(a * Float64(y / t)) - x)); elseif (t <= 2500000.0) tmp = Float64(Float64(x + y) - Float64(Float64(y * z) / a)); else tmp = Float64(x - Float64(y * Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.2e-59) tmp = (y * (z / t)) - ((a * (y / t)) - x); elseif (t <= 2500000.0) tmp = (x + y) - ((y * z) / a); else tmp = x - (y * ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.2e-59], N[(N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2500000.0], N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{-59}:\\
\;\;\;\;y \cdot \frac{z}{t} - \left(a \cdot \frac{y}{t} - x\right)\\
\mathbf{elif}\;t \leq 2500000:\\
\;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{a - z}{t}\\
\end{array}
\end{array}
if t < -8.1999999999999991e-59Initial program 68.6%
Taylor expanded in t around inf 70.6%
sub-neg70.6%
mul-1-neg70.6%
unsub-neg70.6%
associate-/l*75.9%
mul-1-neg75.9%
remove-double-neg75.9%
associate-/l*80.3%
Simplified80.3%
if -8.1999999999999991e-59 < t < 2.5e6Initial program 93.1%
Taylor expanded in t around 0 85.7%
if 2.5e6 < t Initial program 58.0%
Taylor expanded in t around -inf 75.7%
mul-1-neg75.7%
unsub-neg75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in y around 0 76.0%
associate-*r/81.2%
Simplified81.2%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3e-36) (not (<= a 7e-64))) (+ x y) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e-36) || !(a <= 7e-64)) {
tmp = x + y;
} else {
tmp = x + ((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 ((a <= (-3d-36)) .or. (.not. (a <= 7d-64))) then
tmp = x + y
else
tmp = x + ((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 ((a <= -3e-36) || !(a <= 7e-64)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3e-36) or not (a <= 7e-64): tmp = x + y else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3e-36) || !(a <= 7e-64)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3e-36) || ~((a <= 7e-64))) tmp = x + y; else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3e-36], N[Not[LessEqual[a, 7e-64]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{-36} \lor \neg \left(a \leq 7 \cdot 10^{-64}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -3.0000000000000002e-36 or 7.0000000000000006e-64 < a Initial program 78.6%
sub-neg78.6%
+-commutative78.6%
distribute-frac-neg78.6%
distribute-rgt-neg-out78.6%
associate-/l*92.0%
fma-define92.0%
distribute-frac-neg92.0%
distribute-neg-frac292.0%
sub-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
+-commutative92.0%
sub-neg92.0%
Simplified92.0%
Taylor expanded in a around inf 76.8%
+-commutative76.8%
Simplified76.8%
if -3.0000000000000002e-36 < a < 7.0000000000000006e-64Initial program 75.2%
Taylor expanded in t around -inf 81.4%
mul-1-neg81.4%
unsub-neg81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in a around 0 78.3%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -6.4e+103) (not (<= y 5.2e+203))) (* z (/ y (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.4e+103) || !(y <= 5.2e+203)) {
tmp = z * (y / (t - 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 ((y <= (-6.4d+103)) .or. (.not. (y <= 5.2d+203))) then
tmp = z * (y / (t - 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 ((y <= -6.4e+103) || !(y <= 5.2e+203)) {
tmp = z * (y / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -6.4e+103) or not (y <= 5.2e+203): tmp = z * (y / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -6.4e+103) || !(y <= 5.2e+203)) tmp = Float64(z * Float64(y / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -6.4e+103) || ~((y <= 5.2e+203))) tmp = z * (y / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -6.4e+103], N[Not[LessEqual[y, 5.2e+203]], $MachinePrecision]], N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+103} \lor \neg \left(y \leq 5.2 \cdot 10^{+203}\right):\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -6.39999999999999985e103 or 5.1999999999999997e203 < y Initial program 48.0%
sub-neg48.0%
+-commutative48.0%
distribute-frac-neg48.0%
distribute-rgt-neg-out48.0%
associate-/l*67.7%
fma-define67.9%
distribute-frac-neg67.9%
distribute-neg-frac267.9%
sub-neg67.9%
distribute-neg-in67.9%
remove-double-neg67.9%
+-commutative67.9%
sub-neg67.9%
Simplified67.9%
Taylor expanded in z around inf 41.8%
*-commutative41.8%
*-lft-identity41.8%
times-frac54.9%
/-rgt-identity54.9%
Simplified54.9%
if -6.39999999999999985e103 < y < 5.1999999999999997e203Initial program 86.7%
sub-neg86.7%
+-commutative86.7%
distribute-frac-neg86.7%
distribute-rgt-neg-out86.7%
associate-/l*91.9%
fma-define92.0%
distribute-frac-neg92.0%
distribute-neg-frac292.0%
sub-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
+-commutative92.0%
sub-neg92.0%
Simplified92.0%
Taylor expanded in a around inf 74.2%
+-commutative74.2%
Simplified74.2%
Final simplification69.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -5e+103) (not (<= y 1.12e+204))) (* y (/ z (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -5e+103) || !(y <= 1.12e+204)) {
tmp = y * (z / (t - 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 ((y <= (-5d+103)) .or. (.not. (y <= 1.12d+204))) then
tmp = y * (z / (t - 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 ((y <= -5e+103) || !(y <= 1.12e+204)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -5e+103) or not (y <= 1.12e+204): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -5e+103) || !(y <= 1.12e+204)) tmp = Float64(y * Float64(z / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -5e+103) || ~((y <= 1.12e+204))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -5e+103], N[Not[LessEqual[y, 1.12e+204]], $MachinePrecision]], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+103} \lor \neg \left(y \leq 1.12 \cdot 10^{+204}\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -5e103 or 1.11999999999999996e204 < y Initial program 48.0%
sub-neg48.0%
+-commutative48.0%
distribute-frac-neg48.0%
distribute-rgt-neg-out48.0%
associate-/l*67.7%
fma-define67.9%
distribute-frac-neg67.9%
distribute-neg-frac267.9%
sub-neg67.9%
distribute-neg-in67.9%
remove-double-neg67.9%
+-commutative67.9%
sub-neg67.9%
Simplified67.9%
Taylor expanded in z around inf 41.8%
associate-/l*53.5%
Simplified53.5%
if -5e103 < y < 1.11999999999999996e204Initial program 86.7%
sub-neg86.7%
+-commutative86.7%
distribute-frac-neg86.7%
distribute-rgt-neg-out86.7%
associate-/l*91.9%
fma-define92.0%
distribute-frac-neg92.0%
distribute-neg-frac292.0%
sub-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
+-commutative92.0%
sub-neg92.0%
Simplified92.0%
Taylor expanded in a around inf 74.2%
+-commutative74.2%
Simplified74.2%
Final simplification69.1%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.5e-118) x (if (<= x 9.2e-119) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.5e-118) {
tmp = x;
} else if (x <= 9.2e-119) {
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 <= (-1.5d-118)) then
tmp = x
else if (x <= 9.2d-119) 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 <= -1.5e-118) {
tmp = x;
} else if (x <= 9.2e-119) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.5e-118: tmp = x elif x <= 9.2e-119: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.5e-118) tmp = x; elseif (x <= 9.2e-119) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.5e-118) tmp = x; elseif (x <= 9.2e-119) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.5e-118], x, If[LessEqual[x, 9.2e-119], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{-118}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-119}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.50000000000000009e-118 or 9.19999999999999973e-119 < x Initial program 78.1%
sub-neg78.1%
+-commutative78.1%
distribute-frac-neg78.1%
distribute-rgt-neg-out78.1%
associate-/l*88.6%
fma-define88.7%
distribute-frac-neg88.7%
distribute-neg-frac288.7%
sub-neg88.7%
distribute-neg-in88.7%
remove-double-neg88.7%
+-commutative88.7%
sub-neg88.7%
Simplified88.7%
clear-num88.6%
inv-pow88.6%
Applied egg-rr88.6%
unpow-188.6%
Simplified88.6%
Taylor expanded in t around inf 67.1%
distribute-rgt1-in67.1%
metadata-eval67.1%
mul0-lft67.1%
+-rgt-identity67.1%
Simplified67.1%
if -1.50000000000000009e-118 < x < 9.19999999999999973e-119Initial program 74.0%
sub-neg74.0%
+-commutative74.0%
distribute-frac-neg74.0%
distribute-rgt-neg-out74.0%
associate-/l*77.2%
fma-define77.4%
distribute-frac-neg77.4%
distribute-neg-frac277.4%
sub-neg77.4%
distribute-neg-in77.4%
remove-double-neg77.4%
+-commutative77.4%
sub-neg77.4%
Simplified77.4%
Taylor expanded in a around inf 42.9%
+-commutative42.9%
Simplified42.9%
Taylor expanded in y around inf 36.5%
(FPCore (x y z t a) :precision binary64 (if (<= y 5.5e+203) (+ x y) (* z (/ y t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 5.5e+203) {
tmp = x + y;
} else {
tmp = 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 (y <= 5.5d+203) then
tmp = x + y
else
tmp = 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 (y <= 5.5e+203) {
tmp = x + y;
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 5.5e+203: tmp = x + y else: tmp = z * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 5.5e+203) tmp = Float64(x + y); else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 5.5e+203) tmp = x + y; else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 5.5e+203], N[(x + y), $MachinePrecision], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.5 \cdot 10^{+203}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < 5.50000000000000029e203Initial program 78.8%
sub-neg78.8%
+-commutative78.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*87.4%
fma-define87.5%
distribute-frac-neg87.5%
distribute-neg-frac287.5%
sub-neg87.5%
distribute-neg-in87.5%
remove-double-neg87.5%
+-commutative87.5%
sub-neg87.5%
Simplified87.5%
Taylor expanded in a around inf 66.7%
+-commutative66.7%
Simplified66.7%
if 5.50000000000000029e203 < y Initial program 52.6%
sub-neg52.6%
+-commutative52.6%
distribute-frac-neg52.6%
distribute-rgt-neg-out52.6%
associate-/l*64.7%
fma-define65.7%
distribute-frac-neg65.7%
distribute-neg-frac265.7%
sub-neg65.7%
distribute-neg-in65.7%
remove-double-neg65.7%
+-commutative65.7%
sub-neg65.7%
Simplified65.7%
Taylor expanded in z around inf 58.1%
*-commutative58.1%
*-lft-identity58.1%
times-frac69.9%
/-rgt-identity69.9%
Simplified69.9%
Taylor expanded in t around inf 45.5%
*-commutative45.5%
associate-/l*51.4%
Simplified51.4%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (if (<= y 7e+203) (+ x y) (* y (/ z t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 7e+203) {
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 <= 7d+203) 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 <= 7e+203) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 7e+203: tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 7e+203) 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 <= 7e+203) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 7e+203], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{+203}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if y < 7.00000000000000062e203Initial program 78.8%
sub-neg78.8%
+-commutative78.8%
distribute-frac-neg78.8%
distribute-rgt-neg-out78.8%
associate-/l*87.4%
fma-define87.5%
distribute-frac-neg87.5%
distribute-neg-frac287.5%
sub-neg87.5%
distribute-neg-in87.5%
remove-double-neg87.5%
+-commutative87.5%
sub-neg87.5%
Simplified87.5%
Taylor expanded in a around inf 66.7%
+-commutative66.7%
Simplified66.7%
if 7.00000000000000062e203 < y Initial program 52.6%
Taylor expanded in t around -inf 57.3%
mul-1-neg57.3%
unsub-neg57.3%
*-commutative57.3%
Simplified57.3%
Taylor expanded in a around 0 51.4%
Taylor expanded in x around 0 45.5%
associate-*r/51.2%
Simplified51.2%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.8e+100) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.8e+100) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 4.8d+100) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.8e+100) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.8e+100: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.8e+100) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4.8e+100) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.8e+100], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{+100}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < 4.80000000000000023e100Initial program 82.0%
sub-neg82.0%
+-commutative82.0%
distribute-frac-neg82.0%
distribute-rgt-neg-out82.0%
associate-/l*89.3%
fma-define89.4%
distribute-frac-neg89.4%
distribute-neg-frac289.4%
sub-neg89.4%
distribute-neg-in89.4%
remove-double-neg89.4%
+-commutative89.4%
sub-neg89.4%
Simplified89.4%
Taylor expanded in a around inf 64.2%
+-commutative64.2%
Simplified64.2%
if 4.80000000000000023e100 < t Initial program 53.8%
sub-neg53.8%
+-commutative53.8%
distribute-frac-neg53.8%
distribute-rgt-neg-out53.8%
associate-/l*69.9%
fma-define70.2%
distribute-frac-neg70.2%
distribute-neg-frac270.2%
sub-neg70.2%
distribute-neg-in70.2%
remove-double-neg70.2%
+-commutative70.2%
sub-neg70.2%
Simplified70.2%
clear-num70.2%
inv-pow70.2%
Applied egg-rr70.2%
unpow-170.2%
Simplified70.2%
Taylor expanded in t around inf 72.8%
distribute-rgt1-in72.8%
metadata-eval72.8%
mul0-lft72.8%
+-rgt-identity72.8%
Simplified72.8%
Final simplification65.7%
(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.1%
sub-neg77.1%
+-commutative77.1%
distribute-frac-neg77.1%
distribute-rgt-neg-out77.1%
associate-/l*86.0%
fma-define86.1%
distribute-frac-neg86.1%
distribute-neg-frac286.1%
sub-neg86.1%
distribute-neg-in86.1%
remove-double-neg86.1%
+-commutative86.1%
sub-neg86.1%
Simplified86.1%
clear-num85.7%
inv-pow85.7%
Applied egg-rr85.7%
unpow-185.7%
Simplified85.7%
Taylor expanded in t around inf 55.2%
distribute-rgt1-in55.2%
metadata-eval55.2%
mul0-lft55.2%
+-rgt-identity55.2%
Simplified55.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 2024132
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -13664970889390727/100000000000000000000000) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 14754293444577233/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)))))
(- (+ x y) (/ (* (- z t) y) (- a t))))