
(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 15 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) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x - (y / ((a - t) / (t - z)));
}
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) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y / ((a - t) / (t - z)));
}
def code(x, y, z, t, a): return x - (y / ((a - t) / (t - z)))
function code(x, y, z, t, a) return Float64(x - Float64(y / Float64(Float64(a - t) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y / ((a - t) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{\frac{a - t}{t - z}}
\end{array}
Initial program 87.7%
associate-/l*98.4%
Simplified98.4%
clear-num98.4%
un-div-inv98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+75) (not (<= t 9.8e+78))) (+ x (* y (- 1.0 (/ z t)))) (+ x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+75) || !(t <= 9.8e+78)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (z / ((a - t) / 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.05d+75)) .or. (.not. (t <= 9.8d+78))) then
tmp = x + (y * (1.0d0 - (z / t)))
else
tmp = x + (z / ((a - t) / 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.05e+75) || !(t <= 9.8e+78)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+75) or not (t <= 9.8e+78): tmp = x + (y * (1.0 - (z / t))) else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+75) || !(t <= 9.8e+78)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e+75) || ~((t <= 9.8e+78))) tmp = x + (y * (1.0 - (z / t))); else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+75], N[Not[LessEqual[t, 9.8e+78]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+75} \lor \neg \left(t \leq 9.8 \cdot 10^{+78}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -1.04999999999999999e75 or 9.8000000000000004e78 < t Initial program 72.5%
+-commutative72.5%
*-commutative72.5%
associate-/l*90.6%
fma-define90.6%
Simplified90.6%
Taylor expanded in a around 0 66.1%
mul-1-neg66.1%
unsub-neg66.1%
associate-/l*89.5%
div-sub89.5%
sub-neg89.5%
*-inverses89.5%
metadata-eval89.5%
Simplified89.5%
if -1.04999999999999999e75 < t < 9.8000000000000004e78Initial program 96.4%
+-commutative96.4%
*-commutative96.4%
associate-/l*95.9%
fma-define95.9%
Simplified95.9%
fma-undefine95.9%
clear-num95.9%
un-div-inv96.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 89.3%
Final simplification89.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.3e+76) (not (<= t 1.02e+84))) (+ x y) (- x (/ z (/ (- t a) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.3e+76) || !(t <= 1.02e+84)) {
tmp = x + y;
} 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 ((t <= (-1.3d+76)) .or. (.not. (t <= 1.02d+84))) then
tmp = x + y
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 ((t <= -1.3e+76) || !(t <= 1.02e+84)) {
tmp = x + y;
} else {
tmp = x - (z / ((t - a) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.3e+76) or not (t <= 1.02e+84): tmp = x + y else: tmp = x - (z / ((t - a) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.3e+76) || !(t <= 1.02e+84)) tmp = Float64(x + y); else tmp = Float64(x - Float64(z / Float64(Float64(t - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.3e+76) || ~((t <= 1.02e+84))) tmp = x + y; else tmp = x - (z / ((t - a) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.3e+76], N[Not[LessEqual[t, 1.02e+84]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(z / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+76} \lor \neg \left(t \leq 1.02 \cdot 10^{+84}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z}{\frac{t - a}{y}}\\
\end{array}
\end{array}
if t < -1.3e76 or 1.0199999999999999e84 < t Initial program 71.9%
+-commutative71.9%
*-commutative71.9%
associate-/l*90.4%
fma-define90.4%
Simplified90.4%
Taylor expanded in t around inf 82.4%
+-commutative82.4%
Simplified82.4%
if -1.3e76 < t < 1.0199999999999999e84Initial program 96.5%
+-commutative96.5%
*-commutative96.5%
associate-/l*96.0%
fma-define96.0%
Simplified96.0%
fma-undefine96.0%
clear-num95.9%
un-div-inv96.8%
Applied egg-rr96.8%
Taylor expanded in z around inf 89.4%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.7e+147) (not (<= t 6.2e+82))) (+ x y) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.7e+147) || !(t <= 6.2e+82)) {
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.7d+147)) .or. (.not. (t <= 6.2d+82))) 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.7e+147) || !(t <= 6.2e+82)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.7e+147) or not (t <= 6.2e+82): 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.7e+147) || !(t <= 6.2e+82)) 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.7e+147) || ~((t <= 6.2e+82))) 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.7e+147], N[Not[LessEqual[t, 6.2e+82]], $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.7 \cdot 10^{+147} \lor \neg \left(t \leq 6.2 \cdot 10^{+82}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.7e147 or 6.20000000000000065e82 < t Initial program 67.6%
+-commutative67.6%
*-commutative67.6%
associate-/l*89.8%
fma-define89.8%
Simplified89.8%
Taylor expanded in t around inf 84.0%
+-commutative84.0%
Simplified84.0%
if -1.7e147 < t < 6.20000000000000065e82Initial program 96.2%
associate-/l*97.8%
Simplified97.8%
clear-num97.8%
un-div-inv97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 88.1%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.9e+148) (not (<= t 9e+83))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.9e+148) || !(t <= 9e+83)) {
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 <= (-1.9d+148)) .or. (.not. (t <= 9d+83))) 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 <= -1.9e+148) || !(t <= 9e+83)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.9e+148) or not (t <= 9e+83): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.9e+148) || !(t <= 9e+83)) 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 <= -1.9e+148) || ~((t <= 9e+83))) 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, -1.9e+148], N[Not[LessEqual[t, 9e+83]], $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 -1.9 \cdot 10^{+148} \lor \neg \left(t \leq 9 \cdot 10^{+83}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.8999999999999999e148 or 8.9999999999999999e83 < t Initial program 67.6%
+-commutative67.6%
*-commutative67.6%
associate-/l*89.8%
fma-define89.8%
Simplified89.8%
Taylor expanded in t around inf 84.0%
+-commutative84.0%
Simplified84.0%
if -1.8999999999999999e148 < t < 8.9999999999999999e83Initial program 96.2%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in z around inf 87.1%
associate-/l*88.1%
Simplified88.1%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.8e+78) (+ x (* y (- 1.0 (/ z t)))) (if (<= t 2.4e+83) (+ x (/ z (/ (- a t) y))) (+ x (/ y (/ (- t a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.8e+78) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 2.4e+83) {
tmp = x + (z / ((a - t) / y));
} 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 (t <= (-1.8d+78)) then
tmp = x + (y * (1.0d0 - (z / t)))
else if (t <= 2.4d+83) then
tmp = x + (z / ((a - t) / y))
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 (t <= -1.8e+78) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 2.4e+83) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + (y / ((t - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.8e+78: tmp = x + (y * (1.0 - (z / t))) elif t <= 2.4e+83: tmp = x + (z / ((a - t) / y)) else: tmp = x + (y / ((t - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.8e+78) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); elseif (t <= 2.4e+83) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); else tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.8e+78) tmp = x + (y * (1.0 - (z / t))); elseif (t <= 2.4e+83) tmp = x + (z / ((a - t) / y)); else tmp = x + (y / ((t - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.8e+78], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+83], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+78}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+83}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\end{array}
\end{array}
if t < -1.8000000000000001e78Initial program 83.2%
+-commutative83.2%
*-commutative83.2%
associate-/l*93.5%
fma-define93.5%
Simplified93.5%
Taylor expanded in a around 0 79.3%
mul-1-neg79.3%
unsub-neg79.3%
associate-/l*94.0%
div-sub94.0%
sub-neg94.0%
*-inverses94.0%
metadata-eval94.0%
Simplified94.0%
if -1.8000000000000001e78 < t < 2.39999999999999991e83Initial program 96.5%
+-commutative96.5%
*-commutative96.5%
associate-/l*96.0%
fma-define96.0%
Simplified96.0%
fma-undefine96.0%
clear-num95.9%
un-div-inv96.8%
Applied egg-rr96.8%
Taylor expanded in z around inf 89.4%
if 2.39999999999999991e83 < t Initial program 60.8%
+-commutative60.8%
*-commutative60.8%
associate-/l*87.4%
fma-define87.4%
Simplified87.4%
Taylor expanded in z around 0 58.7%
mul-1-neg58.7%
unsub-neg58.7%
*-commutative58.7%
*-lft-identity58.7%
times-frac86.6%
/-rgt-identity86.6%
Simplified86.6%
clear-num86.5%
un-div-inv86.6%
Applied egg-rr86.6%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.2e+79) (+ x (* y (- 1.0 (/ z t)))) (if (<= t 8.8e+83) (+ x (/ z (/ (- a t) y))) (+ x (* y (/ t (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+79) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 8.8e+83) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4.2d+79)) then
tmp = x + (y * (1.0d0 - (z / t)))
else if (t <= 8.8d+83) then
tmp = x + (z / ((a - t) / y))
else
tmp = x + (y * (t / (t - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+79) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 8.8e+83) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e+79: tmp = x + (y * (1.0 - (z / t))) elif t <= 8.8e+83: tmp = x + (z / ((a - t) / y)) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e+79) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); elseif (t <= 8.8e+83) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); else tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.2e+79) tmp = x + (y * (1.0 - (z / t))); elseif (t <= 8.8e+83) tmp = x + (z / ((a - t) / y)); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e+79], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e+83], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+79}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+83}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if t < -4.20000000000000016e79Initial program 83.2%
+-commutative83.2%
*-commutative83.2%
associate-/l*93.5%
fma-define93.5%
Simplified93.5%
Taylor expanded in a around 0 79.3%
mul-1-neg79.3%
unsub-neg79.3%
associate-/l*94.0%
div-sub94.0%
sub-neg94.0%
*-inverses94.0%
metadata-eval94.0%
Simplified94.0%
if -4.20000000000000016e79 < t < 8.79999999999999995e83Initial program 96.5%
+-commutative96.5%
*-commutative96.5%
associate-/l*96.0%
fma-define96.0%
Simplified96.0%
fma-undefine96.0%
clear-num95.9%
un-div-inv96.8%
Applied egg-rr96.8%
Taylor expanded in z around inf 89.4%
if 8.79999999999999995e83 < t Initial program 60.8%
+-commutative60.8%
*-commutative60.8%
associate-/l*87.4%
fma-define87.4%
Simplified87.4%
Taylor expanded in z around 0 58.7%
mul-1-neg58.7%
unsub-neg58.7%
*-commutative58.7%
*-lft-identity58.7%
times-frac86.6%
/-rgt-identity86.6%
Simplified86.6%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1e-53) (not (<= t 1.15e+79))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e-53) || !(t <= 1.15e+79)) {
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 <= (-1d-53)) .or. (.not. (t <= 1.15d+79))) 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 <= -1e-53) || !(t <= 1.15e+79)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1e-53) or not (t <= 1.15e+79): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1e-53) || !(t <= 1.15e+79)) 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 <= -1e-53) || ~((t <= 1.15e+79))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1e-53], N[Not[LessEqual[t, 1.15e+79]], $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 \cdot 10^{-53} \lor \neg \left(t \leq 1.15 \cdot 10^{+79}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.00000000000000003e-53 or 1.15e79 < t Initial program 75.4%
+-commutative75.4%
*-commutative75.4%
associate-/l*92.2%
fma-define92.2%
Simplified92.2%
Taylor expanded in t around inf 77.9%
+-commutative77.9%
Simplified77.9%
if -1.00000000000000003e-53 < t < 1.15e79Initial program 97.3%
+-commutative97.3%
*-commutative97.3%
associate-/l*95.4%
fma-define95.4%
Simplified95.4%
Taylor expanded in t around 0 80.2%
+-commutative80.2%
associate-/l*82.1%
Simplified82.1%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.9e-52) (not (<= t 5.8e+79))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.9e-52) || !(t <= 5.8e+79)) {
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.9d-52)) .or. (.not. (t <= 5.8d+79))) 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.9e-52) || !(t <= 5.8e+79)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.9e-52) or not (t <= 5.8e+79): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.9e-52) || !(t <= 5.8e+79)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.9e-52) || ~((t <= 5.8e+79))) 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.9e-52], N[Not[LessEqual[t, 5.8e+79]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-52} \lor \neg \left(t \leq 5.8 \cdot 10^{+79}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.9000000000000002e-52 or 5.79999999999999984e79 < t Initial program 75.4%
+-commutative75.4%
*-commutative75.4%
associate-/l*92.2%
fma-define92.2%
Simplified92.2%
Taylor expanded in t around inf 77.9%
+-commutative77.9%
Simplified77.9%
if -1.9000000000000002e-52 < t < 5.79999999999999984e79Initial program 97.3%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in t around 0 80.2%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.4e+137) x (if (<= a 6.2e+179) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.4e+137) {
tmp = x;
} else if (a <= 6.2e+179) {
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 <= (-1.4d+137)) then
tmp = x
else if (a <= 6.2d+179) 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 <= -1.4e+137) {
tmp = x;
} else if (a <= 6.2e+179) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.4e+137: tmp = x elif a <= 6.2e+179: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.4e+137) tmp = x; elseif (a <= 6.2e+179) 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 <= -1.4e+137) tmp = x; elseif (a <= 6.2e+179) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.4e+137], x, If[LessEqual[a, 6.2e+179], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+137}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+179}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.4e137 or 6.2e179 < a Initial program 86.9%
+-commutative86.9%
*-commutative86.9%
associate-/l*91.6%
fma-define91.7%
Simplified91.7%
Taylor expanded in y around 0 70.0%
if -1.4e137 < a < 6.2e179Initial program 88.0%
+-commutative88.0%
*-commutative88.0%
associate-/l*94.7%
fma-define94.7%
Simplified94.7%
Taylor expanded in t around inf 68.1%
+-commutative68.1%
Simplified68.1%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.2e+170) (* y (- 1.0 (/ z t))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.2e+170) {
tmp = y * (1.0 - (z / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-5.2d+170)) then
tmp = y * (1.0d0 - (z / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.2e+170) {
tmp = y * (1.0 - (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.2e+170: tmp = y * (1.0 - (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.2e+170) tmp = Float64(y * Float64(1.0 - Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.2e+170) tmp = y * (1.0 - (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.2e+170], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+170}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -5.1999999999999996e170Initial program 68.2%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 49.2%
mul-1-neg49.2%
unsub-neg49.2%
associate-/l*73.8%
div-sub73.8%
*-inverses73.8%
Simplified73.8%
Taylor expanded in x around 0 73.8%
sub-neg73.8%
metadata-eval73.8%
neg-mul-173.8%
distribute-rgt-neg-in73.8%
+-commutative73.8%
distribute-neg-in73.8%
metadata-eval73.8%
sub-neg73.8%
Simplified73.8%
if -5.1999999999999996e170 < y Initial program 89.9%
+-commutative89.9%
*-commutative89.9%
associate-/l*94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in t around inf 67.3%
+-commutative67.3%
Simplified67.3%
Final simplification67.9%
(FPCore (x y z t a) :precision binary64 (if (<= z 1.26e+132) (+ x y) (* y (/ z (- t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.26e+132) {
tmp = x + y;
} else {
tmp = y * (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 (z <= 1.26d+132) then
tmp = x + y
else
tmp = y * (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 (z <= 1.26e+132) {
tmp = x + y;
} else {
tmp = y * (z / -t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.26e+132: tmp = x + y else: tmp = y * (z / -t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.26e+132) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.26e+132) tmp = x + y; else tmp = y * (z / -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1.26e+132], N[(x + y), $MachinePrecision], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.26 \cdot 10^{+132}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\end{array}
\end{array}
if z < 1.25999999999999999e132Initial program 88.6%
+-commutative88.6%
*-commutative88.6%
associate-/l*94.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in t around inf 70.2%
+-commutative70.2%
Simplified70.2%
if 1.25999999999999999e132 < z Initial program 81.5%
associate-/l*90.7%
Simplified90.7%
clear-num90.7%
un-div-inv90.7%
Applied egg-rr90.7%
Taylor expanded in a around 0 57.1%
mul-1-neg57.1%
unsub-neg57.1%
associate-/l*57.3%
div-sub57.3%
*-inverses57.3%
Simplified57.3%
Taylor expanded in x around 0 51.0%
sub-neg51.0%
metadata-eval51.0%
neg-mul-151.0%
distribute-rgt-neg-in51.0%
+-commutative51.0%
distribute-neg-in51.0%
metadata-eval51.0%
sub-neg51.0%
Simplified51.0%
Taylor expanded in z around inf 44.8%
associate-*r/44.8%
neg-mul-144.8%
Simplified44.8%
Final simplification67.2%
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- z t) (- t a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((z - t) / (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 - (y * ((z - t) / (t - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((z - t) / (t - a)));
}
def code(x, y, z, t, a): return x - (y * ((z - t) / (t - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(z - t) / Float64(t - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((z - t) / (t - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(z - t), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{z - t}{t - a}
\end{array}
Initial program 87.7%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.2e+46) y x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.2e+46) {
tmp = 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 (y <= (-4.2d+46)) then
tmp = 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 (y <= -4.2e+46) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.2e+46: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.2e+46) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.2e+46) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.2e+46], y, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+46}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.2e46Initial program 66.4%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 38.4%
mul-1-neg38.4%
unsub-neg38.4%
associate-/l*61.5%
div-sub61.5%
*-inverses61.5%
Simplified61.5%
Taylor expanded in x around 0 54.3%
sub-neg54.3%
metadata-eval54.3%
neg-mul-154.3%
distribute-rgt-neg-in54.3%
+-commutative54.3%
distribute-neg-in54.3%
metadata-eval54.3%
sub-neg54.3%
Simplified54.3%
Taylor expanded in z around 0 30.6%
if -4.2e46 < y Initial program 93.3%
+-commutative93.3%
*-commutative93.3%
associate-/l*93.8%
fma-define93.8%
Simplified93.8%
Taylor expanded in y around 0 61.6%
(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.7%
+-commutative87.7%
*-commutative87.7%
associate-/l*94.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in y around 0 51.9%
(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 2024157
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))