
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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 - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\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 z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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 - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- y z) (- a z)) t)))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) / (a - 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 - z) / (a - z)) * t)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) / (a - z)) * t);
}
def code(x, y, z, t, a): return x + (((y - z) / (a - z)) * t)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) / (a - z)) * t); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{a - z} \cdot t
\end{array}
Initial program 87.5%
associate-*l/99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e+42) (not (<= z 1.25e+32))) (- x (/ t (/ z (- y z)))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e+42) || !(z <= 1.25e+32)) {
tmp = x - (t / (z / (y - z)));
} else {
tmp = x + (y / ((a - 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.2d+42)) .or. (.not. (z <= 1.25d+32))) then
tmp = x - (t / (z / (y - z)))
else
tmp = x + (y / ((a - 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.2e+42) || !(z <= 1.25e+32)) {
tmp = x - (t / (z / (y - z)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e+42) or not (z <= 1.25e+32): tmp = x - (t / (z / (y - z))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e+42) || !(z <= 1.25e+32)) tmp = Float64(x - Float64(t / Float64(z / Float64(y - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.2e+42) || ~((z <= 1.25e+32))) tmp = x - (t / (z / (y - z))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e+42], N[Not[LessEqual[z, 1.25e+32]], $MachinePrecision]], N[(x - N[(t / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+42} \lor \neg \left(z \leq 1.25 \cdot 10^{+32}\right):\\
\;\;\;\;x - \frac{t}{\frac{z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -1.1999999999999999e42 or 1.2499999999999999e32 < z Initial program 76.2%
+-commutative76.2%
associate-*r/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in a around 0 71.4%
+-commutative71.4%
mul-1-neg71.4%
unsub-neg71.4%
associate-/l*90.7%
Simplified90.7%
if -1.1999999999999999e42 < z < 1.2499999999999999e32Initial program 96.6%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in y around inf 89.1%
Taylor expanded in x around 0 87.6%
associate-/l*90.1%
Simplified90.1%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.6e+42) (not (<= z 6.2e-86))) (- x (* t (/ z (- a z)))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.6e+42) || !(z <= 6.2e-86)) {
tmp = x - (t * (z / (a - z)));
} else {
tmp = x + (y / ((a - 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 <= (-8.6d+42)) .or. (.not. (z <= 6.2d-86))) then
tmp = x - (t * (z / (a - z)))
else
tmp = x + (y / ((a - 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 <= -8.6e+42) || !(z <= 6.2e-86)) {
tmp = x - (t * (z / (a - z)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.6e+42) or not (z <= 6.2e-86): tmp = x - (t * (z / (a - z))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.6e+42) || !(z <= 6.2e-86)) tmp = Float64(x - Float64(t * Float64(z / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.6e+42) || ~((z <= 6.2e-86))) tmp = x - (t * (z / (a - z))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.6e+42], N[Not[LessEqual[z, 6.2e-86]], $MachinePrecision]], N[(x - N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+42} \lor \neg \left(z \leq 6.2 \cdot 10^{-86}\right):\\
\;\;\;\;x - t \cdot \frac{z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -8.5999999999999996e42 or 6.19999999999999977e-86 < z Initial program 79.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 91.1%
neg-mul-191.1%
distribute-neg-frac91.1%
Simplified91.1%
if -8.5999999999999996e42 < z < 6.19999999999999977e-86Initial program 96.0%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in y around inf 90.9%
Taylor expanded in x around 0 89.1%
associate-/l*92.1%
Simplified92.1%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.4e+44) (+ x t) (if (<= z 7.6e+64) (+ x (* t (/ y (- a z)))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e+44) {
tmp = x + t;
} else if (z <= 7.6e+64) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + 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+44)) then
tmp = x + t
else if (z <= 7.6d+64) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + 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+44) {
tmp = x + t;
} else if (z <= 7.6e+64) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.4e+44: tmp = x + t elif z <= 7.6e+64: tmp = x + (t * (y / (a - z))) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.4e+44) tmp = Float64(x + t); elseif (z <= 7.6e+64) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.4e+44) tmp = x + t; elseif (z <= 7.6e+64) tmp = x + (t * (y / (a - z))); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e+44], N[(x + t), $MachinePrecision], If[LessEqual[z, 7.6e+64], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+44}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+64}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.4e44 or 7.6000000000000002e64 < z Initial program 76.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.8%
if -1.4e44 < z < 7.6000000000000002e64Initial program 95.0%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in y around inf 88.3%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.8e+42) (+ x t) (if (<= z 5e+64) (+ x (* t (/ y (- a z)))) (+ x (+ t (/ a (/ z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+42) {
tmp = x + t;
} else if (z <= 5e+64) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t + (a / (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 <= (-4.8d+42)) then
tmp = x + t
else if (z <= 5d+64) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (t + (a / (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 <= -4.8e+42) {
tmp = x + t;
} else if (z <= 5e+64) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t + (a / (z / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+42: tmp = x + t elif z <= 5e+64: tmp = x + (t * (y / (a - z))) else: tmp = x + (t + (a / (z / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+42) tmp = Float64(x + t); elseif (z <= 5e+64) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(t + Float64(a / Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.8e+42) tmp = x + t; elseif (z <= 5e+64) tmp = x + (t * (y / (a - z))); else tmp = x + (t + (a / (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+42], N[(x + t), $MachinePrecision], If[LessEqual[z, 5e+64], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t + N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+42}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+64}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t + \frac{a}{\frac{z}{t}}\right)\\
\end{array}
\end{array}
if z < -4.7999999999999997e42Initial program 76.2%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.4%
if -4.7999999999999997e42 < z < 5e64Initial program 95.0%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in y around inf 88.3%
if 5e64 < z Initial program 77.5%
associate-*l/100.0%
Simplified100.0%
*-commutative100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
associate-/l*93.1%
distribute-neg-frac93.1%
Simplified93.1%
Taylor expanded in a around 0 82.2%
associate-/l*87.5%
Simplified87.5%
Final simplification87.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.55e+44) (+ x t) (if (<= z 6.6e+65) (+ x (/ y (/ (- a z) t))) (+ x (+ t (/ a (/ z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e+44) {
tmp = x + t;
} else if (z <= 6.6e+65) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (t + (a / (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.55d+44)) then
tmp = x + t
else if (z <= 6.6d+65) then
tmp = x + (y / ((a - z) / t))
else
tmp = x + (t + (a / (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.55e+44) {
tmp = x + t;
} else if (z <= 6.6e+65) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (t + (a / (z / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.55e+44: tmp = x + t elif z <= 6.6e+65: tmp = x + (y / ((a - z) / t)) else: tmp = x + (t + (a / (z / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e+44) tmp = Float64(x + t); elseif (z <= 6.6e+65) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x + Float64(t + Float64(a / Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.55e+44) tmp = x + t; elseif (z <= 6.6e+65) tmp = x + (y / ((a - z) / t)); else tmp = x + (t + (a / (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e+44], N[(x + t), $MachinePrecision], If[LessEqual[z, 6.6e+65], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t + N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+44}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+65}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t + \frac{a}{\frac{z}{t}}\right)\\
\end{array}
\end{array}
if z < -1.54999999999999998e44Initial program 76.2%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.4%
if -1.54999999999999998e44 < z < 6.60000000000000046e65Initial program 95.0%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in y around inf 88.3%
Taylor expanded in x around 0 85.6%
associate-/l*89.3%
Simplified89.3%
if 6.60000000000000046e65 < z Initial program 77.5%
associate-*l/100.0%
Simplified100.0%
*-commutative100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
associate-/l*93.1%
distribute-neg-frac93.1%
Simplified93.1%
Taylor expanded in a around 0 82.2%
associate-/l*87.5%
Simplified87.5%
Final simplification87.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8e+41)
(- x (* t (/ z (- a z))))
(if (<= z 1.35e-85)
(+ x (/ y (/ (- a z) t)))
(- x (/ t (+ (/ a z) -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+41) {
tmp = x - (t * (z / (a - z)));
} else if (z <= 1.35e-85) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x - (t / ((a / z) + -1.0));
}
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 <= (-8d+41)) then
tmp = x - (t * (z / (a - z)))
else if (z <= 1.35d-85) then
tmp = x + (y / ((a - z) / t))
else
tmp = x - (t / ((a / z) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+41) {
tmp = x - (t * (z / (a - z)));
} else if (z <= 1.35e-85) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x - (t / ((a / z) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e+41: tmp = x - (t * (z / (a - z))) elif z <= 1.35e-85: tmp = x + (y / ((a - z) / t)) else: tmp = x - (t / ((a / z) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e+41) tmp = Float64(x - Float64(t * Float64(z / Float64(a - z)))); elseif (z <= 1.35e-85) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x - Float64(t / Float64(Float64(a / z) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8e+41) tmp = x - (t * (z / (a - z))); elseif (z <= 1.35e-85) tmp = x + (y / ((a - z) / t)); else tmp = x - (t / ((a / z) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e+41], N[(x - N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-85], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+41}:\\
\;\;\;\;x - t \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-85}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{z} + -1}\\
\end{array}
\end{array}
if z < -8.00000000000000005e41Initial program 76.2%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 94.8%
neg-mul-194.8%
distribute-neg-frac94.8%
Simplified94.8%
if -8.00000000000000005e41 < z < 1.3500000000000001e-85Initial program 96.0%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in y around inf 90.9%
Taylor expanded in x around 0 89.1%
associate-/l*92.1%
Simplified92.1%
if 1.3500000000000001e-85 < z Initial program 82.1%
associate-*l/100.0%
Simplified100.0%
*-commutative100.0%
clear-num100.0%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 75.2%
mul-1-neg75.2%
associate-/l*88.8%
distribute-neg-frac88.8%
Simplified88.8%
Taylor expanded in a around 0 88.8%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.05e-87) (+ x t) (if (<= z -7.2e-181) (* t (/ (- y z) a)) (if (<= z 1.85e-71) x (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-87) {
tmp = x + t;
} else if (z <= -7.2e-181) {
tmp = t * ((y - z) / a);
} else if (z <= 1.85e-71) {
tmp = x;
} else {
tmp = x + 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.05d-87)) then
tmp = x + t
else if (z <= (-7.2d-181)) then
tmp = t * ((y - z) / a)
else if (z <= 1.85d-71) then
tmp = x
else
tmp = x + 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.05e-87) {
tmp = x + t;
} else if (z <= -7.2e-181) {
tmp = t * ((y - z) / a);
} else if (z <= 1.85e-71) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e-87: tmp = x + t elif z <= -7.2e-181: tmp = t * ((y - z) / a) elif z <= 1.85e-71: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e-87) tmp = Float64(x + t); elseif (z <= -7.2e-181) tmp = Float64(t * Float64(Float64(y - z) / a)); elseif (z <= 1.85e-71) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e-87) tmp = x + t; elseif (z <= -7.2e-181) tmp = t * ((y - z) / a); elseif (z <= 1.85e-71) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e-87], N[(x + t), $MachinePrecision], If[LessEqual[z, -7.2e-181], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e-71], x, N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-87}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-181}:\\
\;\;\;\;t \cdot \frac{y - z}{a}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-71}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.05000000000000004e-87 or 1.8499999999999998e-71 < z Initial program 80.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 79.5%
if -1.05000000000000004e-87 < z < -7.1999999999999998e-181Initial program 93.8%
+-commutative93.8%
associate-*r/99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in a around inf 76.9%
Taylor expanded in t around inf 64.6%
div-sub64.6%
Simplified64.6%
if -7.1999999999999998e-181 < z < 1.8499999999999998e-71Initial program 99.8%
+-commutative99.8%
associate-*r/97.5%
fma-def97.5%
Simplified97.5%
Taylor expanded in t around 0 58.1%
Final simplification72.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.5e+42) (+ x t) (if (<= z 1e-71) (+ x (* t (/ y a))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+42) {
tmp = x + t;
} else if (z <= 1e-71) {
tmp = x + (t * (y / a));
} else {
tmp = x + 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.5d+42)) then
tmp = x + t
else if (z <= 1d-71) then
tmp = x + (t * (y / a))
else
tmp = x + 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.5e+42) {
tmp = x + t;
} else if (z <= 1e-71) {
tmp = x + (t * (y / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.5e+42: tmp = x + t elif z <= 1e-71: tmp = x + (t * (y / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e+42) tmp = Float64(x + t); elseif (z <= 1e-71) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.5e+42) tmp = x + t; elseif (z <= 1e-71) tmp = x + (t * (y / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e+42], N[(x + t), $MachinePrecision], If[LessEqual[z, 1e-71], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+42}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 10^{-71}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.50000000000000014e42 or 9.9999999999999992e-72 < z Initial program 79.5%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.9%
if -1.50000000000000014e42 < z < 9.9999999999999992e-72Initial program 96.1%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in z around 0 80.8%
Final simplification81.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.5e+41) (+ x t) (if (<= z 2e-72) (+ x (/ y (/ a t))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+41) {
tmp = x + t;
} else if (z <= 2e-72) {
tmp = x + (y / (a / t));
} else {
tmp = x + 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 <= (-8.5d+41)) then
tmp = x + t
else if (z <= 2d-72) then
tmp = x + (y / (a / t))
else
tmp = x + 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 <= -8.5e+41) {
tmp = x + t;
} else if (z <= 2e-72) {
tmp = x + (y / (a / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e+41: tmp = x + t elif z <= 2e-72: tmp = x + (y / (a / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+41) tmp = Float64(x + t); elseif (z <= 2e-72) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.5e+41) tmp = x + t; elseif (z <= 2e-72) tmp = x + (y / (a / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+41], N[(x + t), $MachinePrecision], If[LessEqual[z, 2e-72], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+41}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-72}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.49999999999999938e41 or 1.9999999999999999e-72 < z Initial program 79.5%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.9%
if -8.49999999999999938e41 < z < 1.9999999999999999e-72Initial program 96.1%
+-commutative96.1%
associate-*r/98.3%
fma-def98.3%
Simplified98.3%
Taylor expanded in z around 0 79.1%
associate-/l*81.1%
Simplified81.1%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.2e-181) (+ x t) (if (<= z 3e-71) x (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e-181) {
tmp = x + t;
} else if (z <= 3e-71) {
tmp = x;
} else {
tmp = x + 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 <= (-8.2d-181)) then
tmp = x + t
else if (z <= 3d-71) then
tmp = x
else
tmp = x + 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 <= -8.2e-181) {
tmp = x + t;
} else if (z <= 3e-71) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.2e-181: tmp = x + t elif z <= 3e-71: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.2e-181) tmp = Float64(x + t); elseif (z <= 3e-71) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.2e-181) tmp = x + t; elseif (z <= 3e-71) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e-181], N[(x + t), $MachinePrecision], If[LessEqual[z, 3e-71], x, N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-181}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-71}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.2000000000000003e-181 or 3.0000000000000001e-71 < z Initial program 82.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 75.4%
if -8.2000000000000003e-181 < z < 3.0000000000000001e-71Initial program 99.8%
+-commutative99.8%
associate-*r/97.5%
fma-def97.5%
Simplified97.5%
Taylor expanded in t around 0 58.1%
Final simplification70.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 87.5%
+-commutative87.5%
associate-*r/97.3%
fma-def97.3%
Simplified97.3%
Taylor expanded in t around 0 51.2%
Final simplification51.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} 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) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
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) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023200
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))