
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (- t z) (/ y (- t a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((t - z) * (y / (t - a)));
}
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 + ((t - z) * (y / (t - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((t - z) * (y / (t - a)));
}
def code(x, y, z, t, a): return x + ((t - z) * (y / (t - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(t - z) * Float64(y / Float64(t - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((t - z) * (y / (t - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(t - z), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - z\right) \cdot \frac{y}{t - a}
\end{array}
Initial program 87.5%
*-commutative87.5%
associate-/l*98.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ z (- t a))))))
(if (<= t -1.52e+240)
(+ x y)
(if (<= t -6e+40)
t_1
(if (<= t -9.5e-9)
(+ x y)
(if (<= t 3.8e-123)
(+ x (* z (/ y a)))
(if (<= t 2.6e+94) t_1 (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (z / (t - a)));
double tmp;
if (t <= -1.52e+240) {
tmp = x + y;
} else if (t <= -6e+40) {
tmp = t_1;
} else if (t <= -9.5e-9) {
tmp = x + y;
} else if (t <= 3.8e-123) {
tmp = x + (z * (y / a));
} else if (t <= 2.6e+94) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - (y * (z / (t - a)))
if (t <= (-1.52d+240)) then
tmp = x + y
else if (t <= (-6d+40)) then
tmp = t_1
else if (t <= (-9.5d-9)) then
tmp = x + y
else if (t <= 3.8d-123) then
tmp = x + (z * (y / a))
else if (t <= 2.6d+94) then
tmp = t_1
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (z / (t - a)));
double tmp;
if (t <= -1.52e+240) {
tmp = x + y;
} else if (t <= -6e+40) {
tmp = t_1;
} else if (t <= -9.5e-9) {
tmp = x + y;
} else if (t <= 3.8e-123) {
tmp = x + (z * (y / a));
} else if (t <= 2.6e+94) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (z / (t - a))) tmp = 0 if t <= -1.52e+240: tmp = x + y elif t <= -6e+40: tmp = t_1 elif t <= -9.5e-9: tmp = x + y elif t <= 3.8e-123: tmp = x + (z * (y / a)) elif t <= 2.6e+94: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(z / Float64(t - a)))) tmp = 0.0 if (t <= -1.52e+240) tmp = Float64(x + y); elseif (t <= -6e+40) tmp = t_1; elseif (t <= -9.5e-9) tmp = Float64(x + y); elseif (t <= 3.8e-123) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (t <= 2.6e+94) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (z / (t - a))); tmp = 0.0; if (t <= -1.52e+240) tmp = x + y; elseif (t <= -6e+40) tmp = t_1; elseif (t <= -9.5e-9) tmp = x + y; elseif (t <= 3.8e-123) tmp = x + (z * (y / a)); elseif (t <= 2.6e+94) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.52e+240], N[(x + y), $MachinePrecision], If[LessEqual[t, -6e+40], t$95$1, If[LessEqual[t, -9.5e-9], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.8e-123], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+94], t$95$1, N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{z}{t - a}\\
\mathbf{if}\;t \leq -1.52 \cdot 10^{+240}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -6 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-9}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-123}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.5200000000000001e240 or -6.0000000000000004e40 < t < -9.5000000000000007e-9 or 2.5999999999999999e94 < t Initial program 70.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -1.5200000000000001e240 < t < -6.0000000000000004e40 or 3.79999999999999996e-123 < t < 2.5999999999999999e94Initial program 94.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 84.1%
associate-/l*89.3%
Simplified89.3%
if -9.5000000000000007e-9 < t < 3.79999999999999996e-123Initial program 94.9%
*-commutative94.9%
associate-/l*99.3%
Applied egg-rr99.3%
Taylor expanded in t around 0 89.8%
*-commutative89.8%
associate-/l*94.2%
Simplified94.2%
Final simplification90.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.6e+122)
(+ x y)
(if (<= t -2.2e+38)
(- x (* y (/ z t)))
(if (or (<= t -1.5e-7) (not (<= t 1.95e+67)))
(+ x y)
(+ x (* z (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.6e+122) {
tmp = x + y;
} else if (t <= -2.2e+38) {
tmp = x - (y * (z / t));
} else if ((t <= -1.5e-7) || !(t <= 1.95e+67)) {
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 <= (-4.6d+122)) then
tmp = x + y
else if (t <= (-2.2d+38)) then
tmp = x - (y * (z / t))
else if ((t <= (-1.5d-7)) .or. (.not. (t <= 1.95d+67))) 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 <= -4.6e+122) {
tmp = x + y;
} else if (t <= -2.2e+38) {
tmp = x - (y * (z / t));
} else if ((t <= -1.5e-7) || !(t <= 1.95e+67)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.6e+122: tmp = x + y elif t <= -2.2e+38: tmp = x - (y * (z / t)) elif (t <= -1.5e-7) or not (t <= 1.95e+67): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.6e+122) tmp = Float64(x + y); elseif (t <= -2.2e+38) tmp = Float64(x - Float64(y * Float64(z / t))); elseif ((t <= -1.5e-7) || !(t <= 1.95e+67)) 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 <= -4.6e+122) tmp = x + y; elseif (t <= -2.2e+38) tmp = x - (y * (z / t)); elseif ((t <= -1.5e-7) || ~((t <= 1.95e+67))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.6e+122], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.2e+38], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.5e-7], N[Not[LessEqual[t, 1.95e+67]], $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 -4.6 \cdot 10^{+122}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{+38}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{-7} \lor \neg \left(t \leq 1.95 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -4.6000000000000001e122 or -2.20000000000000006e38 < t < -1.4999999999999999e-7 or 1.95000000000000003e67 < t Initial program 76.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 84.8%
+-commutative84.8%
Simplified84.8%
if -4.6000000000000001e122 < t < -2.20000000000000006e38Initial program 93.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 74.9%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in a around 0 74.4%
mul-1-neg74.4%
unsub-neg74.4%
associate-/l*80.4%
Simplified80.4%
if -1.4999999999999999e-7 < t < 1.95000000000000003e67Initial program 95.3%
*-commutative95.3%
associate-/l*98.2%
Applied egg-rr98.2%
Taylor expanded in t around 0 85.3%
*-commutative85.3%
associate-/l*89.2%
Simplified89.2%
Final simplification86.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -6.9e-19)
(+ x y)
(if (<= t 2e-257)
x
(if (<= t 3e-213) (* z (/ y a)) (if (<= t 4.4e-82) x (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.9e-19) {
tmp = x + y;
} else if (t <= 2e-257) {
tmp = x;
} else if (t <= 3e-213) {
tmp = z * (y / a);
} else if (t <= 4.4e-82) {
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 (t <= (-6.9d-19)) then
tmp = x + y
else if (t <= 2d-257) then
tmp = x
else if (t <= 3d-213) then
tmp = z * (y / a)
else if (t <= 4.4d-82) 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 (t <= -6.9e-19) {
tmp = x + y;
} else if (t <= 2e-257) {
tmp = x;
} else if (t <= 3e-213) {
tmp = z * (y / a);
} else if (t <= 4.4e-82) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.9e-19: tmp = x + y elif t <= 2e-257: tmp = x elif t <= 3e-213: tmp = z * (y / a) elif t <= 4.4e-82: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.9e-19) tmp = Float64(x + y); elseif (t <= 2e-257) tmp = x; elseif (t <= 3e-213) tmp = Float64(z * Float64(y / a)); elseif (t <= 4.4e-82) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.9e-19) tmp = x + y; elseif (t <= 2e-257) tmp = x; elseif (t <= 3e-213) tmp = z * (y / a); elseif (t <= 4.4e-82) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.9e-19], N[(x + y), $MachinePrecision], If[LessEqual[t, 2e-257], x, If[LessEqual[t, 3e-213], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-82], x, N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.9 \cdot 10^{-19}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-257}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-213}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-82}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -6.8999999999999999e-19 or 4.39999999999999971e-82 < t Initial program 82.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 76.7%
+-commutative76.7%
Simplified76.7%
if -6.8999999999999999e-19 < t < 2e-257 or 2.99999999999999986e-213 < t < 4.39999999999999971e-82Initial program 96.2%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in x around inf 65.2%
if 2e-257 < t < 2.99999999999999986e-213Initial program 83.7%
associate-/l*83.1%
Simplified83.1%
Taylor expanded in t around 0 83.7%
+-commutative83.7%
associate-/l*83.1%
Simplified83.1%
Taylor expanded in z around inf 99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in y around inf 99.5%
Final simplification72.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e+22) (not (<= z 1.1e-35))) (- x (* y (/ z (- t a)))) (+ x (* y (/ t (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+22) || !(z <= 1.1e-35)) {
tmp = x - (y * (z / (t - a)));
} 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 ((z <= (-1.5d+22)) .or. (.not. (z <= 1.1d-35))) then
tmp = x - (y * (z / (t - a)))
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 ((z <= -1.5e+22) || !(z <= 1.1e-35)) {
tmp = x - (y * (z / (t - a)));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e+22) or not (z <= 1.1e-35): tmp = x - (y * (z / (t - a))) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e+22) || !(z <= 1.1e-35)) tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); 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 ((z <= -1.5e+22) || ~((z <= 1.1e-35))) tmp = x - (y * (z / (t - a))); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e+22], N[Not[LessEqual[z, 1.1e-35]], $MachinePrecision]], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+22} \lor \neg \left(z \leq 1.1 \cdot 10^{-35}\right):\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if z < -1.5e22 or 1.09999999999999997e-35 < z Initial program 87.3%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 83.5%
associate-/l*88.0%
Simplified88.0%
if -1.5e22 < z < 1.09999999999999997e-35Initial program 87.7%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in z around 0 83.4%
mul-1-neg83.4%
unsub-neg83.4%
*-commutative83.4%
associate-/l*94.4%
Simplified94.4%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6e-7) (not (<= t 8.6e+79))) (- x (* y (+ (/ z t) -1.0))) (- x (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6e-7) || !(t <= 8.6e+79)) {
tmp = x - (y * ((z / t) + -1.0));
} 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 <= (-6d-7)) .or. (.not. (t <= 8.6d+79))) then
tmp = x - (y * ((z / t) + (-1.0d0)))
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 <= -6e-7) || !(t <= 8.6e+79)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6e-7) or not (t <= 8.6e+79): tmp = x - (y * ((z / t) + -1.0)) else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6e-7) || !(t <= 8.6e+79)) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); else tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6e-7) || ~((t <= 8.6e+79))) tmp = x - (y * ((z / t) + -1.0)); else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6e-7], N[Not[LessEqual[t, 8.6e+79]], $MachinePrecision]], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-7} \lor \neg \left(t \leq 8.6 \cdot 10^{+79}\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -5.9999999999999997e-7 or 8.6000000000000006e79 < t Initial program 77.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 67.9%
mul-1-neg67.9%
unsub-neg67.9%
associate-/l*87.7%
div-sub87.7%
sub-neg87.7%
*-inverses87.7%
metadata-eval87.7%
Simplified87.7%
if -5.9999999999999997e-7 < t < 8.6000000000000006e79Initial program 95.4%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around inf 91.4%
associate-/l*92.6%
Simplified92.6%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e-12) (not (<= t 1.9e+67))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e-12) || !(t <= 1.9e+67)) {
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 <= (-4.8d-12)) .or. (.not. (t <= 1.9d+67))) 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 <= -4.8e-12) || !(t <= 1.9e+67)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e-12) or not (t <= 1.9e+67): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e-12) || !(t <= 1.9e+67)) 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 <= -4.8e-12) || ~((t <= 1.9e+67))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e-12], N[Not[LessEqual[t, 1.9e+67]], $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 -4.8 \cdot 10^{-12} \lor \neg \left(t \leq 1.9 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -4.79999999999999974e-12 or 1.9000000000000001e67 < t Initial program 78.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 80.2%
+-commutative80.2%
Simplified80.2%
if -4.79999999999999974e-12 < t < 1.9000000000000001e67Initial program 95.3%
*-commutative95.3%
associate-/l*98.2%
Applied egg-rr98.2%
Taylor expanded in t around 0 85.3%
*-commutative85.3%
associate-/l*89.2%
Simplified89.2%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.3e-19) (not (<= t 4e-82))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.3e-19) || !(t <= 4e-82)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-5.3d-19)) .or. (.not. (t <= 4d-82))) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.3e-19) || !(t <= 4e-82)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.3e-19) or not (t <= 4e-82): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.3e-19) || !(t <= 4e-82)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.3e-19) || ~((t <= 4e-82))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.3e-19], N[Not[LessEqual[t, 4e-82]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.3 \cdot 10^{-19} \lor \neg \left(t \leq 4 \cdot 10^{-82}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.29999999999999972e-19 or 4e-82 < t Initial program 82.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 76.7%
+-commutative76.7%
Simplified76.7%
if -5.29999999999999972e-19 < t < 4e-82Initial program 95.5%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in x around inf 61.6%
Final simplification70.6%
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (y * ((t - z) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (a - t)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (a - t)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{a - t}
\end{array}
Initial program 87.5%
associate-/l*97.7%
Simplified97.7%
Final simplification97.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 87.5%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around inf 56.7%
(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}
herbie shell --seed 2024105
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))