
(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 (/ (- 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.0%
Final simplification99.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.5e+79)
(+ x y)
(if (<= t -4.3e-10)
(- x (* z (/ y t)))
(if (<= t 14.2) (+ x (* y (/ (- z t) a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e+79) {
tmp = x + y;
} else if (t <= -4.3e-10) {
tmp = x - (z * (y / t));
} else if (t <= 14.2) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-5.5d+79)) then
tmp = x + y
else if (t <= (-4.3d-10)) then
tmp = x - (z * (y / t))
else if (t <= 14.2d0) then
tmp = x + (y * ((z - t) / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e+79) {
tmp = x + y;
} else if (t <= -4.3e-10) {
tmp = x - (z * (y / t));
} else if (t <= 14.2) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e+79: tmp = x + y elif t <= -4.3e-10: tmp = x - (z * (y / t)) elif t <= 14.2: tmp = x + (y * ((z - t) / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e+79) tmp = Float64(x + y); elseif (t <= -4.3e-10) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= 14.2) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e+79) tmp = x + y; elseif (t <= -4.3e-10) tmp = x - (z * (y / t)); elseif (t <= 14.2) tmp = x + (y * ((z - t) / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e+79], N[(x + y), $MachinePrecision], If[LessEqual[t, -4.3e-10], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 14.2], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+79}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -4.3 \cdot 10^{-10}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 14.2:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -5.50000000000000007e79 or 14.199999999999999 < t Initial program 99.9%
Taylor expanded in t around inf 78.0%
if -5.50000000000000007e79 < t < -4.30000000000000014e-10Initial program 99.8%
Taylor expanded in z around inf 73.3%
associate-/l*78.4%
Simplified78.4%
Taylor expanded in a around 0 67.3%
+-commutative67.3%
mul-1-neg67.3%
unsub-neg67.3%
associate-/l*72.3%
Simplified72.3%
associate-/r/72.5%
Applied egg-rr72.5%
if -4.30000000000000014e-10 < t < 14.199999999999999Initial program 98.0%
Taylor expanded in a around inf 79.8%
Final simplification78.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.8e+80)
(+ x y)
(if (<= t -9.6e-61)
(- x (* y (/ z t)))
(if (<= t 0.041) (+ x (* y (/ z a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.8e+80) {
tmp = x + y;
} else if (t <= -9.6e-61) {
tmp = x - (y * (z / t));
} else if (t <= 0.041) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.8d+80)) then
tmp = x + y
else if (t <= (-9.6d-61)) then
tmp = x - (y * (z / t))
else if (t <= 0.041d0) then
tmp = x + (y * (z / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.8e+80) {
tmp = x + y;
} else if (t <= -9.6e-61) {
tmp = x - (y * (z / t));
} else if (t <= 0.041) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.8e+80: tmp = x + y elif t <= -9.6e-61: tmp = x - (y * (z / t)) elif t <= 0.041: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.8e+80) tmp = Float64(x + y); elseif (t <= -9.6e-61) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 0.041) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.8e+80) tmp = x + y; elseif (t <= -9.6e-61) tmp = x - (y * (z / t)); elseif (t <= 0.041) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.8e+80], N[(x + y), $MachinePrecision], If[LessEqual[t, -9.6e-61], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.041], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+80}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -9.6 \cdot 10^{-61}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 0.041:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.79999999999999997e80 or 0.0410000000000000017 < t Initial program 99.9%
Taylor expanded in t around inf 78.0%
if -1.79999999999999997e80 < t < -9.6000000000000004e-61Initial program 99.8%
Taylor expanded in z around inf 71.6%
associate-/l*74.4%
Simplified74.4%
Taylor expanded in a around 0 62.2%
+-commutative62.2%
mul-1-neg62.2%
unsub-neg62.2%
associate-/l*65.0%
Simplified65.0%
Taylor expanded in y around 0 62.2%
associate-/l*65.0%
*-rgt-identity65.0%
associate-*r/65.0%
associate-/r/64.9%
associate-*l/65.0%
*-lft-identity65.0%
Simplified65.0%
if -9.6000000000000004e-61 < t < 0.0410000000000000017Initial program 97.8%
Taylor expanded in t around 0 81.8%
Final simplification78.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.1e+79)
(+ x y)
(if (<= t -2.95e-61)
(- x (* z (/ y t)))
(if (<= t 450.0) (+ x (* y (/ z a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e+79) {
tmp = x + y;
} else if (t <= -2.95e-61) {
tmp = x - (z * (y / t));
} else if (t <= 450.0) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.1d+79)) then
tmp = x + y
else if (t <= (-2.95d-61)) then
tmp = x - (z * (y / t))
else if (t <= 450.0d0) then
tmp = x + (y * (z / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e+79) {
tmp = x + y;
} else if (t <= -2.95e-61) {
tmp = x - (z * (y / t));
} else if (t <= 450.0) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.1e+79: tmp = x + y elif t <= -2.95e-61: tmp = x - (z * (y / t)) elif t <= 450.0: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.1e+79) tmp = Float64(x + y); elseif (t <= -2.95e-61) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= 450.0) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.1e+79) tmp = x + y; elseif (t <= -2.95e-61) tmp = x - (z * (y / t)); elseif (t <= 450.0) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.1e+79], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.95e-61], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 450.0], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+79}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.95 \cdot 10^{-61}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 450:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.0999999999999999e79 or 450 < t Initial program 99.9%
Taylor expanded in t around inf 78.0%
if -3.0999999999999999e79 < t < -2.94999999999999986e-61Initial program 99.8%
Taylor expanded in z around inf 71.6%
associate-/l*74.4%
Simplified74.4%
Taylor expanded in a around 0 62.2%
+-commutative62.2%
mul-1-neg62.2%
unsub-neg62.2%
associate-/l*65.0%
Simplified65.0%
associate-/r/65.1%
Applied egg-rr65.1%
if -2.94999999999999986e-61 < t < 450Initial program 97.8%
Taylor expanded in t around 0 81.8%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.3e+149) (not (<= t 2.6e+104))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.3e+149) || !(t <= 2.6e+104)) {
tmp = x + y;
} 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 ((t <= (-2.3d+149)) .or. (.not. (t <= 2.6d+104))) then
tmp = x + y
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 ((t <= -2.3e+149) || !(t <= 2.6e+104)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.3e+149) or not (t <= 2.6e+104): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.3e+149) || !(t <= 2.6e+104)) tmp = Float64(x + y); 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 ((t <= -2.3e+149) || ~((t <= 2.6e+104))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.3e+149], N[Not[LessEqual[t, 2.6e+104]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+149} \lor \neg \left(t \leq 2.6 \cdot 10^{+104}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -2.2999999999999998e149 or 2.6e104 < t Initial program 100.0%
Taylor expanded in t around inf 82.8%
if -2.2999999999999998e149 < t < 2.6e104Initial program 98.6%
Taylor expanded in z around inf 81.1%
associate-/l*87.1%
Simplified87.1%
associate-/r/85.5%
Applied egg-rr85.5%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.95e-22) (+ x (* y (/ (- z t) a))) (if (<= a 3.5e-5) (+ x (- y (/ y (/ t z)))) (+ x (* z (/ y (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.95e-22) {
tmp = x + (y * ((z - t) / a));
} else if (a <= 3.5e-5) {
tmp = x + (y - (y / (t / 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.95d-22)) then
tmp = x + (y * ((z - t) / a))
else if (a <= 3.5d-5) then
tmp = x + (y - (y / (t / 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.95e-22) {
tmp = x + (y * ((z - t) / a));
} else if (a <= 3.5e-5) {
tmp = x + (y - (y / (t / z)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.95e-22: tmp = x + (y * ((z - t) / a)) elif a <= 3.5e-5: tmp = x + (y - (y / (t / z))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.95e-22) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (a <= 3.5e-5) tmp = Float64(x + Float64(y - Float64(y / Float64(t / 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.95e-22) tmp = x + (y * ((z - t) / a)); elseif (a <= 3.5e-5) tmp = x + (y - (y / (t / z))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.95e-22], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e-5], N[(x + N[(y - N[(y / N[(t / 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.95 \cdot 10^{-22}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{t}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if a < -3.9499999999999999e-22Initial program 99.8%
Taylor expanded in a around inf 90.5%
if -3.9499999999999999e-22 < a < 3.4999999999999997e-5Initial program 98.4%
Taylor expanded in a around 0 86.4%
associate-*r/86.4%
neg-mul-186.4%
neg-sub086.4%
associate--r-86.4%
neg-sub086.4%
Simplified86.4%
Taylor expanded in z around 0 81.8%
+-commutative81.8%
mul-1-neg81.8%
unsub-neg81.8%
associate-/l*86.4%
Simplified86.4%
if 3.4999999999999997e-5 < a Initial program 99.2%
Taylor expanded in z around inf 76.2%
associate-/l*85.4%
Simplified85.4%
associate-/r/85.4%
Applied egg-rr85.4%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.8e-22) (+ x (* y (/ (- z t) a))) (if (<= a 9.2e+17) (+ x (- y (/ y (/ t z)))) (+ x (/ (- z t) (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.8e-22) {
tmp = x + (y * ((z - t) / a));
} else if (a <= 9.2e+17) {
tmp = x + (y - (y / (t / z)));
} else {
tmp = x + ((z - t) / (a / 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 (a <= (-5.8d-22)) then
tmp = x + (y * ((z - t) / a))
else if (a <= 9.2d+17) then
tmp = x + (y - (y / (t / z)))
else
tmp = x + ((z - t) / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.8e-22) {
tmp = x + (y * ((z - t) / a));
} else if (a <= 9.2e+17) {
tmp = x + (y - (y / (t / z)));
} else {
tmp = x + ((z - t) / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.8e-22: tmp = x + (y * ((z - t) / a)) elif a <= 9.2e+17: tmp = x + (y - (y / (t / z))) else: tmp = x + ((z - t) / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.8e-22) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (a <= 9.2e+17) tmp = Float64(x + Float64(y - Float64(y / Float64(t / z)))); else tmp = Float64(x + Float64(Float64(z - t) / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.8e-22) tmp = x + (y * ((z - t) / a)); elseif (a <= 9.2e+17) tmp = x + (y - (y / (t / z))); else tmp = x + ((z - t) / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.8e-22], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.2e+17], N[(x + N[(y - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{-22}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{+17}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{t}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\
\end{array}
\end{array}
if a < -5.8000000000000003e-22Initial program 99.8%
Taylor expanded in a around inf 90.5%
if -5.8000000000000003e-22 < a < 9.2e17Initial program 98.5%
Taylor expanded in a around 0 86.0%
associate-*r/86.0%
neg-mul-186.0%
neg-sub086.0%
associate--r-86.0%
neg-sub086.0%
Simplified86.0%
Taylor expanded in z around 0 81.6%
+-commutative81.6%
mul-1-neg81.6%
unsub-neg81.6%
associate-/l*86.0%
Simplified86.0%
if 9.2e17 < a Initial program 99.2%
associate-*r/83.4%
Simplified83.4%
associate-/l*99.2%
associate-/r/95.7%
Applied egg-rr95.7%
Taylor expanded in a around inf 74.3%
*-commutative74.3%
associate-/l*86.8%
Simplified86.8%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.95e-22) (+ x (* y (/ (- z t) a))) (if (<= a 1.02e+18) (+ x (* y (/ (- t z) t))) (+ x (/ (- z t) (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.95e-22) {
tmp = x + (y * ((z - t) / a));
} else if (a <= 1.02e+18) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + ((z - t) / (a / 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 (a <= (-1.95d-22)) then
tmp = x + (y * ((z - t) / a))
else if (a <= 1.02d+18) then
tmp = x + (y * ((t - z) / t))
else
tmp = x + ((z - t) / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.95e-22) {
tmp = x + (y * ((z - t) / a));
} else if (a <= 1.02e+18) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + ((z - t) / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.95e-22: tmp = x + (y * ((z - t) / a)) elif a <= 1.02e+18: tmp = x + (y * ((t - z) / t)) else: tmp = x + ((z - t) / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.95e-22) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (a <= 1.02e+18) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = Float64(x + Float64(Float64(z - t) / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.95e-22) tmp = x + (y * ((z - t) / a)); elseif (a <= 1.02e+18) tmp = x + (y * ((t - z) / t)); else tmp = x + ((z - t) / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.95e-22], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.02e+18], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{-22}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{+18}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\
\end{array}
\end{array}
if a < -1.94999999999999999e-22Initial program 99.8%
Taylor expanded in a around inf 90.5%
if -1.94999999999999999e-22 < a < 1.02e18Initial program 98.5%
Taylor expanded in a around 0 86.0%
associate-*r/86.0%
neg-mul-186.0%
neg-sub086.0%
associate--r-86.0%
neg-sub086.0%
Simplified86.0%
if 1.02e18 < a Initial program 99.2%
associate-*r/83.4%
Simplified83.4%
associate-/l*99.2%
associate-/r/95.7%
Applied egg-rr95.7%
Taylor expanded in a around inf 74.3%
*-commutative74.3%
associate-/l*86.8%
Simplified86.8%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -8.1e+145) (+ x (- y (/ y (/ t z)))) (if (<= t 1.9e+104) (+ x (/ y (/ (- a t) z))) (- x (* t (/ y (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.1e+145) {
tmp = x + (y - (y / (t / z)));
} else if (t <= 1.9e+104) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (t * (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 (t <= (-8.1d+145)) then
tmp = x + (y - (y / (t / z)))
else if (t <= 1.9d+104) then
tmp = x + (y / ((a - t) / z))
else
tmp = x - (t * (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 (t <= -8.1e+145) {
tmp = x + (y - (y / (t / z)));
} else if (t <= 1.9e+104) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (t * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.1e+145: tmp = x + (y - (y / (t / z))) elif t <= 1.9e+104: tmp = x + (y / ((a - t) / z)) else: tmp = x - (t * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.1e+145) tmp = Float64(x + Float64(y - Float64(y / Float64(t / z)))); elseif (t <= 1.9e+104) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x - Float64(t * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.1e+145) tmp = x + (y - (y / (t / z))); elseif (t <= 1.9e+104) tmp = x + (y / ((a - t) / z)); else tmp = x - (t * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.1e+145], N[(x + N[(y - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+104], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.1 \cdot 10^{+145}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{t}{z}}\right)\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+104}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -8.1000000000000001e145Initial program 100.0%
Taylor expanded in a around 0 89.5%
associate-*r/89.5%
neg-mul-189.5%
neg-sub089.5%
associate--r-89.5%
neg-sub089.5%
Simplified89.5%
Taylor expanded in z around 0 86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
associate-/l*89.5%
Simplified89.5%
if -8.1000000000000001e145 < t < 1.89999999999999984e104Initial program 98.6%
Taylor expanded in z around inf 81.1%
associate-/l*87.1%
Simplified87.1%
if 1.89999999999999984e104 < t Initial program 99.9%
associate-*r/51.1%
Simplified51.1%
associate-/l*99.9%
associate-/r/96.9%
Applied egg-rr96.9%
Taylor expanded in z around 0 50.9%
associate-*r/50.9%
mul-1-neg50.9%
distribute-rgt-neg-out50.9%
associate-*l/89.0%
Simplified89.0%
Final simplification87.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.15e-5) (+ x y) (if (<= t 850.0) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.15e-5) {
tmp = x + y;
} else if (t <= 850.0) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.15d-5)) then
tmp = x + y
else if (t <= 850.0d0) then
tmp = x + (y * (z / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.15e-5) {
tmp = x + y;
} else if (t <= 850.0) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.15e-5: tmp = x + y elif t <= 850.0: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.15e-5) tmp = Float64(x + y); elseif (t <= 850.0) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.15e-5) tmp = x + y; elseif (t <= 850.0) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.15e-5], N[(x + y), $MachinePrecision], If[LessEqual[t, 850.0], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{-5}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 850:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.15e-5 or 850 < t Initial program 99.9%
Taylor expanded in t around inf 74.4%
if -1.15e-5 < t < 850Initial program 98.1%
Taylor expanded in t around 0 77.4%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (if (<= a 3.9e+14) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.9e+14) {
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 <= 3.9d+14) 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 <= 3.9e+14) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 3.9e+14: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 3.9e+14) 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 <= 3.9e+14) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 3.9e+14], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.9 \cdot 10^{+14}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 3.9e14Initial program 99.0%
Taylor expanded in t around inf 60.4%
if 3.9e14 < a Initial program 99.2%
Taylor expanded in x around inf 63.4%
Final simplification61.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.0%
Taylor expanded in x around inf 49.4%
Final simplification49.4%
(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 2023185
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(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)))))