
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (<= t_1 -2e-271)
(fma (/ (- t z) (- a t)) y (+ x y))
(if (<= t_1 0.0)
(+ x (/ (- (* y z) (* y a)) t))
(if (<= t_1 1.5e+172) t_1 (- (+ x y) (/ (- z t) (/ (- a t) y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_1 <= -2e-271) {
tmp = fma(((t - z) / (a - t)), y, (x + y));
} else if (t_1 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_1 <= 1.5e+172) {
tmp = t_1;
} else {
tmp = (x + y) - ((z - t) / ((a - t) / y));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_1 <= -2e-271) tmp = fma(Float64(Float64(t - z) / Float64(a - t)), y, Float64(x + y)); elseif (t_1 <= 0.0) tmp = Float64(x + Float64(Float64(Float64(y * z) - Float64(y * a)) / t)); elseif (t_1 <= 1.5e+172) tmp = t_1; else tmp = Float64(Float64(x + y) - Float64(Float64(z - t) / Float64(Float64(a - t) / y))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-271], N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(x + N[(N[(N[(y * z), $MachinePrecision] - N[(y * a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.5e+172], t$95$1, N[(N[(x + y), $MachinePrecision] - N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-271}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a - t}, y, x + y\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot a}{t}\\
\mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.99999999999999993e-271Initial program 87.5%
sub-neg87.5%
distribute-frac-neg87.5%
distribute-rgt-neg-out87.5%
+-commutative87.5%
associate-*l/90.0%
distribute-rgt-neg-in90.0%
distribute-lft-neg-in90.0%
distribute-frac-neg90.0%
fma-def90.0%
sub-neg90.0%
distribute-neg-in90.0%
remove-double-neg90.0%
+-commutative90.0%
sub-neg90.0%
Simplified90.0%
if -1.99999999999999993e-271 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.9%
associate-*l/4.9%
Simplified4.9%
Taylor expanded in t around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
Simplified100.0%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.5e172Initial program 99.5%
if 1.5e172 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 70.8%
associate-*l/82.3%
Simplified82.3%
associate-/r/87.2%
Applied egg-rr87.2%
Final simplification92.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- t z) (- a t))))
(t_2 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (<= t_2 -2e-271)
(+ (+ x y) t_1)
(if (<= t_2 0.0)
(+ x (/ (- (* y z) (* y a)) t))
(if (<= t_2 2e+304) t_2 (+ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - z) / (a - t));
double t_2 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_2 <= -2e-271) {
tmp = (x + y) + t_1;
} else if (t_2 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_2 <= 2e+304) {
tmp = t_2;
} else {
tmp = y + 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 * ((t - z) / (a - t))
t_2 = (x + y) - ((y * (z - t)) / (a - t))
if (t_2 <= (-2d-271)) then
tmp = (x + y) + t_1
else if (t_2 <= 0.0d0) then
tmp = x + (((y * z) - (y * a)) / t)
else if (t_2 <= 2d+304) then
tmp = t_2
else
tmp = y + 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 * ((t - z) / (a - t));
double t_2 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_2 <= -2e-271) {
tmp = (x + y) + t_1;
} else if (t_2 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_2 <= 2e+304) {
tmp = t_2;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((t - z) / (a - t)) t_2 = (x + y) - ((y * (z - t)) / (a - t)) tmp = 0 if t_2 <= -2e-271: tmp = (x + y) + t_1 elif t_2 <= 0.0: tmp = x + (((y * z) - (y * a)) / t) elif t_2 <= 2e+304: tmp = t_2 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(t - z) / Float64(a - t))) t_2 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -2e-271) tmp = Float64(Float64(x + y) + t_1); elseif (t_2 <= 0.0) tmp = Float64(x + Float64(Float64(Float64(y * z) - Float64(y * a)) / t)); elseif (t_2 <= 2e+304) tmp = t_2; else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((t - z) / (a - t)); t_2 = (x + y) - ((y * (z - t)) / (a - t)); tmp = 0.0; if (t_2 <= -2e-271) tmp = (x + y) + t_1; elseif (t_2 <= 0.0) tmp = x + (((y * z) - (y * a)) / t); elseif (t_2 <= 2e+304) tmp = t_2; else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-271], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(x + N[(N[(N[(y * z), $MachinePrecision] - N[(y * a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+304], t$95$2, N[(y + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t - z}{a - t}\\
t_2 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-271}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot a}{t}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.99999999999999993e-271Initial program 87.5%
associate-*l/90.0%
Simplified90.0%
if -1.99999999999999993e-271 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.9%
associate-*l/4.9%
Simplified4.9%
Taylor expanded in t around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
Simplified100.0%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.9999999999999999e304Initial program 99.5%
if 1.9999999999999999e304 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 35.2%
associate-*l/72.0%
Simplified72.0%
Taylor expanded in x around 0 35.2%
associate-*r/72.0%
Simplified72.0%
Final simplification92.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (<= t_1 -2e-271)
(+ (+ x y) (* y (/ (- t z) (- a t))))
(if (<= t_1 0.0)
(+ x (/ (- (* y z) (* y a)) t))
(if (<= t_1 1.5e+172) t_1 (- (+ x y) (/ (- z t) (/ (- a t) y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_1 <= -2e-271) {
tmp = (x + y) + (y * ((t - z) / (a - t)));
} else if (t_1 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_1 <= 1.5e+172) {
tmp = t_1;
} else {
tmp = (x + y) - ((z - t) / ((a - t) / 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 + y) - ((y * (z - t)) / (a - t))
if (t_1 <= (-2d-271)) then
tmp = (x + y) + (y * ((t - z) / (a - t)))
else if (t_1 <= 0.0d0) then
tmp = x + (((y * z) - (y * a)) / t)
else if (t_1 <= 1.5d+172) then
tmp = t_1
else
tmp = (x + y) - ((z - t) / ((a - t) / 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 + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_1 <= -2e-271) {
tmp = (x + y) + (y * ((t - z) / (a - t)));
} else if (t_1 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_1 <= 1.5e+172) {
tmp = t_1;
} else {
tmp = (x + y) - ((z - t) / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - ((y * (z - t)) / (a - t)) tmp = 0 if t_1 <= -2e-271: tmp = (x + y) + (y * ((t - z) / (a - t))) elif t_1 <= 0.0: tmp = x + (((y * z) - (y * a)) / t) elif t_1 <= 1.5e+172: tmp = t_1 else: tmp = (x + y) - ((z - t) / ((a - t) / y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_1 <= -2e-271) tmp = Float64(Float64(x + y) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); elseif (t_1 <= 0.0) tmp = Float64(x + Float64(Float64(Float64(y * z) - Float64(y * a)) / t)); elseif (t_1 <= 1.5e+172) tmp = t_1; else tmp = Float64(Float64(x + y) - Float64(Float64(z - t) / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - ((y * (z - t)) / (a - t)); tmp = 0.0; if (t_1 <= -2e-271) tmp = (x + y) + (y * ((t - z) / (a - t))); elseif (t_1 <= 0.0) tmp = x + (((y * z) - (y * a)) / t); elseif (t_1 <= 1.5e+172) tmp = t_1; else tmp = (x + y) - ((z - t) / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-271], N[(N[(x + y), $MachinePrecision] + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(x + N[(N[(N[(y * z), $MachinePrecision] - N[(y * a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.5e+172], t$95$1, N[(N[(x + y), $MachinePrecision] - N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-271}:\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{t - z}{a - t}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot a}{t}\\
\mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.99999999999999993e-271Initial program 87.5%
associate-*l/90.0%
Simplified90.0%
if -1.99999999999999993e-271 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.9%
associate-*l/4.9%
Simplified4.9%
Taylor expanded in t around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
Simplified100.0%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.5e172Initial program 99.5%
if 1.5e172 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 70.8%
associate-*l/82.3%
Simplified82.3%
associate-/r/87.2%
Applied egg-rr87.2%
Final simplification92.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ (- a z) t)))))
(if (<= a -2e+21)
(+ x y)
(if (<= a 3e-190)
t_1
(if (<= a 3.3e-125)
(- x (/ a (/ t y)))
(if (<= a 2e-83) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((a - z) / t));
double tmp;
if (a <= -2e+21) {
tmp = x + y;
} else if (a <= 3e-190) {
tmp = t_1;
} else if (a <= 3.3e-125) {
tmp = x - (a / (t / y));
} else if (a <= 2e-83) {
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 - (y * ((a - z) / t))
if (a <= (-2d+21)) then
tmp = x + y
else if (a <= 3d-190) then
tmp = t_1
else if (a <= 3.3d-125) then
tmp = x - (a / (t / y))
else if (a <= 2d-83) 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 - (y * ((a - z) / t));
double tmp;
if (a <= -2e+21) {
tmp = x + y;
} else if (a <= 3e-190) {
tmp = t_1;
} else if (a <= 3.3e-125) {
tmp = x - (a / (t / y));
} else if (a <= 2e-83) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((a - z) / t)) tmp = 0 if a <= -2e+21: tmp = x + y elif a <= 3e-190: tmp = t_1 elif a <= 3.3e-125: tmp = x - (a / (t / y)) elif a <= 2e-83: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(a - z) / t))) tmp = 0.0 if (a <= -2e+21) tmp = Float64(x + y); elseif (a <= 3e-190) tmp = t_1; elseif (a <= 3.3e-125) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (a <= 2e-83) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * ((a - z) / t)); tmp = 0.0; if (a <= -2e+21) tmp = x + y; elseif (a <= 3e-190) tmp = t_1; elseif (a <= 3.3e-125) tmp = x - (a / (t / y)); elseif (a <= 2e-83) 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[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2e+21], N[(x + y), $MachinePrecision], If[LessEqual[a, 3e-190], t$95$1, If[LessEqual[a, 3.3e-125], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2e-83], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{a - z}{t}\\
\mathbf{if}\;a \leq -2 \cdot 10^{+21}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-190}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-125}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -2e21 or 2.0000000000000001e-83 < a Initial program 85.3%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in a around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -2e21 < a < 2.9999999999999998e-190 or 3.3000000000000001e-125 < a < 2.0000000000000001e-83Initial program 73.8%
associate-*l/73.1%
Simplified73.1%
associate-/r/72.2%
Applied egg-rr72.2%
Taylor expanded in t around inf 81.2%
associate--l+81.2%
sub-neg81.2%
mul-1-neg81.2%
distribute-neg-in81.2%
mul-1-neg81.2%
sub-neg81.2%
div-sub82.2%
sub-neg82.2%
*-commutative82.2%
distribute-rgt-neg-in82.2%
distribute-lft-in82.2%
sub-neg82.2%
sub-neg82.2%
associate-*r/84.7%
Simplified84.7%
if 2.9999999999999998e-190 < a < 3.3000000000000001e-125Initial program 75.8%
associate-*l/59.8%
Simplified59.8%
Taylor expanded in t around -inf 52.1%
mul-1-neg52.1%
unsub-neg52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in a around inf 64.6%
associate-/l*71.8%
Simplified71.8%
Final simplification80.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2e+21)
(- (+ x y) (* y (/ z a)))
(if (<= a 3e-190)
(+ x (/ y (/ t (- z a))))
(if (<= a 3.3e-125)
(- x (/ a (/ t y)))
(if (<= a 1.2e-73)
(- x (* y (/ (- a z) t)))
(- (+ x y) (/ y (/ a z))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+21) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 3e-190) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 3.3e-125) {
tmp = x - (a / (t / y));
} else if (a <= 1.2e-73) {
tmp = x - (y * ((a - z) / 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 <= (-2d+21)) then
tmp = (x + y) - (y * (z / a))
else if (a <= 3d-190) then
tmp = x + (y / (t / (z - a)))
else if (a <= 3.3d-125) then
tmp = x - (a / (t / y))
else if (a <= 1.2d-73) then
tmp = x - (y * ((a - z) / 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 <= -2e+21) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 3e-190) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 3.3e-125) {
tmp = x - (a / (t / y));
} else if (a <= 1.2e-73) {
tmp = x - (y * ((a - z) / t));
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2e+21: tmp = (x + y) - (y * (z / a)) elif a <= 3e-190: tmp = x + (y / (t / (z - a))) elif a <= 3.3e-125: tmp = x - (a / (t / y)) elif a <= 1.2e-73: tmp = x - (y * ((a - z) / t)) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e+21) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= 3e-190) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); elseif (a <= 3.3e-125) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (a <= 1.2e-73) tmp = Float64(x - Float64(y * Float64(Float64(a - z) / 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 <= -2e+21) tmp = (x + y) - (y * (z / a)); elseif (a <= 3e-190) tmp = x + (y / (t / (z - a))); elseif (a <= 3.3e-125) tmp = x - (a / (t / y)); elseif (a <= 1.2e-73) tmp = x - (y * ((a - z) / t)); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e+21], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e-190], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e-125], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e-73], N[(x - N[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+21}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-190}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-125}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-73}:\\
\;\;\;\;x - y \cdot \frac{a - z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -2e21Initial program 91.2%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in t around 0 92.8%
if -2e21 < a < 2.9999999999999998e-190Initial program 74.6%
sub-neg74.6%
distribute-frac-neg74.6%
distribute-rgt-neg-out74.6%
+-commutative74.6%
associate-*l/72.9%
distribute-rgt-neg-in72.9%
distribute-lft-neg-in72.9%
distribute-frac-neg72.9%
fma-def72.9%
sub-neg72.9%
distribute-neg-in72.9%
remove-double-neg72.9%
+-commutative72.9%
sub-neg72.9%
Simplified72.9%
Taylor expanded in t around inf 74.2%
neg-mul-174.2%
associate-+r+82.6%
neg-mul-182.6%
distribute-rgt1-in82.6%
metadata-eval82.6%
mul0-lft82.6%
associate-/l*85.4%
Simplified85.4%
if 2.9999999999999998e-190 < a < 3.3000000000000001e-125Initial program 75.8%
associate-*l/59.8%
Simplified59.8%
Taylor expanded in t around -inf 52.1%
mul-1-neg52.1%
unsub-neg52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in a around inf 64.6%
associate-/l*71.8%
Simplified71.8%
if 3.3000000000000001e-125 < a < 1.20000000000000003e-73Initial program 62.0%
associate-*l/71.1%
Simplified71.1%
associate-/r/71.1%
Applied egg-rr71.1%
Taylor expanded in t around inf 71.9%
associate--l+71.9%
sub-neg71.9%
mul-1-neg71.9%
distribute-neg-in71.9%
mul-1-neg71.9%
sub-neg71.9%
div-sub71.9%
sub-neg71.9%
*-commutative71.9%
distribute-rgt-neg-in71.9%
distribute-lft-in71.9%
sub-neg71.9%
sub-neg71.9%
associate-*r/81.0%
Simplified81.0%
if 1.20000000000000003e-73 < a Initial program 82.3%
associate-*l/91.2%
Simplified91.2%
Taylor expanded in t around 0 82.5%
associate-/l*87.8%
Simplified87.8%
Final simplification86.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.2e+175)
(- x (* y (/ (- a z) t)))
(if (<= t 1.25e+194)
(+ (+ x y) (* y (/ (- t z) (- a t))))
(+ x (/ y (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+175) {
tmp = x - (y * ((a - z) / t));
} else if (t <= 1.25e+194) {
tmp = (x + y) + (y * ((t - z) / (a - t)));
} 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 (t <= (-4.2d+175)) then
tmp = x - (y * ((a - z) / t))
else if (t <= 1.25d+194) then
tmp = (x + y) + (y * ((t - z) / (a - t)))
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 (t <= -4.2e+175) {
tmp = x - (y * ((a - z) / t));
} else if (t <= 1.25e+194) {
tmp = (x + y) + (y * ((t - z) / (a - t)));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e+175: tmp = x - (y * ((a - z) / t)) elif t <= 1.25e+194: tmp = (x + y) + (y * ((t - z) / (a - t))) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e+175) tmp = Float64(x - Float64(y * Float64(Float64(a - z) / t))); elseif (t <= 1.25e+194) tmp = Float64(Float64(x + y) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); 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 (t <= -4.2e+175) tmp = x - (y * ((a - z) / t)); elseif (t <= 1.25e+194) tmp = (x + y) + (y * ((t - z) / (a - t))); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e+175], N[(x - N[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+194], N[(N[(x + y), $MachinePrecision] + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+175}:\\
\;\;\;\;x - y \cdot \frac{a - z}{t}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+194}:\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{t - z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if t < -4.1999999999999998e175Initial program 32.0%
associate-*l/39.9%
Simplified39.9%
associate-/r/32.3%
Applied egg-rr32.3%
Taylor expanded in t around inf 85.8%
associate--l+85.8%
sub-neg85.8%
mul-1-neg85.8%
distribute-neg-in85.8%
mul-1-neg85.8%
sub-neg85.8%
div-sub85.8%
sub-neg85.8%
*-commutative85.8%
distribute-rgt-neg-in85.8%
distribute-lft-in85.8%
sub-neg85.8%
sub-neg85.8%
associate-*r/95.1%
Simplified95.1%
if -4.1999999999999998e175 < t < 1.24999999999999997e194Initial program 88.1%
associate-*l/90.3%
Simplified90.3%
if 1.24999999999999997e194 < t Initial program 63.4%
associate-*l/66.6%
Simplified66.6%
Taylor expanded in t around -inf 91.4%
mul-1-neg91.4%
unsub-neg91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in a around 0 91.4%
*-un-lft-identity91.4%
associate-/l*99.9%
Applied egg-rr99.9%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.8e+173) (- x (* y (/ (- a z) t))) (if (<= t 6e+192) (- (+ x y) (/ y (/ (- a t) z))) (+ x (/ y (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.8e+173) {
tmp = x - (y * ((a - z) / t));
} else if (t <= 6e+192) {
tmp = (x + y) - (y / ((a - t) / z));
} 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 (t <= (-6.8d+173)) then
tmp = x - (y * ((a - z) / t))
else if (t <= 6d+192) then
tmp = (x + y) - (y / ((a - t) / z))
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 (t <= -6.8e+173) {
tmp = x - (y * ((a - z) / t));
} else if (t <= 6e+192) {
tmp = (x + y) - (y / ((a - t) / z));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.8e+173: tmp = x - (y * ((a - z) / t)) elif t <= 6e+192: tmp = (x + y) - (y / ((a - t) / z)) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.8e+173) tmp = Float64(x - Float64(y * Float64(Float64(a - z) / t))); elseif (t <= 6e+192) tmp = Float64(Float64(x + y) - Float64(y / Float64(Float64(a - t) / z))); 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 (t <= -6.8e+173) tmp = x - (y * ((a - z) / t)); elseif (t <= 6e+192) tmp = (x + y) - (y / ((a - t) / z)); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.8e+173], N[(x - N[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+192], N[(N[(x + y), $MachinePrecision] - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+173}:\\
\;\;\;\;x - y \cdot \frac{a - z}{t}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+192}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if t < -6.80000000000000042e173Initial program 32.0%
associate-*l/39.9%
Simplified39.9%
associate-/r/32.3%
Applied egg-rr32.3%
Taylor expanded in t around inf 85.8%
associate--l+85.8%
sub-neg85.8%
mul-1-neg85.8%
distribute-neg-in85.8%
mul-1-neg85.8%
sub-neg85.8%
div-sub85.8%
sub-neg85.8%
*-commutative85.8%
distribute-rgt-neg-in85.8%
distribute-lft-in85.8%
sub-neg85.8%
sub-neg85.8%
associate-*r/95.1%
Simplified95.1%
if -6.80000000000000042e173 < t < 6e192Initial program 88.1%
associate-*l/90.3%
Simplified90.3%
associate-/r/89.7%
Applied egg-rr89.7%
Taylor expanded in z around inf 86.3%
associate-/l*88.5%
Simplified88.5%
if 6e192 < t Initial program 63.4%
associate-*l/66.6%
Simplified66.6%
Taylor expanded in t around -inf 91.4%
mul-1-neg91.4%
unsub-neg91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in a around 0 91.4%
*-un-lft-identity91.4%
associate-/l*99.9%
Applied egg-rr99.9%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.1e-19) (- x (* y (/ (- a z) t))) (if (<= t 6000000000000.0) (- (+ x y) (* y (/ z a))) (+ x (/ y (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.1e-19) {
tmp = x - (y * ((a - z) / t));
} else if (t <= 6000000000000.0) {
tmp = (x + y) - (y * (z / a));
} 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 (t <= (-4.1d-19)) then
tmp = x - (y * ((a - z) / t))
else if (t <= 6000000000000.0d0) then
tmp = (x + y) - (y * (z / a))
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 (t <= -4.1e-19) {
tmp = x - (y * ((a - z) / t));
} else if (t <= 6000000000000.0) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.1e-19: tmp = x - (y * ((a - z) / t)) elif t <= 6000000000000.0: tmp = (x + y) - (y * (z / a)) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.1e-19) tmp = Float64(x - Float64(y * Float64(Float64(a - z) / t))); elseif (t <= 6000000000000.0) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); 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 (t <= -4.1e-19) tmp = x - (y * ((a - z) / t)); elseif (t <= 6000000000000.0) tmp = (x + y) - (y * (z / a)); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.1e-19], N[(x - N[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6000000000000.0], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-19}:\\
\;\;\;\;x - y \cdot \frac{a - z}{t}\\
\mathbf{elif}\;t \leq 6000000000000:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if t < -4.09999999999999985e-19Initial program 61.4%
associate-*l/68.7%
Simplified68.7%
associate-/r/62.9%
Applied egg-rr62.9%
Taylor expanded in t around inf 74.9%
associate--l+74.9%
sub-neg74.9%
mul-1-neg74.9%
distribute-neg-in74.9%
mul-1-neg74.9%
sub-neg74.9%
div-sub74.9%
sub-neg74.9%
*-commutative74.9%
distribute-rgt-neg-in74.9%
distribute-lft-in76.5%
sub-neg76.5%
sub-neg76.5%
associate-*r/83.3%
Simplified83.3%
if -4.09999999999999985e-19 < t < 6e12Initial program 92.2%
associate-*l/90.2%
Simplified90.2%
Taylor expanded in t around 0 83.2%
if 6e12 < t Initial program 72.4%
associate-*l/82.6%
Simplified82.6%
Taylor expanded in t around -inf 76.3%
mul-1-neg76.3%
unsub-neg76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in a around 0 77.7%
*-un-lft-identity77.7%
associate-/l*85.0%
Applied egg-rr85.0%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.7e-17) (- x (* y (/ (- a z) t))) (if (<= t 26000000000000.0) (- (+ x y) (/ y (/ a z))) (+ x (/ y (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7e-17) {
tmp = x - (y * ((a - z) / t));
} else if (t <= 26000000000000.0) {
tmp = (x + y) - (y / (a / z));
} 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 (t <= (-2.7d-17)) then
tmp = x - (y * ((a - z) / t))
else if (t <= 26000000000000.0d0) then
tmp = (x + y) - (y / (a / z))
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 (t <= -2.7e-17) {
tmp = x - (y * ((a - z) / t));
} else if (t <= 26000000000000.0) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7e-17: tmp = x - (y * ((a - z) / t)) elif t <= 26000000000000.0: tmp = (x + y) - (y / (a / z)) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7e-17) tmp = Float64(x - Float64(y * Float64(Float64(a - z) / t))); elseif (t <= 26000000000000.0) tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); 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 (t <= -2.7e-17) tmp = x - (y * ((a - z) / t)); elseif (t <= 26000000000000.0) tmp = (x + y) - (y / (a / z)); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e-17], N[(x - N[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 26000000000000.0], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-17}:\\
\;\;\;\;x - y \cdot \frac{a - z}{t}\\
\mathbf{elif}\;t \leq 26000000000000:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if t < -2.7000000000000001e-17Initial program 61.4%
associate-*l/68.7%
Simplified68.7%
associate-/r/62.9%
Applied egg-rr62.9%
Taylor expanded in t around inf 74.9%
associate--l+74.9%
sub-neg74.9%
mul-1-neg74.9%
distribute-neg-in74.9%
mul-1-neg74.9%
sub-neg74.9%
div-sub74.9%
sub-neg74.9%
*-commutative74.9%
distribute-rgt-neg-in74.9%
distribute-lft-in76.5%
sub-neg76.5%
sub-neg76.5%
associate-*r/83.3%
Simplified83.3%
if -2.7000000000000001e-17 < t < 2.6e13Initial program 92.2%
associate-*l/90.2%
Simplified90.2%
Taylor expanded in t around 0 83.0%
associate-/l*83.2%
Simplified83.2%
if 2.6e13 < t Initial program 72.4%
associate-*l/82.6%
Simplified82.6%
Taylor expanded in t around -inf 76.3%
mul-1-neg76.3%
unsub-neg76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in a around 0 77.7%
*-un-lft-identity77.7%
associate-/l*85.0%
Applied egg-rr85.0%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.05e+21) (not (<= a 3.5e-83))) (+ x y) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.05e+21) || !(a <= 3.5e-83)) {
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 <= (-2.05d+21)) .or. (.not. (a <= 3.5d-83))) 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 <= -2.05e+21) || !(a <= 3.5e-83)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.05e+21) or not (a <= 3.5e-83): tmp = x + y else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.05e+21) || !(a <= 3.5e-83)) 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 <= -2.05e+21) || ~((a <= 3.5e-83))) tmp = x + y; else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.05e+21], N[Not[LessEqual[a, 3.5e-83]], $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 -2.05 \cdot 10^{+21} \lor \neg \left(a \leq 3.5 \cdot 10^{-83}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -2.05e21 or 3.5000000000000003e-83 < a Initial program 85.3%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in a around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -2.05e21 < a < 3.5000000000000003e-83Initial program 74.0%
associate-*l/71.8%
Simplified71.8%
Taylor expanded in t around -inf 79.2%
mul-1-neg79.2%
unsub-neg79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in a around 0 74.4%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.1e-20) (not (<= t 2.05e-13))) (+ x (/ y (/ t z))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.1e-20) || !(t <= 2.05e-13)) {
tmp = x + (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.1d-20)) .or. (.not. (t <= 2.05d-13))) then
tmp = x + (y / (t / z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.1e-20) || !(t <= 2.05e-13)) {
tmp = x + (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.1e-20) or not (t <= 2.05e-13): tmp = x + (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.1e-20) || !(t <= 2.05e-13)) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.1e-20) || ~((t <= 2.05e-13))) tmp = x + (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.1e-20], N[Not[LessEqual[t, 2.05e-13]], $MachinePrecision]], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-20} \lor \neg \left(t \leq 2.05 \cdot 10^{-13}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.0999999999999999e-20 or 2.0500000000000001e-13 < t Initial program 66.7%
associate-*l/74.1%
Simplified74.1%
Taylor expanded in t around -inf 74.9%
mul-1-neg74.9%
unsub-neg74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in a around 0 75.1%
*-un-lft-identity75.1%
associate-/l*79.6%
Applied egg-rr79.6%
if -2.0999999999999999e-20 < t < 2.0500000000000001e-13Initial program 92.7%
associate-*l/91.2%
Simplified91.2%
Taylor expanded in a around inf 70.9%
+-commutative70.9%
Simplified70.9%
Final simplification75.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5e+176) x (if (<= t 3.6e+143) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e+176) {
tmp = x;
} else if (t <= 3.6e+143) {
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 <= (-2.5d+176)) then
tmp = x
else if (t <= 3.6d+143) 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 <= -2.5e+176) {
tmp = x;
} else if (t <= 3.6e+143) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.5e+176: tmp = x elif t <= 3.6e+143: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e+176) tmp = x; elseif (t <= 3.6e+143) 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 <= -2.5e+176) tmp = x; elseif (t <= 3.6e+143) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e+176], x, If[LessEqual[t, 3.6e+143], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+176}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+143}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.5e176 or 3.5999999999999999e143 < t Initial program 47.7%
associate-*l/54.6%
Simplified54.6%
Taylor expanded in x around inf 65.7%
if -2.5e176 < t < 3.5999999999999999e143Initial program 88.7%
associate-*l/90.5%
Simplified90.5%
Taylor expanded in a around inf 66.6%
+-commutative66.6%
Simplified66.6%
Final simplification66.4%
(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 80.1%
associate-*l/82.9%
Simplified82.9%
Taylor expanded in x around inf 49.4%
Final simplification49.4%
(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 2024031
(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))))