
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\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(y / Float64(Float64(z - a) / Float64(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[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Initial program 98.5%
clear-num98.5%
un-div-inv98.5%
Applied egg-rr98.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.12e+92)
(+ x y)
(if (<= z -7.5e-91)
(- x (* y (/ t z)))
(if (<= z 6.3e+28) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.12e+92) {
tmp = x + y;
} else if (z <= -7.5e-91) {
tmp = x - (y * (t / z));
} else if (z <= 6.3e+28) {
tmp = x + (y * (t / a));
} 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 (z <= (-1.12d+92)) then
tmp = x + y
else if (z <= (-7.5d-91)) then
tmp = x - (y * (t / z))
else if (z <= 6.3d+28) then
tmp = x + (y * (t / a))
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 (z <= -1.12e+92) {
tmp = x + y;
} else if (z <= -7.5e-91) {
tmp = x - (y * (t / z));
} else if (z <= 6.3e+28) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.12e+92: tmp = x + y elif z <= -7.5e-91: tmp = x - (y * (t / z)) elif z <= 6.3e+28: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.12e+92) tmp = Float64(x + y); elseif (z <= -7.5e-91) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 6.3e+28) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.12e+92) tmp = x + y; elseif (z <= -7.5e-91) tmp = x - (y * (t / z)); elseif (z <= 6.3e+28) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.12e+92], N[(x + y), $MachinePrecision], If[LessEqual[z, -7.5e-91], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.3e+28], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+92}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-91}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 6.3 \cdot 10^{+28}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.1199999999999999e92 or 6.3000000000000001e28 < z Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.9%
+-commutative77.9%
Simplified77.9%
if -1.1199999999999999e92 < z < -7.50000000000000051e-91Initial program 99.7%
Taylor expanded in t around inf 75.7%
associate-*r/75.7%
mul-1-neg75.7%
distribute-lft-neg-out75.7%
*-commutative75.7%
*-lft-identity75.7%
times-frac78.2%
/-rgt-identity78.2%
distribute-neg-frac78.2%
distribute-neg-frac278.2%
neg-sub078.2%
sub-neg78.2%
+-commutative78.2%
associate--r+78.2%
neg-sub078.2%
remove-double-neg78.2%
Simplified78.2%
Taylor expanded in a around 0 67.0%
mul-1-neg67.0%
unsub-neg67.0%
*-commutative67.0%
*-lft-identity67.0%
times-frac69.6%
/-rgt-identity69.6%
Simplified69.6%
if -7.50000000000000051e-91 < z < 6.3000000000000001e28Initial program 97.1%
Taylor expanded in z around 0 82.1%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e+45) (not (<= z 5.3e+29))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e+45) || !(z <= 5.3e+29)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / (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 <= (-8d+45)) .or. (.not. (z <= 5.3d+29))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (y * (t / (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 <= -8e+45) || !(z <= 5.3e+29)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e+45) or not (z <= 5.3e+29): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e+45) || !(z <= 5.3e+29)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8e+45) || ~((z <= 5.3e+29))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e+45], N[Not[LessEqual[z, 5.3e+29]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+45} \lor \neg \left(z \leq 5.3 \cdot 10^{+29}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -7.9999999999999994e45 or 5.3e29 < z Initial program 99.9%
Taylor expanded in a around 0 63.6%
associate-/l*88.6%
div-sub88.6%
*-inverses88.6%
Simplified88.6%
if -7.9999999999999994e45 < z < 5.3e29Initial program 97.4%
Taylor expanded in t around inf 87.3%
associate-*r/87.3%
mul-1-neg87.3%
distribute-lft-neg-out87.3%
*-commutative87.3%
*-lft-identity87.3%
times-frac89.8%
/-rgt-identity89.8%
distribute-neg-frac89.8%
distribute-neg-frac289.8%
neg-sub089.8%
sub-neg89.8%
+-commutative89.8%
associate--r+89.8%
neg-sub089.8%
remove-double-neg89.8%
Simplified89.8%
Final simplification89.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.8e-98) (not (<= z 1.65e-92))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.8e-98) || !(z <= 1.65e-92)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 <= (-7.8d-98)) .or. (.not. (z <= 1.65d-92))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 <= -7.8e-98) || !(z <= 1.65e-92)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.8e-98) or not (z <= 1.65e-92): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.8e-98) || !(z <= 1.65e-92)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 <= -7.8e-98) || ~((z <= 1.65e-92))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.8e-98], N[Not[LessEqual[z, 1.65e-92]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-98} \lor \neg \left(z \leq 1.65 \cdot 10^{-92}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -7.79999999999999943e-98 or 1.64999999999999999e-92 < z Initial program 99.9%
Taylor expanded in a around 0 66.2%
associate-/l*84.0%
div-sub84.0%
*-inverses84.0%
Simplified84.0%
if -7.79999999999999943e-98 < z < 1.64999999999999999e-92Initial program 96.2%
+-commutative96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in z around 0 82.0%
+-commutative82.0%
associate-/l*84.9%
Simplified84.9%
Final simplification84.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.5e+91) (+ x (/ y (/ (- z a) z))) (if (<= z 3.05e+29) (+ x (* y (/ t (- a z)))) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+91) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 3.05e+29) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (1.0 - (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 (z <= (-6.5d+91)) then
tmp = x + (y / ((z - a) / z))
else if (z <= 3.05d+29) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y * (1.0d0 - (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 (z <= -6.5e+91) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 3.05e+29) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+91: tmp = x + (y / ((z - a) / z)) elif z <= 3.05e+29: tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+91) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= 3.05e+29) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.5e+91) tmp = x + (y / ((z - a) / z)); elseif (z <= 3.05e+29) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+91], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.05e+29], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+91}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{+29}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -6.4999999999999997e91Initial program 99.8%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 91.7%
if -6.4999999999999997e91 < z < 3.0499999999999999e29Initial program 97.6%
Taylor expanded in t around inf 86.3%
associate-*r/86.3%
mul-1-neg86.3%
distribute-lft-neg-out86.3%
*-commutative86.3%
*-lft-identity86.3%
times-frac89.1%
/-rgt-identity89.1%
distribute-neg-frac89.1%
distribute-neg-frac289.1%
neg-sub089.1%
sub-neg89.1%
+-commutative89.1%
associate--r+89.1%
neg-sub089.1%
remove-double-neg89.1%
Simplified89.1%
if 3.0499999999999999e29 < z Initial program 99.9%
Taylor expanded in a around 0 67.0%
associate-/l*88.0%
div-sub88.0%
*-inverses88.0%
Simplified88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e-80) (not (<= z 1.4e+28))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e-80) || !(z <= 1.4e+28)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.15d-80)) .or. (.not. (z <= 1.4d+28))) then
tmp = x + y
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e-80) || !(z <= 1.4e+28)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e-80) or not (z <= 1.4e+28): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e-80) || !(z <= 1.4e+28)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.15e-80) || ~((z <= 1.4e+28))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e-80], N[Not[LessEqual[z, 1.4e+28]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-80} \lor \neg \left(z \leq 1.4 \cdot 10^{+28}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.1499999999999999e-80 or 1.4000000000000001e28 < z Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 71.0%
+-commutative71.0%
Simplified71.0%
if -1.1499999999999999e-80 < z < 1.4000000000000001e28Initial program 97.1%
Taylor expanded in z around 0 81.6%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.9e-77) (not (<= z 0.0052))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.9e-77) || !(z <= 0.0052)) {
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 ((z <= (-5.9d-77)) .or. (.not. (z <= 0.0052d0))) 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 ((z <= -5.9e-77) || !(z <= 0.0052)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.9e-77) or not (z <= 0.0052): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.9e-77) || !(z <= 0.0052)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.9e-77) || ~((z <= 0.0052))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.9e-77], N[Not[LessEqual[z, 0.0052]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{-77} \lor \neg \left(z \leq 0.0052\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.89999999999999965e-77 or 0.0051999999999999998 < z Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 69.6%
+-commutative69.6%
Simplified69.6%
if -5.89999999999999965e-77 < z < 0.0051999999999999998Initial program 96.9%
+-commutative96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in y around 0 58.3%
Final simplification64.2%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.5%
(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 98.5%
+-commutative98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in y around 0 51.6%
(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(y / Float64(Float64(z - a) / Float64(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[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024137
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))