
(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 8 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 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 99.2%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.4e-21) (not (<= z 3.2e-140))) (+ x (* y (/ (- z t) z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e-21) || !(z <= 3.2e-140)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.4d-21)) .or. (.not. (z <= 3.2d-140))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e-21) || !(z <= 3.2e-140)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e-21) or not (z <= 3.2e-140): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e-21) || !(z <= 3.2e-140)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.4e-21) || ~((z <= 3.2e-140))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e-21], N[Not[LessEqual[z, 3.2e-140]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-21} \lor \neg \left(z \leq 3.2 \cdot 10^{-140}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -3.4e-21 or 3.2000000000000001e-140 < z Initial program 99.9%
Taylor expanded in a around 0 87.4%
if -3.4e-21 < z < 3.2000000000000001e-140Initial program 98.2%
Taylor expanded in z around 0 81.9%
expm1-log1p-u58.9%
expm1-udef51.0%
div-inv51.0%
associate-*l*56.0%
div-inv56.0%
Applied egg-rr56.0%
expm1-def63.0%
expm1-log1p88.0%
*-commutative88.0%
associate-*l/81.9%
associate-/l*89.6%
Simplified89.6%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e-26) (not (<= z 3.2e-140))) (+ x (/ y (/ z (- z t)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e-26) || !(z <= 3.2e-140)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.3d-26)) .or. (.not. (z <= 3.2d-140))) then
tmp = x + (y / (z / (z - t)))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e-26) || !(z <= 3.2e-140)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e-26) or not (z <= 3.2e-140): tmp = x + (y / (z / (z - t))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e-26) || !(z <= 3.2e-140)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.3e-26) || ~((z <= 3.2e-140))) tmp = x + (y / (z / (z - t))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e-26], N[Not[LessEqual[z, 3.2e-140]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-26} \lor \neg \left(z \leq 3.2 \cdot 10^{-140}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -4.29999999999999988e-26 or 3.2000000000000001e-140 < z Initial program 99.9%
add-cube-cbrt99.6%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 70.4%
associate-/l*87.4%
Simplified87.4%
if -4.29999999999999988e-26 < z < 3.2000000000000001e-140Initial program 98.2%
Taylor expanded in z around 0 81.9%
expm1-log1p-u58.9%
expm1-udef51.0%
div-inv51.0%
associate-*l*56.0%
div-inv56.0%
Applied egg-rr56.0%
expm1-def63.0%
expm1-log1p88.0%
*-commutative88.0%
associate-*l/81.9%
associate-/l*89.6%
Simplified89.6%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e-21) (+ x (/ y (/ z (- z t)))) (if (<= z 1.25e-20) (+ x (* (/ y a) (- t z))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e-21) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 1.25e-20) {
tmp = x + ((y / a) * (t - z));
} else {
tmp = x + (y * ((z - 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 <= (-8d-21)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 1.25d-20) then
tmp = x + ((y / a) * (t - z))
else
tmp = x + (y * ((z - 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 <= -8e-21) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 1.25e-20) {
tmp = x + ((y / a) * (t - z));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e-21: tmp = x + (y / (z / (z - t))) elif z <= 1.25e-20: tmp = x + ((y / a) * (t - z)) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e-21) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 1.25e-20) tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8e-21) tmp = x + (y / (z / (z - t))); elseif (z <= 1.25e-20) tmp = x + ((y / a) * (t - z)); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e-21], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e-20], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-21}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-20}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -7.99999999999999926e-21Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 74.1%
associate-/l*92.4%
Simplified92.4%
if -7.99999999999999926e-21 < z < 1.25e-20Initial program 98.5%
+-commutative98.5%
associate-*r/92.1%
associate-*l/97.1%
fma-def97.1%
Simplified97.1%
Taylor expanded in a around inf 82.8%
mul-1-neg82.8%
unsub-neg82.8%
associate-/l*88.5%
associate-/r/87.8%
Simplified87.8%
if 1.25e-20 < z Initial program 100.0%
Taylor expanded in a around 0 93.3%
Final simplification90.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.6e+20)
(+ x (/ y (/ z (- z t))))
(if (<= z 4100000000.0)
(- x (* t (/ y (- z a))))
(+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e+20) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 4100000000.0) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * ((z - 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 <= (-2.6d+20)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 4100000000.0d0) then
tmp = x - (t * (y / (z - a)))
else
tmp = x + (y * ((z - 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 <= -2.6e+20) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 4100000000.0) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.6e+20: tmp = x + (y / (z / (z - t))) elif z <= 4100000000.0: tmp = x - (t * (y / (z - a))) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e+20) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 4100000000.0) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.6e+20) tmp = x + (y / (z / (z - t))); elseif (z <= 4100000000.0) tmp = x - (t * (y / (z - a))); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e+20], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4100000000.0], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+20}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 4100000000:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -2.6e20Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 72.7%
associate-/l*94.4%
Simplified94.4%
if -2.6e20 < z < 4.1e9Initial program 98.7%
Taylor expanded in t around inf 85.5%
mul-1-neg85.5%
*-commutative85.5%
associate-*l/90.3%
distribute-rgt-neg-out90.3%
Simplified90.3%
if 4.1e9 < z Initial program 100.0%
Taylor expanded in a around 0 94.5%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.45e+20) (+ x y) (if (<= z 1.65e-16) (+ x (/ y (/ a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e+20) {
tmp = x + y;
} else if (z <= 1.65e-16) {
tmp = x + (y / (a / 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 (z <= (-2.45d+20)) then
tmp = x + y
else if (z <= 1.65d-16) then
tmp = x + (y / (a / 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 (z <= -2.45e+20) {
tmp = x + y;
} else if (z <= 1.65e-16) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.45e+20: tmp = x + y elif z <= 1.65e-16: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.45e+20) tmp = Float64(x + y); elseif (z <= 1.65e-16) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.45e+20) tmp = x + y; elseif (z <= 1.65e-16) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.45e+20], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.65e-16], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+20}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-16}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.45e20 or 1.64999999999999994e-16 < z Initial program 100.0%
+-commutative100.0%
associate-*r/73.4%
associate-*l/94.3%
fma-def94.3%
Simplified94.3%
Taylor expanded in z around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -2.45e20 < z < 1.64999999999999994e-16Initial program 98.6%
Taylor expanded in z around 0 76.5%
expm1-log1p-u56.6%
expm1-udef50.8%
div-inv50.8%
associate-*l*54.5%
div-inv54.5%
Applied egg-rr54.5%
expm1-def59.7%
expm1-log1p81.0%
*-commutative81.0%
associate-*l/76.5%
associate-/l*81.6%
Simplified81.6%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.2e-39) (+ x y) (if (<= z 4.9e-51) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e-39) {
tmp = x + y;
} else if (z <= 4.9e-51) {
tmp = x;
} 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 <= (-4.2d-39)) then
tmp = x + y
else if (z <= 4.9d-51) then
tmp = x
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 <= -4.2e-39) {
tmp = x + y;
} else if (z <= 4.9e-51) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.2e-39: tmp = x + y elif z <= 4.9e-51: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e-39) tmp = Float64(x + y); elseif (z <= 4.9e-51) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.2e-39) tmp = x + y; elseif (z <= 4.9e-51) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e-39], N[(x + y), $MachinePrecision], If[LessEqual[z, 4.9e-51], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-39}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.19999999999999987e-39 or 4.89999999999999974e-51 < z Initial program 100.0%
+-commutative100.0%
associate-*r/77.5%
associate-*l/95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in z around inf 79.1%
+-commutative79.1%
Simplified79.1%
if -4.19999999999999987e-39 < z < 4.89999999999999974e-51Initial program 98.4%
+-commutative98.4%
associate-*r/92.2%
associate-*l/96.9%
fma-def96.9%
Simplified96.9%
Taylor expanded in y around 0 51.6%
Final simplification65.7%
(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 99.2%
+-commutative99.2%
associate-*r/84.7%
associate-*l/96.1%
fma-def96.1%
Simplified96.1%
Taylor expanded in y around 0 53.1%
Final simplification53.1%
(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 2023279
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))