
(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 (+ (+ y x) (/ (* y (- t z)) (- a t)))))
(if (<= t_1 -5e-246)
(+ (+ y x) (* y (/ (- t z) (- a t))))
(if (<= t_1 0.0)
(+ x (/ (* y (- z a)) t))
(if (<= t_1 5e+305) t_1 (- x (* z (/ y (- a t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) + ((y * (t - z)) / (a - t));
double tmp;
if (t_1 <= -5e-246) {
tmp = (y + x) + (y * ((t - z) / (a - t)));
} else if (t_1 <= 0.0) {
tmp = x + ((y * (z - a)) / t);
} else if (t_1 <= 5e+305) {
tmp = t_1;
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y + x) + ((y * (t - z)) / (a - t))
if (t_1 <= (-5d-246)) then
tmp = (y + x) + (y * ((t - z) / (a - t)))
else if (t_1 <= 0.0d0) then
tmp = x + ((y * (z - a)) / t)
else if (t_1 <= 5d+305) then
tmp = t_1
else
tmp = x - (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) + ((y * (t - z)) / (a - t));
double tmp;
if (t_1 <= -5e-246) {
tmp = (y + x) + (y * ((t - z) / (a - t)));
} else if (t_1 <= 0.0) {
tmp = x + ((y * (z - a)) / t);
} else if (t_1 <= 5e+305) {
tmp = t_1;
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) + ((y * (t - z)) / (a - t)) tmp = 0 if t_1 <= -5e-246: tmp = (y + x) + (y * ((t - z) / (a - t))) elif t_1 <= 0.0: tmp = x + ((y * (z - a)) / t) elif t_1 <= 5e+305: tmp = t_1 else: tmp = x - (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if (t_1 <= -5e-246) tmp = Float64(Float64(y + x) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); elseif (t_1 <= 0.0) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); elseif (t_1 <= 5e+305) tmp = t_1; else tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) + ((y * (t - z)) / (a - t)); tmp = 0.0; if (t_1 <= -5e-246) tmp = (y + x) + (y * ((t - z) / (a - t))); elseif (t_1 <= 0.0) tmp = x + ((y * (z - a)) / t); elseif (t_1 <= 5e+305) tmp = t_1; else tmp = x - (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-246], N[(N[(y + x), $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[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+305], t$95$1, N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-246}:\\
\;\;\;\;\left(y + x\right) + y \cdot \frac{t - z}{a - t}\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -4.9999999999999997e-246Initial program 88.5%
associate-*l/94.8%
Simplified94.8%
if -4.9999999999999997e-246 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 9.1%
associate--l+47.9%
associate-/l*24.5%
Simplified24.5%
Taylor expanded in t around -inf 99.6%
+-commutative99.6%
sub-neg99.6%
mul-1-neg99.6%
+-commutative99.6%
*-commutative99.6%
+-commutative99.6%
*-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
mul-1-neg99.6%
sub-neg99.6%
distribute-lft-out--99.6%
Simplified99.6%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 5.00000000000000009e305Initial program 97.4%
if 5.00000000000000009e305 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 42.5%
associate--l+42.5%
sub-neg42.5%
+-commutative42.5%
associate-/l*78.8%
distribute-neg-frac78.8%
associate-/r/82.2%
fma-def82.2%
sub-neg82.2%
+-commutative82.2%
distribute-neg-in82.2%
unsub-neg82.2%
remove-double-neg82.2%
Simplified82.2%
Taylor expanded in y around 0 92.5%
Taylor expanded in z around inf 60.2%
associate-*r/60.2%
mul-1-neg60.2%
distribute-rgt-neg-in60.2%
Simplified60.2%
Taylor expanded in y around 0 60.2%
+-commutative60.2%
neg-mul-160.2%
sub-neg60.2%
*-commutative60.2%
associate-*r/90.8%
Simplified90.8%
Final simplification95.6%
(FPCore (x y z t a) :precision binary64 (- x (* y (+ (/ z (- a t)) (- -1.0 (/ 1.0 (+ (/ a t) -1.0)))))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((z / (a - t)) + (-1.0 - (1.0 / ((a / t) + -1.0)))));
}
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 / (a - t)) + ((-1.0d0) - (1.0d0 / ((a / t) + (-1.0d0))))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((z / (a - t)) + (-1.0 - (1.0 / ((a / t) + -1.0)))));
}
def code(x, y, z, t, a): return x - (y * ((z / (a - t)) + (-1.0 - (1.0 / ((a / t) + -1.0)))))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(z / Float64(a - t)) + Float64(-1.0 - Float64(1.0 / Float64(Float64(a / t) + -1.0)))))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((z / (a - t)) + (-1.0 - (1.0 / ((a / t) + -1.0))))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(1.0 / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \left(\frac{z}{a - t} + \left(-1 - \frac{1}{\frac{a}{t} + -1}\right)\right)
\end{array}
Initial program 80.0%
associate--l+83.3%
sub-neg83.3%
+-commutative83.3%
associate-/l*86.6%
distribute-neg-frac86.6%
associate-/r/90.5%
fma-def90.5%
sub-neg90.5%
+-commutative90.5%
distribute-neg-in90.5%
unsub-neg90.5%
remove-double-neg90.5%
Simplified90.5%
Taylor expanded in y around 0 95.1%
clear-num95.1%
inv-pow95.1%
Applied egg-rr95.1%
unpow-195.1%
div-sub95.1%
sub-neg95.1%
*-inverses95.1%
metadata-eval95.1%
Simplified95.1%
Final simplification95.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8e+136) (not (<= t 3.7e+132))) (+ x (/ (- z a) (/ t y))) (+ (+ y x) (* y (/ (- t z) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8e+136) || !(t <= 3.7e+132)) {
tmp = x + ((z - a) / (t / y));
} else {
tmp = (y + x) + (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 <= (-8d+136)) .or. (.not. (t <= 3.7d+132))) then
tmp = x + ((z - a) / (t / y))
else
tmp = (y + x) + (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 <= -8e+136) || !(t <= 3.7e+132)) {
tmp = x + ((z - a) / (t / y));
} else {
tmp = (y + x) + (y * ((t - z) / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8e+136) or not (t <= 3.7e+132): tmp = x + ((z - a) / (t / y)) else: tmp = (y + x) + (y * ((t - z) / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8e+136) || !(t <= 3.7e+132)) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); else tmp = Float64(Float64(y + x) + 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 <= -8e+136) || ~((t <= 3.7e+132))) tmp = x + ((z - a) / (t / y)); else tmp = (y + x) + (y * ((t - z) / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8e+136], N[Not[LessEqual[t, 3.7e+132]], $MachinePrecision]], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $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 -8 \cdot 10^{+136} \lor \neg \left(t \leq 3.7 \cdot 10^{+132}\right):\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(y + x\right) + y \cdot \frac{t - z}{a - t}\\
\end{array}
\end{array}
if t < -8.00000000000000047e136 or 3.70000000000000011e132 < t Initial program 55.8%
associate--l+66.1%
associate-/l*72.5%
Simplified72.5%
Taylor expanded in t around -inf 75.1%
+-commutative75.1%
sub-neg75.1%
mul-1-neg75.1%
+-commutative75.1%
*-commutative75.1%
+-commutative75.1%
*-commutative75.1%
mul-1-neg75.1%
unsub-neg75.1%
mul-1-neg75.1%
sub-neg75.1%
distribute-lft-out--75.2%
Simplified75.2%
Taylor expanded in x around 0 75.2%
neg-mul-175.2%
+-commutative75.2%
sub-neg75.2%
sub-neg75.2%
mul-1-neg75.2%
+-commutative75.2%
*-commutative75.2%
associate-/l*87.8%
+-commutative87.8%
mul-1-neg87.8%
sub-neg87.8%
Simplified87.8%
if -8.00000000000000047e136 < t < 3.70000000000000011e132Initial program 87.6%
associate-*l/92.2%
Simplified92.2%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (+ x (* y (- (+ (/ t (- a t)) 1.0) (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
return x + (y * (((t / (a - t)) + 1.0) - (z / (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 * (((t / (a - t)) + 1.0d0) - (z / (a - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * (((t / (a - t)) + 1.0) - (z / (a - t))));
}
def code(x, y, z, t, a): return x + (y * (((t / (a - t)) + 1.0) - (z / (a - t))))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(Float64(t / Float64(a - t)) + 1.0) - Float64(z / Float64(a - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * (((t / (a - t)) + 1.0) - (z / (a - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \left(\left(\frac{t}{a - t} + 1\right) - \frac{z}{a - t}\right)
\end{array}
Initial program 80.0%
associate--l+83.3%
sub-neg83.3%
+-commutative83.3%
associate-/l*86.6%
distribute-neg-frac86.6%
associate-/r/90.5%
fma-def90.5%
sub-neg90.5%
+-commutative90.5%
distribute-neg-in90.5%
unsub-neg90.5%
remove-double-neg90.5%
Simplified90.5%
Taylor expanded in y around 0 95.1%
Final simplification95.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.3e+130) (+ x (+ y (/ (- t z) (/ (- a t) y)))) (+ x (/ (- z a) (/ t y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.3e+130) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x + ((z - 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) :: tmp
if (t <= 4.3d+130) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else
tmp = x + ((z - a) / (t / 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 <= 4.3e+130) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x + ((z - a) / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.3e+130: tmp = x + (y + ((t - z) / ((a - t) / y))) else: tmp = x + ((z - a) / (t / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.3e+130) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); else tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4.3e+130) tmp = x + (y + ((t - z) / ((a - t) / y))); else tmp = x + ((z - a) / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.3e+130], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.3 \cdot 10^{+130}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < 4.29999999999999984e130Initial program 83.8%
associate--l+86.3%
associate-/l*89.4%
Simplified89.4%
if 4.29999999999999984e130 < t Initial program 54.1%
associate--l+62.9%
associate-/l*66.9%
Simplified66.9%
Taylor expanded in t around -inf 70.6%
+-commutative70.6%
sub-neg70.6%
mul-1-neg70.6%
+-commutative70.6%
*-commutative70.6%
+-commutative70.6%
*-commutative70.6%
mul-1-neg70.6%
unsub-neg70.6%
mul-1-neg70.6%
sub-neg70.6%
distribute-lft-out--70.8%
Simplified70.8%
Taylor expanded in x around 0 70.8%
neg-mul-170.8%
+-commutative70.8%
sub-neg70.8%
sub-neg70.8%
mul-1-neg70.8%
+-commutative70.8%
*-commutative70.8%
associate-/l*88.8%
+-commutative88.8%
mul-1-neg88.8%
sub-neg88.8%
Simplified88.8%
Final simplification89.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -6e+153)
(+ y x)
(if (<= a -85.0)
(- x (* y (/ z a)))
(if (<= a 4.2e-13) (+ x (* y (/ z t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e+153) {
tmp = y + x;
} else if (a <= -85.0) {
tmp = x - (y * (z / a));
} else if (a <= 4.2e-13) {
tmp = x + (y * (z / t));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-6d+153)) then
tmp = y + x
else if (a <= (-85.0d0)) then
tmp = x - (y * (z / a))
else if (a <= 4.2d-13) then
tmp = x + (y * (z / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e+153) {
tmp = y + x;
} else if (a <= -85.0) {
tmp = x - (y * (z / a));
} else if (a <= 4.2e-13) {
tmp = x + (y * (z / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6e+153: tmp = y + x elif a <= -85.0: tmp = x - (y * (z / a)) elif a <= 4.2e-13: tmp = x + (y * (z / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6e+153) tmp = Float64(y + x); elseif (a <= -85.0) tmp = Float64(x - Float64(y * Float64(z / a))); elseif (a <= 4.2e-13) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6e+153) tmp = y + x; elseif (a <= -85.0) tmp = x - (y * (z / a)); elseif (a <= 4.2e-13) tmp = x + (y * (z / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6e+153], N[(y + x), $MachinePrecision], If[LessEqual[a, -85.0], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.2e-13], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+153}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -85:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-13}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -6.00000000000000037e153 or 4.19999999999999977e-13 < a Initial program 82.5%
associate--l+83.4%
sub-neg83.4%
+-commutative83.4%
associate-/l*92.5%
distribute-neg-frac92.5%
associate-/r/94.9%
fma-def94.9%
sub-neg94.9%
+-commutative94.9%
distribute-neg-in94.9%
unsub-neg94.9%
remove-double-neg94.9%
Simplified94.9%
Taylor expanded in a around inf 79.1%
if -6.00000000000000037e153 < a < -85Initial program 81.0%
associate--l+88.1%
sub-neg88.1%
+-commutative88.1%
associate-/l*85.1%
distribute-neg-frac85.1%
associate-/r/94.5%
fma-def94.5%
sub-neg94.5%
+-commutative94.5%
distribute-neg-in94.5%
unsub-neg94.5%
remove-double-neg94.5%
Simplified94.5%
Taylor expanded in y around 0 95.1%
Taylor expanded in z around inf 81.0%
associate-*r/81.0%
mul-1-neg81.0%
distribute-rgt-neg-in81.0%
Simplified81.0%
Taylor expanded in a around inf 80.9%
+-commutative80.9%
mul-1-neg80.9%
associate-/l*85.5%
unsub-neg85.5%
associate-/l*80.9%
associate-*r/85.4%
Simplified85.4%
if -85 < a < 4.19999999999999977e-13Initial program 77.4%
associate--l+81.6%
sub-neg81.6%
+-commutative81.6%
associate-/l*81.7%
distribute-neg-frac81.7%
associate-/r/85.0%
fma-def85.0%
sub-neg85.0%
+-commutative85.0%
distribute-neg-in85.0%
unsub-neg85.0%
remove-double-neg85.0%
Simplified85.0%
Taylor expanded in y around 0 92.7%
Taylor expanded in a around 0 79.1%
Final simplification80.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.05e+153)
(+ y x)
(if (<= a -1.75)
(- x (/ y (/ a z)))
(if (<= a 1.25e-6) (+ x (* y (/ z t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e+153) {
tmp = y + x;
} else if (a <= -1.75) {
tmp = x - (y / (a / z));
} else if (a <= 1.25e-6) {
tmp = x + (y * (z / t));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.05d+153)) then
tmp = y + x
else if (a <= (-1.75d0)) then
tmp = x - (y / (a / z))
else if (a <= 1.25d-6) then
tmp = x + (y * (z / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e+153) {
tmp = y + x;
} else if (a <= -1.75) {
tmp = x - (y / (a / z));
} else if (a <= 1.25e-6) {
tmp = x + (y * (z / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.05e+153: tmp = y + x elif a <= -1.75: tmp = x - (y / (a / z)) elif a <= 1.25e-6: tmp = x + (y * (z / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.05e+153) tmp = Float64(y + x); elseif (a <= -1.75) tmp = Float64(x - Float64(y / Float64(a / z))); elseif (a <= 1.25e-6) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.05e+153) tmp = y + x; elseif (a <= -1.75) tmp = x - (y / (a / z)); elseif (a <= 1.25e-6) tmp = x + (y * (z / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.05e+153], N[(y + x), $MachinePrecision], If[LessEqual[a, -1.75], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e-6], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+153}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -1.75:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-6}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.05000000000000008e153 or 1.2500000000000001e-6 < a Initial program 82.5%
associate--l+83.4%
sub-neg83.4%
+-commutative83.4%
associate-/l*92.5%
distribute-neg-frac92.5%
associate-/r/94.9%
fma-def94.9%
sub-neg94.9%
+-commutative94.9%
distribute-neg-in94.9%
unsub-neg94.9%
remove-double-neg94.9%
Simplified94.9%
Taylor expanded in a around inf 79.1%
if -2.05000000000000008e153 < a < -1.75Initial program 81.0%
associate--l+88.1%
associate-/l*85.1%
Simplified85.1%
Taylor expanded in a around inf 78.2%
Taylor expanded in z around inf 80.9%
mul-1-neg80.9%
associate-/l*85.5%
Simplified85.5%
if -1.75 < a < 1.2500000000000001e-6Initial program 77.4%
associate--l+81.6%
sub-neg81.6%
+-commutative81.6%
associate-/l*81.7%
distribute-neg-frac81.7%
associate-/r/85.0%
fma-def85.0%
sub-neg85.0%
+-commutative85.0%
distribute-neg-in85.0%
unsub-neg85.0%
remove-double-neg85.0%
Simplified85.0%
Taylor expanded in y around 0 92.7%
Taylor expanded in a around 0 79.1%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -460.0) (not (<= a 1.1e-34))) (+ y (- x (/ y (/ a z)))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -460.0) || !(a <= 1.1e-34)) {
tmp = y + (x - (y / (a / z)));
} 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 <= (-460.0d0)) .or. (.not. (a <= 1.1d-34))) then
tmp = y + (x - (y / (a / z)))
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 <= -460.0) || !(a <= 1.1e-34)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -460.0) or not (a <= 1.1e-34): tmp = y + (x - (y / (a / z))) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -460.0) || !(a <= 1.1e-34)) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -460.0) || ~((a <= 1.1e-34))) tmp = y + (x - (y / (a / z))); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -460.0], N[Not[LessEqual[a, 1.1e-34]], $MachinePrecision]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -460 \lor \neg \left(a \leq 1.1 \cdot 10^{-34}\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -460 or 1.0999999999999999e-34 < a Initial program 82.1%
associate--l+84.7%
sub-neg84.7%
+-commutative84.7%
associate-/l*90.4%
distribute-neg-frac90.4%
associate-/r/94.8%
fma-def94.8%
sub-neg94.8%
+-commutative94.8%
distribute-neg-in94.8%
unsub-neg94.8%
remove-double-neg94.8%
Simplified94.8%
Taylor expanded in t around 0 82.8%
mul-1-neg82.8%
sub-neg82.8%
associate-/l*89.9%
Simplified89.9%
if -460 < a < 1.0999999999999999e-34Initial program 77.4%
associate--l+81.6%
sub-neg81.6%
+-commutative81.6%
associate-/l*81.7%
distribute-neg-frac81.7%
associate-/r/85.0%
fma-def85.0%
sub-neg85.0%
+-commutative85.0%
distribute-neg-in85.0%
unsub-neg85.0%
remove-double-neg85.0%
Simplified85.0%
Taylor expanded in y around 0 92.7%
Taylor expanded in a around 0 79.1%
Final simplification85.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.8e+58) (not (<= a 0.45))) (+ y (- x (/ y (/ a z)))) (- x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.8e+58) || !(a <= 0.45)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - (z * (y / (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 <= (-3.8d+58)) .or. (.not. (a <= 0.45d0))) then
tmp = y + (x - (y / (a / z)))
else
tmp = x - (z * (y / (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 <= -3.8e+58) || !(a <= 0.45)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.8e+58) or not (a <= 0.45): tmp = y + (x - (y / (a / z))) else: tmp = x - (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.8e+58) || !(a <= 0.45)) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.8e+58) || ~((a <= 0.45))) tmp = y + (x - (y / (a / z))); else tmp = x - (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.8e+58], N[Not[LessEqual[a, 0.45]], $MachinePrecision]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+58} \lor \neg \left(a \leq 0.45\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if a < -3.7999999999999999e58 or 0.450000000000000011 < a Initial program 81.6%
associate--l+83.8%
sub-neg83.8%
+-commutative83.8%
associate-/l*90.1%
distribute-neg-frac90.1%
associate-/r/95.0%
fma-def95.0%
sub-neg95.0%
+-commutative95.0%
distribute-neg-in95.0%
unsub-neg95.0%
remove-double-neg95.0%
Simplified95.0%
Taylor expanded in t around 0 82.5%
mul-1-neg82.5%
sub-neg82.5%
associate-/l*90.3%
Simplified90.3%
if -3.7999999999999999e58 < a < 0.450000000000000011Initial program 78.4%
associate--l+82.9%
sub-neg82.9%
+-commutative82.9%
associate-/l*83.0%
distribute-neg-frac83.0%
associate-/r/85.9%
fma-def85.9%
sub-neg85.9%
+-commutative85.9%
distribute-neg-in85.9%
unsub-neg85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in y around 0 92.7%
Taylor expanded in z around inf 86.6%
associate-*r/86.6%
mul-1-neg86.6%
distribute-rgt-neg-in86.6%
Simplified86.6%
Taylor expanded in y around 0 86.6%
+-commutative86.6%
neg-mul-186.6%
sub-neg86.6%
*-commutative86.6%
associate-*r/88.8%
Simplified88.8%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -0.6) (+ y x) (if (<= a 6.3e-12) (+ x (* y (/ z t))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -0.6) {
tmp = y + x;
} else if (a <= 6.3e-12) {
tmp = x + (y * (z / t));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-0.6d0)) then
tmp = y + x
else if (a <= 6.3d-12) then
tmp = x + (y * (z / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -0.6) {
tmp = y + x;
} else if (a <= 6.3e-12) {
tmp = x + (y * (z / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -0.6: tmp = y + x elif a <= 6.3e-12: tmp = x + (y * (z / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -0.6) tmp = Float64(y + x); elseif (a <= 6.3e-12) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -0.6) tmp = y + x; elseif (a <= 6.3e-12) tmp = x + (y * (z / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -0.6], N[(y + x), $MachinePrecision], If[LessEqual[a, 6.3e-12], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.6:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 6.3 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -0.599999999999999978 or 6.3000000000000002e-12 < a Initial program 82.1%
associate--l+84.7%
sub-neg84.7%
+-commutative84.7%
associate-/l*90.4%
distribute-neg-frac90.4%
associate-/r/94.8%
fma-def94.8%
sub-neg94.8%
+-commutative94.8%
distribute-neg-in94.8%
unsub-neg94.8%
remove-double-neg94.8%
Simplified94.8%
Taylor expanded in a around inf 74.4%
if -0.599999999999999978 < a < 6.3000000000000002e-12Initial program 77.4%
associate--l+81.6%
sub-neg81.6%
+-commutative81.6%
associate-/l*81.7%
distribute-neg-frac81.7%
associate-/r/85.0%
fma-def85.0%
sub-neg85.0%
+-commutative85.0%
distribute-neg-in85.0%
unsub-neg85.0%
remove-double-neg85.0%
Simplified85.0%
Taylor expanded in y around 0 92.7%
Taylor expanded in a around 0 79.1%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.55e+131) (* z (/ y t)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.55e+131) {
tmp = z * (y / t);
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.55d+131)) then
tmp = z * (y / t)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.55e+131) {
tmp = z * (y / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.55e+131: tmp = z * (y / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.55e+131) tmp = Float64(z * Float64(y / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.55e+131) tmp = z * (y / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.55e+131], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.55 \cdot 10^{+131}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -3.54999999999999971e131Initial program 79.9%
associate--l+79.9%
sub-neg79.9%
+-commutative79.9%
associate-/l*85.4%
distribute-neg-frac85.4%
associate-/r/93.0%
fma-def93.0%
sub-neg93.0%
+-commutative93.0%
distribute-neg-in93.0%
unsub-neg93.0%
remove-double-neg93.0%
Simplified93.0%
Taylor expanded in y around 0 96.9%
Taylor expanded in a around 0 45.7%
Taylor expanded in y around inf 35.1%
*-commutative35.1%
associate-*r/40.6%
Simplified40.6%
if -3.54999999999999971e131 < z Initial program 80.1%
associate--l+83.9%
sub-neg83.9%
+-commutative83.9%
associate-/l*86.8%
distribute-neg-frac86.8%
associate-/r/90.1%
fma-def90.1%
sub-neg90.1%
+-commutative90.1%
distribute-neg-in90.1%
unsub-neg90.1%
remove-double-neg90.1%
Simplified90.1%
Taylor expanded in a around inf 66.3%
Final simplification62.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.6e+151) x (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.6e+151) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-6.6d+151)) then
tmp = x
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.6e+151) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.6e+151: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.6e+151) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.6e+151) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.6e+151], x, N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{+151}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -6.60000000000000049e151Initial program 61.8%
associate--l+74.7%
sub-neg74.7%
+-commutative74.7%
associate-/l*84.2%
distribute-neg-frac84.2%
associate-/r/94.0%
fma-def94.1%
sub-neg94.1%
+-commutative94.1%
distribute-neg-in94.1%
unsub-neg94.1%
remove-double-neg94.1%
Simplified94.1%
Taylor expanded in x around inf 80.8%
if -6.60000000000000049e151 < t Initial program 82.2%
associate--l+84.4%
sub-neg84.4%
+-commutative84.4%
associate-/l*86.9%
distribute-neg-frac86.9%
associate-/r/90.1%
fma-def90.1%
sub-neg90.1%
+-commutative90.1%
distribute-neg-in90.1%
unsub-neg90.1%
remove-double-neg90.1%
Simplified90.1%
Taylor expanded in a around inf 60.0%
Final simplification62.2%
(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.0%
associate--l+83.3%
sub-neg83.3%
+-commutative83.3%
associate-/l*86.6%
distribute-neg-frac86.6%
associate-/r/90.5%
fma-def90.5%
sub-neg90.5%
+-commutative90.5%
distribute-neg-in90.5%
unsub-neg90.5%
remove-double-neg90.5%
Simplified90.5%
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 2023230
(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))))