
(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 (fma (/ (- y z) (- a z)) t x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (a - z)), t, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(a - z)), t, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)
\end{array}
Initial program 86.8%
+-commutative86.8%
associate-*l/99.2%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.3e+35)
(+ t x)
(if (<= z 2.1e-95)
(+ x (* t (/ y a)))
(if (<= z 1.4e-44)
(- x (* z (/ t a)))
(if (<= z 1.1e+54) (+ x (/ (* y t) a)) (+ t x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+35) {
tmp = t + x;
} else if (z <= 2.1e-95) {
tmp = x + (t * (y / a));
} else if (z <= 1.4e-44) {
tmp = x - (z * (t / a));
} else if (z <= 1.1e+54) {
tmp = x + ((y * t) / a);
} else {
tmp = t + 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 (z <= (-1.3d+35)) then
tmp = t + x
else if (z <= 2.1d-95) then
tmp = x + (t * (y / a))
else if (z <= 1.4d-44) then
tmp = x - (z * (t / a))
else if (z <= 1.1d+54) then
tmp = x + ((y * t) / a)
else
tmp = t + x
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.3e+35) {
tmp = t + x;
} else if (z <= 2.1e-95) {
tmp = x + (t * (y / a));
} else if (z <= 1.4e-44) {
tmp = x - (z * (t / a));
} else if (z <= 1.1e+54) {
tmp = x + ((y * t) / a);
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+35: tmp = t + x elif z <= 2.1e-95: tmp = x + (t * (y / a)) elif z <= 1.4e-44: tmp = x - (z * (t / a)) elif z <= 1.1e+54: tmp = x + ((y * t) / a) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+35) tmp = Float64(t + x); elseif (z <= 2.1e-95) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 1.4e-44) tmp = Float64(x - Float64(z * Float64(t / a))); elseif (z <= 1.1e+54) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.3e+35) tmp = t + x; elseif (z <= 2.1e-95) tmp = x + (t * (y / a)); elseif (z <= 1.4e-44) tmp = x - (z * (t / a)); elseif (z <= 1.1e+54) tmp = x + ((y * t) / a); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+35], N[(t + x), $MachinePrecision], If[LessEqual[z, 2.1e-95], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-44], N[(x - N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+54], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+35}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-95}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-44}:\\
\;\;\;\;x - z \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+54}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -1.30000000000000003e35 or 1.09999999999999995e54 < z Initial program 76.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.4%
if -1.30000000000000003e35 < z < 2.1e-95Initial program 93.6%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around 0 80.4%
if 2.1e-95 < z < 1.4e-44Initial program 99.7%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in y around 0 61.9%
mul-1-neg61.9%
unsub-neg61.9%
associate-/l*62.0%
div-sub62.0%
*-inverses62.0%
Simplified62.0%
Taylor expanded in a around inf 81.2%
associate-/l*81.4%
associate-/r/81.1%
Simplified81.1%
if 1.4e-44 < z < 1.09999999999999995e54Initial program 99.9%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around 0 73.4%
Final simplification82.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.3e+35)
(+ t x)
(if (<= z 2.8e-95)
(+ x (* t (/ y a)))
(if (<= z 2.5e-45)
(- x (* t (/ z a)))
(if (<= z 1.16e+57) (+ x (/ (* y t) a)) (+ t x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+35) {
tmp = t + x;
} else if (z <= 2.8e-95) {
tmp = x + (t * (y / a));
} else if (z <= 2.5e-45) {
tmp = x - (t * (z / a));
} else if (z <= 1.16e+57) {
tmp = x + ((y * t) / a);
} else {
tmp = t + 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 (z <= (-2.3d+35)) then
tmp = t + x
else if (z <= 2.8d-95) then
tmp = x + (t * (y / a))
else if (z <= 2.5d-45) then
tmp = x - (t * (z / a))
else if (z <= 1.16d+57) then
tmp = x + ((y * t) / a)
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+35) {
tmp = t + x;
} else if (z <= 2.8e-95) {
tmp = x + (t * (y / a));
} else if (z <= 2.5e-45) {
tmp = x - (t * (z / a));
} else if (z <= 1.16e+57) {
tmp = x + ((y * t) / a);
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.3e+35: tmp = t + x elif z <= 2.8e-95: tmp = x + (t * (y / a)) elif z <= 2.5e-45: tmp = x - (t * (z / a)) elif z <= 1.16e+57: tmp = x + ((y * t) / a) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e+35) tmp = Float64(t + x); elseif (z <= 2.8e-95) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 2.5e-45) tmp = Float64(x - Float64(t * Float64(z / a))); elseif (z <= 1.16e+57) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.3e+35) tmp = t + x; elseif (z <= 2.8e-95) tmp = x + (t * (y / a)); elseif (z <= 2.5e-45) tmp = x - (t * (z / a)); elseif (z <= 1.16e+57) tmp = x + ((y * t) / a); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e+35], N[(t + x), $MachinePrecision], If[LessEqual[z, 2.8e-95], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-45], N[(x - N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.16e+57], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+35}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-95}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-45}:\\
\;\;\;\;x - t \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{+57}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -2.2999999999999998e35 or 1.16000000000000003e57 < z Initial program 76.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.4%
if -2.2999999999999998e35 < z < 2.7999999999999999e-95Initial program 93.6%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around 0 80.4%
if 2.7999999999999999e-95 < z < 2.49999999999999988e-45Initial program 99.7%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in y around 0 61.9%
mul-1-neg61.9%
unsub-neg61.9%
associate-/l*62.0%
div-sub62.0%
*-inverses62.0%
Simplified62.0%
Taylor expanded in a around inf 81.2%
associate-/l*81.4%
Simplified81.4%
clear-num81.2%
associate-/r/81.4%
clear-num81.2%
Applied egg-rr81.2%
if 2.49999999999999988e-45 < z < 1.16000000000000003e57Initial program 99.9%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around 0 73.4%
Final simplification82.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.4e+35)
(+ t x)
(if (<= z 2.8e-95)
(+ x (* t (/ y a)))
(if (<= z 3e-45)
(- x (/ t (/ a z)))
(if (<= z 1.12e+55) (+ x (/ (* y t) a)) (+ t x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e+35) {
tmp = t + x;
} else if (z <= 2.8e-95) {
tmp = x + (t * (y / a));
} else if (z <= 3e-45) {
tmp = x - (t / (a / z));
} else if (z <= 1.12e+55) {
tmp = x + ((y * t) / a);
} else {
tmp = t + 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 (z <= (-2.4d+35)) then
tmp = t + x
else if (z <= 2.8d-95) then
tmp = x + (t * (y / a))
else if (z <= 3d-45) then
tmp = x - (t / (a / z))
else if (z <= 1.12d+55) then
tmp = x + ((y * t) / a)
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e+35) {
tmp = t + x;
} else if (z <= 2.8e-95) {
tmp = x + (t * (y / a));
} else if (z <= 3e-45) {
tmp = x - (t / (a / z));
} else if (z <= 1.12e+55) {
tmp = x + ((y * t) / a);
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.4e+35: tmp = t + x elif z <= 2.8e-95: tmp = x + (t * (y / a)) elif z <= 3e-45: tmp = x - (t / (a / z)) elif z <= 1.12e+55: tmp = x + ((y * t) / a) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e+35) tmp = Float64(t + x); elseif (z <= 2.8e-95) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 3e-45) tmp = Float64(x - Float64(t / Float64(a / z))); elseif (z <= 1.12e+55) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.4e+35) tmp = t + x; elseif (z <= 2.8e-95) tmp = x + (t * (y / a)); elseif (z <= 3e-45) tmp = x - (t / (a / z)); elseif (z <= 1.12e+55) tmp = x + ((y * t) / a); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e+35], N[(t + x), $MachinePrecision], If[LessEqual[z, 2.8e-95], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-45], N[(x - N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.12e+55], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+35}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-95}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-45}:\\
\;\;\;\;x - \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+55}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -2.40000000000000015e35 or 1.12000000000000006e55 < z Initial program 76.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.4%
if -2.40000000000000015e35 < z < 2.7999999999999999e-95Initial program 93.6%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around 0 80.4%
if 2.7999999999999999e-95 < z < 3.00000000000000011e-45Initial program 99.7%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in y around 0 61.9%
mul-1-neg61.9%
unsub-neg61.9%
associate-/l*62.0%
div-sub62.0%
*-inverses62.0%
Simplified62.0%
Taylor expanded in a around inf 81.2%
associate-/l*81.4%
Simplified81.4%
if 3.00000000000000011e-45 < z < 1.12000000000000006e55Initial program 99.9%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around 0 73.4%
Final simplification82.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.8e+35) (not (<= z 1.65e+59))) (+ t x) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+35) || !(z <= 1.65e+59)) {
tmp = t + x;
} else {
tmp = x + (t * (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 ((z <= (-2.8d+35)) .or. (.not. (z <= 1.65d+59))) then
tmp = t + x
else
tmp = x + (t * (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 ((z <= -2.8e+35) || !(z <= 1.65e+59)) {
tmp = t + x;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.8e+35) or not (z <= 1.65e+59): tmp = t + x else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.8e+35) || !(z <= 1.65e+59)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.8e+35) || ~((z <= 1.65e+59))) tmp = t + x; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.8e+35], N[Not[LessEqual[z, 1.65e+59]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+35} \lor \neg \left(z \leq 1.65 \cdot 10^{+59}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -2.79999999999999999e35 or 1.65e59 < z Initial program 76.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.4%
if -2.79999999999999999e35 < z < 1.65e59Initial program 94.8%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in y around inf 86.8%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1550.0) (not (<= y 5.8e+81))) (+ x (* t (/ y (- a z)))) (- x (/ t (+ (/ a z) -1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1550.0) || !(y <= 5.8e+81)) {
tmp = x + (t * (y / (a - z)));
} 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 ((y <= (-1550.0d0)) .or. (.not. (y <= 5.8d+81))) then
tmp = x + (t * (y / (a - z)))
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 ((y <= -1550.0) || !(y <= 5.8e+81)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (t / ((a / z) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1550.0) or not (y <= 5.8e+81): tmp = x + (t * (y / (a - z))) else: tmp = x - (t / ((a / z) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1550.0) || !(y <= 5.8e+81)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); 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 ((y <= -1550.0) || ~((y <= 5.8e+81))) tmp = x + (t * (y / (a - z))); else tmp = x - (t / ((a / z) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1550.0], N[Not[LessEqual[y, 5.8e+81]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $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}\;y \leq -1550 \lor \neg \left(y \leq 5.8 \cdot 10^{+81}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{z} + -1}\\
\end{array}
\end{array}
if y < -1550 or 5.7999999999999999e81 < y Initial program 85.1%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in y around inf 91.7%
if -1550 < y < 5.7999999999999999e81Initial program 87.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 81.2%
mul-1-neg81.2%
unsub-neg81.2%
associate-/l*92.8%
div-sub92.8%
*-inverses92.8%
Simplified92.8%
Final simplification92.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e+34) (not (<= z 7.2e+53))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e+34) || !(z <= 7.2e+53)) {
tmp = t + x;
} else {
tmp = x + (t * (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 ((z <= (-9d+34)) .or. (.not. (z <= 7.2d+53))) then
tmp = t + x
else
tmp = x + (t * (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 ((z <= -9e+34) || !(z <= 7.2e+53)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e+34) or not (z <= 7.2e+53): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e+34) || !(z <= 7.2e+53)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9e+34) || ~((z <= 7.2e+53))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e+34], N[Not[LessEqual[z, 7.2e+53]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+34} \lor \neg \left(z \leq 7.2 \cdot 10^{+53}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -9.0000000000000001e34 or 7.2e53 < z Initial program 76.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.4%
if -9.0000000000000001e34 < z < 7.2e53Initial program 94.8%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 76.2%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e+35) (not (<= z 3.1e+53))) (+ t x) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e+35) || !(z <= 3.1e+53)) {
tmp = t + x;
} else {
tmp = x + (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 ((z <= (-2.2d+35)) .or. (.not. (z <= 3.1d+53))) then
tmp = t + x
else
tmp = x + (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 ((z <= -2.2e+35) || !(z <= 3.1e+53)) {
tmp = t + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e+35) or not (z <= 3.1e+53): tmp = t + x else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e+35) || !(z <= 3.1e+53)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.2e+35) || ~((z <= 3.1e+53))) tmp = t + x; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e+35], N[Not[LessEqual[z, 3.1e+53]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+35} \lor \neg \left(z \leq 3.1 \cdot 10^{+53}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -2.1999999999999999e35 or 3.10000000000000019e53 < z Initial program 76.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.4%
if -2.1999999999999999e35 < z < 3.10000000000000019e53Initial program 94.8%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 73.5%
+-commutative73.5%
associate-/l*76.8%
Simplified76.8%
Final simplification80.5%
(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 86.8%
associate-*l/99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e-106) (not (<= z 3.6e-10))) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e-106) || !(z <= 3.6e-10)) {
tmp = t + x;
} 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 ((z <= (-8d-106)) .or. (.not. (z <= 3.6d-10))) then
tmp = t + x
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 ((z <= -8e-106) || !(z <= 3.6e-10)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e-106) or not (z <= 3.6e-10): tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e-106) || !(z <= 3.6e-10)) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8e-106) || ~((z <= 3.6e-10))) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e-106], N[Not[LessEqual[z, 3.6e-10]], $MachinePrecision]], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-106} \lor \neg \left(z \leq 3.6 \cdot 10^{-10}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.99999999999999953e-106 or 3.6e-10 < z Initial program 81.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.2%
if -7.99999999999999953e-106 < z < 3.6e-10Initial program 94.4%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in x around inf 56.4%
Final simplification69.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.85e+147) t (if (<= t 4.5e+224) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.85e+147) {
tmp = t;
} else if (t <= 4.5e+224) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.85d+147)) then
tmp = t
else if (t <= 4.5d+224) then
tmp = x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.85e+147) {
tmp = t;
} else if (t <= 4.5e+224) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.85e+147: tmp = t elif t <= 4.5e+224: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.85e+147) tmp = t; elseif (t <= 4.5e+224) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.85e+147) tmp = t; elseif (t <= 4.5e+224) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.85e+147], t, If[LessEqual[t, 4.5e+224], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.85 \cdot 10^{+147}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+224}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -2.84999999999999996e147 or 4.4999999999999998e224 < t Initial program 51.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 34.5%
mul-1-neg34.5%
unsub-neg34.5%
associate-/l*68.3%
Simplified68.3%
Taylor expanded in t around inf 63.6%
Taylor expanded in y around 0 42.4%
if -2.84999999999999996e147 < t < 4.4999999999999998e224Initial program 94.5%
associate-*l/99.0%
Simplified99.0%
Taylor expanded in x around inf 63.7%
Final simplification59.9%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 86.8%
associate-*l/99.2%
Simplified99.2%
Taylor expanded in a around 0 62.6%
mul-1-neg62.6%
unsub-neg62.6%
associate-/l*69.8%
Simplified69.8%
Taylor expanded in t around inf 29.0%
Taylor expanded in y around 0 19.3%
Final simplification19.3%
(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 2023320
(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))))