
(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 98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z a))))
(if (<= z -3.1e+189)
t_1
(if (<= z 3.4e-131)
(+ x y)
(if (<= z 9.5e-63) x (if (<= z 2.75e+247) (+ x y) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / a);
double tmp;
if (z <= -3.1e+189) {
tmp = t_1;
} else if (z <= 3.4e-131) {
tmp = x + y;
} else if (z <= 9.5e-63) {
tmp = x;
} else if (z <= 2.75e+247) {
tmp = x + y;
} 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 = y * (z / a)
if (z <= (-3.1d+189)) then
tmp = t_1
else if (z <= 3.4d-131) then
tmp = x + y
else if (z <= 9.5d-63) then
tmp = x
else if (z <= 2.75d+247) then
tmp = x + y
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 * (z / a);
double tmp;
if (z <= -3.1e+189) {
tmp = t_1;
} else if (z <= 3.4e-131) {
tmp = x + y;
} else if (z <= 9.5e-63) {
tmp = x;
} else if (z <= 2.75e+247) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / a) tmp = 0 if z <= -3.1e+189: tmp = t_1 elif z <= 3.4e-131: tmp = x + y elif z <= 9.5e-63: tmp = x elif z <= 2.75e+247: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / a)) tmp = 0.0 if (z <= -3.1e+189) tmp = t_1; elseif (z <= 3.4e-131) tmp = Float64(x + y); elseif (z <= 9.5e-63) tmp = x; elseif (z <= 2.75e+247) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / a); tmp = 0.0; if (z <= -3.1e+189) tmp = t_1; elseif (z <= 3.4e-131) tmp = x + y; elseif (z <= 9.5e-63) tmp = x; elseif (z <= 2.75e+247) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+189], t$95$1, If[LessEqual[z, 3.4e-131], N[(x + y), $MachinePrecision], If[LessEqual[z, 9.5e-63], x, If[LessEqual[z, 2.75e+247], N[(x + y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-131}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{+247}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.0999999999999999e189 or 2.7499999999999999e247 < z Initial program 93.5%
Taylor expanded in t around 0 54.9%
+-commutative54.9%
associate-/l*67.2%
associate-/r/69.6%
Simplified69.6%
Taylor expanded in y around 0 54.9%
Taylor expanded in y around inf 44.6%
associate-*r/56.9%
Simplified56.9%
if -3.0999999999999999e189 < z < 3.39999999999999995e-131 or 9.50000000000000016e-63 < z < 2.7499999999999999e247Initial program 99.4%
Taylor expanded in t around inf 70.3%
+-commutative70.3%
Simplified70.3%
if 3.39999999999999995e-131 < z < 9.50000000000000016e-63Initial program 99.8%
Taylor expanded in x around inf 78.2%
Final simplification68.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.9e+188)
(* z (/ y a))
(if (<= z 8.2e-132)
(+ x y)
(if (<= z 9.2e-63) x (if (<= z 7.8e+250) (+ x y) (* y (/ z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e+188) {
tmp = z * (y / a);
} else if (z <= 8.2e-132) {
tmp = x + y;
} else if (z <= 9.2e-63) {
tmp = x;
} else if (z <= 7.8e+250) {
tmp = x + y;
} else {
tmp = y * (z / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.9d+188)) then
tmp = z * (y / a)
else if (z <= 8.2d-132) then
tmp = x + y
else if (z <= 9.2d-63) then
tmp = x
else if (z <= 7.8d+250) then
tmp = x + y
else
tmp = y * (z / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e+188) {
tmp = z * (y / a);
} else if (z <= 8.2e-132) {
tmp = x + y;
} else if (z <= 9.2e-63) {
tmp = x;
} else if (z <= 7.8e+250) {
tmp = x + y;
} else {
tmp = y * (z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.9e+188: tmp = z * (y / a) elif z <= 8.2e-132: tmp = x + y elif z <= 9.2e-63: tmp = x elif z <= 7.8e+250: tmp = x + y else: tmp = y * (z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e+188) tmp = Float64(z * Float64(y / a)); elseif (z <= 8.2e-132) tmp = Float64(x + y); elseif (z <= 9.2e-63) tmp = x; elseif (z <= 7.8e+250) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.9e+188) tmp = z * (y / a); elseif (z <= 8.2e-132) tmp = x + y; elseif (z <= 9.2e-63) tmp = x; elseif (z <= 7.8e+250) tmp = x + y; else tmp = y * (z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e+188], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e-132], N[(x + y), $MachinePrecision], If[LessEqual[z, 9.2e-63], x, If[LessEqual[z, 7.8e+250], N[(x + y), $MachinePrecision], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+188}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-132}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+250}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if z < -2.8999999999999999e188Initial program 90.2%
Taylor expanded in t around 0 61.6%
+-commutative61.6%
associate-/l*73.7%
associate-/r/77.4%
Simplified77.4%
Taylor expanded in y around 0 61.6%
Taylor expanded in y around inf 46.1%
*-commutative46.1%
associate-*r/61.9%
Simplified61.9%
if -2.8999999999999999e188 < z < 8.20000000000000013e-132 or 9.2e-63 < z < 7.8e250Initial program 99.4%
Taylor expanded in t around inf 70.3%
+-commutative70.3%
Simplified70.3%
if 8.20000000000000013e-132 < z < 9.2e-63Initial program 99.8%
Taylor expanded in x around inf 78.2%
if 7.8e250 < z Initial program 100.0%
Taylor expanded in t around 0 41.7%
+-commutative41.7%
associate-/l*54.1%
associate-/r/54.0%
Simplified54.0%
Taylor expanded in y around 0 41.7%
Taylor expanded in y around inf 41.7%
associate-*r/54.1%
Simplified54.1%
Final simplification68.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e+48) (not (<= t 2500.0))) (+ x y) (+ x (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+48) || !(t <= 2500.0)) {
tmp = x + y;
} else {
tmp = x + (y * ((z - 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 <= (-4.8d+48)) .or. (.not. (t <= 2500.0d0))) then
tmp = x + y
else
tmp = x + (y * ((z - 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 <= -4.8e+48) || !(t <= 2500.0)) {
tmp = x + y;
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e+48) or not (t <= 2500.0): tmp = x + y else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e+48) || !(t <= 2500.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.8e+48) || ~((t <= 2500.0))) tmp = x + y; else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e+48], N[Not[LessEqual[t, 2500.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+48} \lor \neg \left(t \leq 2500\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if t < -4.8000000000000002e48 or 2500 < t Initial program 99.9%
Taylor expanded in t around inf 75.7%
+-commutative75.7%
Simplified75.7%
if -4.8000000000000002e48 < t < 2500Initial program 97.0%
Taylor expanded in a around inf 83.2%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8e+155) (not (<= t 3000.0))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8e+155) || !(t <= 3000.0)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-8d+155)) .or. (.not. (t <= 3000.0d0))) then
tmp = x + y
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8e+155) || !(t <= 3000.0)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8e+155) or not (t <= 3000.0): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8e+155) || !(t <= 3000.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -8e+155) || ~((t <= 3000.0))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8e+155], N[Not[LessEqual[t, 3000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+155} \lor \neg \left(t \leq 3000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -8.00000000000000006e155 or 3e3 < t Initial program 99.9%
Taylor expanded in t around inf 79.7%
+-commutative79.7%
Simplified79.7%
if -8.00000000000000006e155 < t < 3e3Initial program 97.5%
Taylor expanded in z around inf 86.5%
*-commutative86.5%
associate-/l*89.4%
associate-/r/88.5%
Simplified88.5%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.5e+106) (not (<= t 65200.0))) (- x (* y (+ (/ z t) -1.0))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e+106) || !(t <= 65200.0)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.5d+106)) .or. (.not. (t <= 65200.0d0))) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e+106) || !(t <= 65200.0)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.5e+106) or not (t <= 65200.0): tmp = x - (y * ((z / t) + -1.0)) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.5e+106) || !(t <= 65200.0)) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.5e+106) || ~((t <= 65200.0))) tmp = x - (y * ((z / t) + -1.0)); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.5e+106], N[Not[LessEqual[t, 65200.0]], $MachinePrecision]], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+106} \lor \neg \left(t \leq 65200\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -2.4999999999999999e106 or 65200 < t Initial program 99.9%
Taylor expanded in a around 0 74.2%
mul-1-neg74.2%
unsub-neg74.2%
associate-/l*90.7%
associate-/r/86.3%
Simplified86.3%
Taylor expanded in t around 0 85.1%
*-commutative85.1%
+-commutative85.1%
associate-*r/90.7%
distribute-lft-in90.7%
Simplified90.7%
if -2.4999999999999999e106 < t < 65200Initial program 97.4%
Taylor expanded in z around inf 88.0%
*-commutative88.0%
associate-/l*90.5%
associate-/r/89.6%
Simplified89.6%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.4e-26) (not (<= z 3.3e-108))) (+ x (* y (/ z (- a t)))) (- x (* y (/ t (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e-26) || !(z <= 3.3e-108)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y * (t / (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 ((z <= (-1.4d-26)) .or. (.not. (z <= 3.3d-108))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x - (y * (t / (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 ((z <= -1.4e-26) || !(z <= 3.3e-108)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y * (t / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.4e-26) or not (z <= 3.3e-108): tmp = x + (y * (z / (a - t))) else: tmp = x - (y * (t / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.4e-26) || !(z <= 3.3e-108)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.4e-26) || ~((z <= 3.3e-108))) tmp = x + (y * (z / (a - t))); else tmp = x - (y * (t / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.4e-26], N[Not[LessEqual[z, 3.3e-108]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-26} \lor \neg \left(z \leq 3.3 \cdot 10^{-108}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\end{array}
\end{array}
if z < -1.4000000000000001e-26 or 3.3000000000000002e-108 < z Initial program 97.4%
Taylor expanded in z around inf 84.0%
*-commutative84.0%
associate-/l*88.8%
associate-/r/88.7%
Simplified88.7%
if -1.4000000000000001e-26 < z < 3.3000000000000002e-108Initial program 99.9%
Taylor expanded in z around 0 86.8%
mul-1-neg86.8%
unsub-neg86.8%
*-commutative86.8%
associate-/l*95.1%
Simplified95.1%
clear-num95.0%
associate-/r/95.1%
clear-num95.1%
Applied egg-rr95.1%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e-27) (not (<= z 2.2e-109))) (+ x (* y (/ z (- a t)))) (- x (/ y (/ (- a t) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-27) || !(z <= 2.2e-109)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y / ((a - t) / 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 ((z <= (-4.5d-27)) .or. (.not. (z <= 2.2d-109))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x - (y / ((a - t) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-27) || !(z <= 2.2e-109)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y / ((a - t) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e-27) or not (z <= 2.2e-109): tmp = x + (y * (z / (a - t))) else: tmp = x - (y / ((a - t) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e-27) || !(z <= 2.2e-109)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x - Float64(y / Float64(Float64(a - t) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.5e-27) || ~((z <= 2.2e-109))) tmp = x + (y * (z / (a - t))); else tmp = x - (y / ((a - t) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e-27], N[Not[LessEqual[z, 2.2e-109]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-27} \lor \neg \left(z \leq 2.2 \cdot 10^{-109}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{t}}\\
\end{array}
\end{array}
if z < -4.5000000000000002e-27 or 2.1999999999999999e-109 < z Initial program 97.4%
Taylor expanded in z around inf 84.0%
*-commutative84.0%
associate-/l*88.8%
associate-/r/88.7%
Simplified88.7%
if -4.5000000000000002e-27 < z < 2.1999999999999999e-109Initial program 99.9%
Taylor expanded in z around 0 86.8%
mul-1-neg86.8%
unsub-neg86.8%
*-commutative86.8%
associate-/l*95.1%
Simplified95.1%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.15e+47) (not (<= t 2800.0))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.15e+47) || !(t <= 2800.0)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.15d+47)) .or. (.not. (t <= 2800.0d0))) then
tmp = x + y
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.15e+47) || !(t <= 2800.0)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.15e+47) or not (t <= 2800.0): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.15e+47) || !(t <= 2800.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.15e+47) || ~((t <= 2800.0))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.15e+47], N[Not[LessEqual[t, 2800.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+47} \lor \neg \left(t \leq 2800\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.1499999999999999e47 or 2800 < t Initial program 99.9%
Taylor expanded in t around inf 75.7%
+-commutative75.7%
Simplified75.7%
if -1.1499999999999999e47 < t < 2800Initial program 97.0%
Taylor expanded in t around 0 79.7%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e+49) (not (<= t 1150.0))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+49) || !(t <= 1150.0)) {
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 <= (-2.2d+49)) .or. (.not. (t <= 1150.0d0))) 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 <= -2.2e+49) || !(t <= 1150.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e+49) or not (t <= 1150.0): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e+49) || !(t <= 1150.0)) 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 <= -2.2e+49) || ~((t <= 1150.0))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+49], N[Not[LessEqual[t, 1150.0]], $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 -2.2 \cdot 10^{+49} \lor \neg \left(t \leq 1150\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.2000000000000001e49 or 1150 < t Initial program 99.9%
Taylor expanded in t around inf 75.7%
+-commutative75.7%
Simplified75.7%
if -2.2000000000000001e49 < t < 1150Initial program 97.0%
Taylor expanded in t around 0 77.0%
+-commutative77.0%
associate-/l*79.9%
associate-/r/80.5%
Simplified80.5%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.1e+115) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.1e+115) {
tmp = x;
} 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 (a <= (-3.1d+115)) then
tmp = x
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 (a <= -3.1e+115) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.1e+115: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.1e+115) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.1e+115) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.1e+115], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+115}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.10000000000000005e115Initial program 99.9%
Taylor expanded in x around inf 60.8%
if -3.10000000000000005e115 < a Initial program 98.0%
Taylor expanded in t around inf 60.6%
+-commutative60.6%
Simplified60.6%
Final simplification60.7%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.4%
Taylor expanded in x around inf 49.7%
Final simplification49.7%
(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 2023308
(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)))))