
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (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) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (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) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - 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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 99.1%
clear-num99.1%
un-div-inv99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.5e+42)
(+ x y)
(if (<= t 1.42e-28)
(+ x (/ y (/ a z)))
(if (<= t 1.25e+153) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e+42) {
tmp = x + y;
} else if (t <= 1.42e-28) {
tmp = x + (y / (a / z));
} else if (t <= 1.25e+153) {
tmp = x - (y * (z / t));
} 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 <= (-4.5d+42)) then
tmp = x + y
else if (t <= 1.42d-28) then
tmp = x + (y / (a / z))
else if (t <= 1.25d+153) then
tmp = x - (y * (z / t))
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 <= -4.5e+42) {
tmp = x + y;
} else if (t <= 1.42e-28) {
tmp = x + (y / (a / z));
} else if (t <= 1.25e+153) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.5e+42: tmp = x + y elif t <= 1.42e-28: tmp = x + (y / (a / z)) elif t <= 1.25e+153: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.5e+42) tmp = Float64(x + y); elseif (t <= 1.42e-28) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 1.25e+153) tmp = Float64(x - Float64(y * Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.5e+42) tmp = x + y; elseif (t <= 1.42e-28) tmp = x + (y / (a / z)); elseif (t <= 1.25e+153) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.5e+42], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.42e-28], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+153], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+42}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.42 \cdot 10^{-28}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+153}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.50000000000000012e42 or 1.25000000000000005e153 < t Initial program 99.9%
Taylor expanded in t around inf 79.6%
+-commutative79.6%
Simplified79.6%
if -4.50000000000000012e42 < t < 1.42000000000000001e-28Initial program 98.5%
clear-num98.5%
un-div-inv98.5%
Applied egg-rr98.5%
Taylor expanded in t around 0 83.1%
if 1.42000000000000001e-28 < t < 1.25000000000000005e153Initial program 99.8%
Taylor expanded in z around inf 65.5%
Taylor expanded in a around 0 61.1%
mul-1-neg61.1%
unsub-neg61.1%
associate-/l*68.2%
Simplified68.2%
Final simplification79.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.2e+39)
(+ x y)
(if (<= t 6.2e-29)
(+ x (/ y (/ a z)))
(if (<= t 1.35e+153) (- x (/ y (/ t z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.2e+39) {
tmp = x + y;
} else if (t <= 6.2e-29) {
tmp = x + (y / (a / z));
} else if (t <= 1.35e+153) {
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 <= (-3.2d+39)) then
tmp = x + y
else if (t <= 6.2d-29) then
tmp = x + (y / (a / z))
else if (t <= 1.35d+153) 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 <= -3.2e+39) {
tmp = x + y;
} else if (t <= 6.2e-29) {
tmp = x + (y / (a / z));
} else if (t <= 1.35e+153) {
tmp = x - (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.2e+39: tmp = x + y elif t <= 6.2e-29: tmp = x + (y / (a / z)) elif t <= 1.35e+153: tmp = x - (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.2e+39) tmp = Float64(x + y); elseif (t <= 6.2e-29) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 1.35e+153) 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 <= -3.2e+39) tmp = x + y; elseif (t <= 6.2e-29) tmp = x + (y / (a / z)); elseif (t <= 1.35e+153) tmp = x - (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.2e+39], N[(x + y), $MachinePrecision], If[LessEqual[t, 6.2e-29], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+153], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+39}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-29}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+153}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.19999999999999993e39 or 1.35e153 < t Initial program 99.9%
Taylor expanded in t around inf 79.6%
+-commutative79.6%
Simplified79.6%
if -3.19999999999999993e39 < t < 6.20000000000000052e-29Initial program 98.5%
clear-num98.5%
un-div-inv98.5%
Applied egg-rr98.5%
Taylor expanded in t around 0 83.1%
if 6.20000000000000052e-29 < t < 1.35e153Initial program 99.8%
Taylor expanded in z around inf 65.5%
Taylor expanded in a around 0 61.1%
mul-1-neg61.1%
unsub-neg61.1%
associate-/l*68.2%
Simplified68.2%
clear-num68.2%
un-div-inv68.3%
Applied egg-rr68.3%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.8e+208) (not (<= t 2.25e+169))) (+ x y) (- x (/ y (/ (- t a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e+208) || !(t <= 2.25e+169)) {
tmp = x + y;
} else {
tmp = x - (y / ((t - a) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.8d+208)) .or. (.not. (t <= 2.25d+169))) then
tmp = x + y
else
tmp = x - (y / ((t - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e+208) || !(t <= 2.25e+169)) {
tmp = x + y;
} else {
tmp = x - (y / ((t - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.8e+208) or not (t <= 2.25e+169): tmp = x + y else: tmp = x - (y / ((t - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.8e+208) || !(t <= 2.25e+169)) tmp = Float64(x + y); else tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.8e+208) || ~((t <= 2.25e+169))) tmp = x + y; else tmp = x - (y / ((t - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.8e+208], N[Not[LessEqual[t, 2.25e+169]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+208} \lor \neg \left(t \leq 2.25 \cdot 10^{+169}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\end{array}
\end{array}
if t < -1.80000000000000001e208 or 2.25e169 < t Initial program 99.9%
Taylor expanded in t around inf 87.2%
+-commutative87.2%
Simplified87.2%
if -1.80000000000000001e208 < t < 2.25e169Initial program 99.0%
clear-num98.9%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in z around inf 85.9%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.2e+36) (not (<= t 2.95e+85))) (+ x (* t (/ y (- t a)))) (- x (/ y (/ (- t a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e+36) || !(t <= 2.95e+85)) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x - (y / ((t - a) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.2d+36)) .or. (.not. (t <= 2.95d+85))) then
tmp = x + (t * (y / (t - a)))
else
tmp = x - (y / ((t - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e+36) || !(t <= 2.95e+85)) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x - (y / ((t - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.2e+36) or not (t <= 2.95e+85): tmp = x + (t * (y / (t - a))) else: tmp = x - (y / ((t - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.2e+36) || !(t <= 2.95e+85)) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); else tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.2e+36) || ~((t <= 2.95e+85))) tmp = x + (t * (y / (t - a))); else tmp = x - (y / ((t - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.2e+36], N[Not[LessEqual[t, 2.95e+85]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+36} \lor \neg \left(t \leq 2.95 \cdot 10^{+85}\right):\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\end{array}
\end{array}
if t < -4.20000000000000009e36 or 2.95e85 < t Initial program 99.9%
Taylor expanded in z around 0 70.3%
mul-1-neg70.3%
unsub-neg70.3%
associate-/l*84.3%
Simplified84.3%
if -4.20000000000000009e36 < t < 2.95e85Initial program 98.6%
clear-num98.6%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 91.8%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.5e+68) (- x (* y (+ (/ z t) -1.0))) (if (<= t 1.6e+85) (- x (/ y (/ (- t a) z))) (+ x (* t (/ y (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e+68) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 1.6e+85) {
tmp = x - (y / ((t - a) / z));
} else {
tmp = x + (t * (y / (t - 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 <= (-5.5d+68)) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else if (t <= 1.6d+85) then
tmp = x - (y / ((t - a) / z))
else
tmp = x + (t * (y / (t - 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 <= -5.5e+68) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 1.6e+85) {
tmp = x - (y / ((t - a) / z));
} else {
tmp = x + (t * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e+68: tmp = x - (y * ((z / t) + -1.0)) elif t <= 1.6e+85: tmp = x - (y / ((t - a) / z)) else: tmp = x + (t * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e+68) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); elseif (t <= 1.6e+85) tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); else tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e+68) tmp = x - (y * ((z / t) + -1.0)); elseif (t <= 1.6e+85) tmp = x - (y / ((t - a) / z)); else tmp = x + (t * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e+68], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e+85], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+68}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+85}:\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -5.5000000000000004e68Initial program 99.9%
Taylor expanded in a around 0 72.5%
mul-1-neg72.5%
unsub-neg72.5%
associate-/l*87.2%
div-sub87.2%
sub-neg87.2%
*-inverses87.2%
metadata-eval87.2%
Simplified87.2%
if -5.5000000000000004e68 < t < 1.60000000000000009e85Initial program 98.7%
clear-num98.7%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 91.5%
if 1.60000000000000009e85 < t Initial program 99.9%
Taylor expanded in z around 0 68.8%
mul-1-neg68.8%
unsub-neg68.8%
associate-/l*87.7%
Simplified87.7%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.5e+69) (- x (* y (+ (/ z t) -1.0))) (if (<= t 1.85e+86) (- x (/ y (/ (- t a) z))) (+ x (* y (/ t (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+69) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 1.85e+86) {
tmp = x - (y / ((t - a) / z));
} else {
tmp = x + (y * (t / (t - 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 <= (-6.5d+69)) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else if (t <= 1.85d+86) then
tmp = x - (y / ((t - a) / z))
else
tmp = x + (y * (t / (t - 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 <= -6.5e+69) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 1.85e+86) {
tmp = x - (y / ((t - a) / z));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.5e+69: tmp = x - (y * ((z / t) + -1.0)) elif t <= 1.85e+86: tmp = x - (y / ((t - a) / z)) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.5e+69) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); elseif (t <= 1.85e+86) tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); else tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.5e+69) tmp = x - (y * ((z / t) + -1.0)); elseif (t <= 1.85e+86) tmp = x - (y / ((t - a) / z)); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.5e+69], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.85e+86], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+69}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+86}:\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if t < -6.5000000000000001e69Initial program 99.9%
Taylor expanded in a around 0 72.5%
mul-1-neg72.5%
unsub-neg72.5%
associate-/l*87.2%
div-sub87.2%
sub-neg87.2%
*-inverses87.2%
metadata-eval87.2%
Simplified87.2%
if -6.5000000000000001e69 < t < 1.84999999999999996e86Initial program 98.7%
clear-num98.7%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 91.5%
if 1.84999999999999996e86 < t Initial program 99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 68.8%
mul-1-neg68.8%
associate-*r/87.7%
unsub-neg87.7%
associate-*r/68.8%
*-commutative68.8%
associate-/l*88.2%
Simplified88.2%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.2e+41) (not (<= t 5.6e+68))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.2e+41) || !(t <= 5.6e+68)) {
tmp = x + y;
} else {
tmp = x + (z * (y / 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 <= (-9.2d+41)) .or. (.not. (t <= 5.6d+68))) then
tmp = x + y
else
tmp = x + (z * (y / 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 <= -9.2e+41) || !(t <= 5.6e+68)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.2e+41) or not (t <= 5.6e+68): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.2e+41) || !(t <= 5.6e+68)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9.2e+41) || ~((t <= 5.6e+68))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.2e+41], N[Not[LessEqual[t, 5.6e+68]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+41} \lor \neg \left(t \leq 5.6 \cdot 10^{+68}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -9.1999999999999994e41 or 5.6e68 < t Initial program 99.9%
Taylor expanded in t around inf 73.6%
+-commutative73.6%
Simplified73.6%
if -9.1999999999999994e41 < t < 5.6e68Initial program 98.6%
Taylor expanded in t around 0 76.8%
*-commutative76.8%
associate-/l*78.8%
Applied egg-rr78.8%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e+39) (not (<= t 2.45e+63))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+39) || !(t <= 2.45e+63)) {
tmp = x + y;
} else {
tmp = x + (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 ((t <= (-4.8d+39)) .or. (.not. (t <= 2.45d+63))) then
tmp = x + y
else
tmp = x + (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 ((t <= -4.8e+39) || !(t <= 2.45e+63)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e+39) or not (t <= 2.45e+63): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e+39) || !(t <= 2.45e+63)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.8e+39) || ~((t <= 2.45e+63))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e+39], N[Not[LessEqual[t, 2.45e+63]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+39} \lor \neg \left(t \leq 2.45 \cdot 10^{+63}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.8000000000000002e39 or 2.4499999999999998e63 < t Initial program 99.9%
Taylor expanded in t around inf 73.6%
+-commutative73.6%
Simplified73.6%
if -4.8000000000000002e39 < t < 2.4499999999999998e63Initial program 98.6%
clear-num98.6%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in t around 0 80.6%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -6e+148) x (if (<= a 1.12e+156) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e+148) {
tmp = x;
} else if (a <= 1.12e+156) {
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 (a <= (-6d+148)) then
tmp = x
else if (a <= 1.12d+156) 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 (a <= -6e+148) {
tmp = x;
} else if (a <= 1.12e+156) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6e+148: tmp = x elif a <= 1.12e+156: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6e+148) tmp = x; elseif (a <= 1.12e+156) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6e+148) tmp = x; elseif (a <= 1.12e+156) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6e+148], x, If[LessEqual[a, 1.12e+156], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+148}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.12 \cdot 10^{+156}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.00000000000000029e148 or 1.12000000000000007e156 < a Initial program 99.8%
Taylor expanded in x around inf 69.1%
if -6.00000000000000029e148 < a < 1.12000000000000007e156Initial program 98.9%
Taylor expanded in t around inf 61.2%
+-commutative61.2%
Simplified61.2%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (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) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 99.1%
Final simplification99.1%
(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 99.1%
Taylor expanded in x around inf 51.6%
Final simplification51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (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) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (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 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024043
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))