
(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 11 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 (/ 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 84.4%
associate-/l*98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.2e+66) (not (<= t 860000.0))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e+66) || !(t <= 860000.0)) {
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 <= (-4.2d+66)) .or. (.not. (t <= 860000.0d0))) 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 <= -4.2e+66) || !(t <= 860000.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.2e+66) or not (t <= 860000.0): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.2e+66) || !(t <= 860000.0)) 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 <= -4.2e+66) || ~((t <= 860000.0))) 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, -4.2e+66], N[Not[LessEqual[t, 860000.0]], $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 -4.2 \cdot 10^{+66} \lor \neg \left(t \leq 860000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -4.20000000000000011e66 or 8.6e5 < t Initial program 73.9%
+-commutative73.9%
associate-*l/93.9%
fma-def93.9%
Simplified93.9%
Taylor expanded in t around inf 76.0%
+-commutative76.0%
Simplified76.0%
if -4.20000000000000011e66 < t < 8.6e5Initial program 95.2%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around inf 87.5%
associate-*l/89.4%
*-commutative89.4%
Simplified89.4%
Final simplification82.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.25e+85) (not (<= t 4.5e+171))) (+ x y) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.25e+85) || !(t <= 4.5e+171)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / 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.25d+85)) .or. (.not. (t <= 4.5d+171))) then
tmp = x + y
else
tmp = x + (y / ((a - t) / 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.25e+85) || !(t <= 4.5e+171)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.25e+85) or not (t <= 4.5e+171): tmp = x + y else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.25e+85) || !(t <= 4.5e+171)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.25e+85) || ~((t <= 4.5e+171))) tmp = x + y; else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.25e+85], N[Not[LessEqual[t, 4.5e+171]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+85} \lor \neg \left(t \leq 4.5 \cdot 10^{+171}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.25e85 or 4.49999999999999969e171 < t Initial program 68.2%
+-commutative68.2%
associate-*l/94.6%
fma-def94.6%
Simplified94.6%
Taylor expanded in t around inf 82.1%
+-commutative82.1%
Simplified82.1%
if -1.25e85 < t < 4.49999999999999969e171Initial program 93.9%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in z around inf 83.9%
Final simplification83.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.45e+85) (not (<= t 1.52e-6))) (- x (/ y (+ (/ a t) -1.0))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e+85) || !(t <= 1.52e-6)) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (y / ((a - t) / 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.45d+85)) .or. (.not. (t <= 1.52d-6))) then
tmp = x - (y / ((a / t) + (-1.0d0)))
else
tmp = x + (y / ((a - t) / 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.45e+85) || !(t <= 1.52e-6)) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.45e+85) or not (t <= 1.52e-6): tmp = x - (y / ((a / t) + -1.0)) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.45e+85) || !(t <= 1.52e-6)) tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.45e+85) || ~((t <= 1.52e-6))) tmp = x - (y / ((a / t) + -1.0)); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.45e+85], N[Not[LessEqual[t, 1.52e-6]], $MachinePrecision]], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+85} \lor \neg \left(t \leq 1.52 \cdot 10^{-6}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.44999999999999999e85 or 1.52000000000000006e-6 < t Initial program 73.9%
+-commutative73.9%
associate-*l/94.6%
fma-def94.6%
Simplified94.6%
Taylor expanded in z around 0 66.9%
mul-1-neg66.9%
unsub-neg66.9%
*-commutative66.9%
associate-/l*88.8%
div-sub88.8%
sub-neg88.8%
*-inverses88.8%
metadata-eval88.8%
Simplified88.8%
if -1.44999999999999999e85 < t < 1.52000000000000006e-6Initial program 95.2%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around inf 89.2%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.12e+86) (- x (/ y (+ (/ a t) -1.0))) (if (<= t 7.6e-48) (+ x (/ y (/ (- a t) z))) (- x (/ y (/ t (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.12e+86) {
tmp = x - (y / ((a / t) + -1.0));
} else if (t <= 7.6e-48) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (y / (t / (z - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.12d+86)) then
tmp = x - (y / ((a / t) + (-1.0d0)))
else if (t <= 7.6d-48) then
tmp = x + (y / ((a - t) / z))
else
tmp = x - (y / (t / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.12e+86) {
tmp = x - (y / ((a / t) + -1.0));
} else if (t <= 7.6e-48) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (y / (t / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.12e+86: tmp = x - (y / ((a / t) + -1.0)) elif t <= 7.6e-48: tmp = x + (y / ((a - t) / z)) else: tmp = x - (y / (t / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.12e+86) tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); elseif (t <= 7.6e-48) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.12e+86) tmp = x - (y / ((a / t) + -1.0)); elseif (t <= 7.6e-48) tmp = x + (y / ((a - t) / z)); else tmp = x - (y / (t / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.12e+86], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.6e-48], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{+86}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{-48}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\end{array}
\end{array}
if t < -1.12e86Initial program 67.6%
+-commutative67.6%
associate-*l/96.8%
fma-def96.8%
Simplified96.8%
Taylor expanded in z around 0 63.1%
mul-1-neg63.1%
unsub-neg63.1%
*-commutative63.1%
associate-/l*92.4%
div-sub92.4%
sub-neg92.4%
*-inverses92.4%
metadata-eval92.4%
Simplified92.4%
if -1.12e86 < t < 7.60000000000000005e-48Initial program 95.0%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in z around inf 90.2%
if 7.60000000000000005e-48 < t Initial program 81.8%
+-commutative81.8%
associate-*l/93.5%
fma-def93.5%
Simplified93.5%
Taylor expanded in a around 0 68.0%
mul-1-neg68.0%
unsub-neg68.0%
associate-/l*85.0%
Simplified85.0%
Final simplification89.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.15e+34) (not (<= t 6.8e-9))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.15e+34) || !(t <= 6.8e-9)) {
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.15d+34)) .or. (.not. (t <= 6.8d-9))) 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.15e+34) || !(t <= 6.8e-9)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.15e+34) or not (t <= 6.8e-9): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.15e+34) || !(t <= 6.8e-9)) 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.15e+34) || ~((t <= 6.8e-9))) 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.15e+34], N[Not[LessEqual[t, 6.8e-9]], $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.15 \cdot 10^{+34} \lor \neg \left(t \leq 6.8 \cdot 10^{-9}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.14999999999999997e34 or 6.7999999999999997e-9 < t Initial program 74.1%
+-commutative74.1%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in t around inf 74.6%
+-commutative74.6%
Simplified74.6%
if -2.14999999999999997e34 < t < 6.7999999999999997e-9Initial program 96.4%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 89.0%
associate-*l/89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in a around inf 79.1%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.7e+37) (not (<= t 1.52e-6))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.7e+37) || !(t <= 1.52e-6)) {
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.7d+37)) .or. (.not. (t <= 1.52d-6))) 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.7e+37) || !(t <= 1.52e-6)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.7e+37) or not (t <= 1.52e-6): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.7e+37) || !(t <= 1.52e-6)) 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.7e+37) || ~((t <= 1.52e-6))) 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.7e+37], N[Not[LessEqual[t, 1.52e-6]], $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.7 \cdot 10^{+37} \lor \neg \left(t \leq 1.52 \cdot 10^{-6}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.70000000000000003e37 or 1.52000000000000006e-6 < t Initial program 74.1%
+-commutative74.1%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in t around inf 74.6%
+-commutative74.6%
Simplified74.6%
if -1.70000000000000003e37 < t < 1.52000000000000006e-6Initial program 96.4%
associate-/l*97.2%
Simplified97.2%
clear-num97.2%
associate-/r/96.6%
clear-num96.6%
Applied egg-rr96.6%
Taylor expanded in t around 0 80.7%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.3e+39) (not (<= t 8e-8))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.3e+39) || !(t <= 8e-8)) {
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.3d+39)) .or. (.not. (t <= 8d-8))) 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.3e+39) || !(t <= 8e-8)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.3e+39) or not (t <= 8e-8): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.3e+39) || !(t <= 8e-8)) 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.3e+39) || ~((t <= 8e-8))) 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.3e+39], N[Not[LessEqual[t, 8e-8]], $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.3 \cdot 10^{+39} \lor \neg \left(t \leq 8 \cdot 10^{-8}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.3e39 or 8.0000000000000002e-8 < t Initial program 74.1%
+-commutative74.1%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in t around inf 74.6%
+-commutative74.6%
Simplified74.6%
if -4.3e39 < t < 8.0000000000000002e-8Initial program 96.4%
+-commutative96.4%
associate-*l/96.6%
fma-def96.6%
Simplified96.6%
Taylor expanded in t around 0 79.1%
+-commutative79.1%
associate-/l*81.3%
Simplified81.3%
Final simplification77.7%
(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 84.4%
associate-/l*98.7%
Simplified98.7%
clear-num98.6%
associate-/r/98.4%
clear-num98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 84.4%
+-commutative84.4%
associate-*l/95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in t around inf 61.3%
+-commutative61.3%
Simplified61.3%
Final simplification61.3%
(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 84.4%
+-commutative84.4%
associate-*l/95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in y around 0 45.3%
Final simplification45.3%
(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 2024011
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))